Errors installing Ambry on a Windows based machine
Hi everyone,
I'm new here and I'm trying to install Ambry on my machine. These are the steps that I executed: $ git clone https://github.com/linkedin/ambry.git $ cd ambry $ ./gradlew allJar $ cd target $ mkdir logs
Then, when I try to execute the following: $ nohup java -Dlog4j.configuration=file:../config/log4j.properties -jar ambry.jar --serverPropsFilePath ../config/server.properties --hardwareLayoutFilePath ../config/HardwareLayout.json --partitionLayoutFilePath ../config/PartitionLayout.json > logs/server.log & I get the following error:
$ cat logs/server.log [2021-03-17 20:30:33,859] ERROR Exception during bootstrap of AmbryServer (com.github.ambry.server.AmbryMain) java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source) at com.github.ambry.utils.Utils.getObj(Utils.java:662) at com.github.ambry.server.AmbryMain.main(AmbryMain.java:45) Caused by: java.lang.IllegalStateException: Mount path has to be an absolute path. at com.github.ambry.clustermap.Disk.validateMountPath(Disk.java:128) at com.github.ambry.clustermap.Disk.validate(Disk.java:135) at com.github.ambry.clustermap.Disk.
(Disk.java:58) at com.github.ambry.clustermap.DataNode. (DataNode.java:78) at com.github.ambry.clustermap.Datacenter. (Datacenter.java:53) at com.github.ambry.clustermap.HardwareLayout. (HardwareLayout.java:58) at com.github.ambry.clustermap.StaticClusterAgentsFactory. (StaticClusterAgentsFactory.java:58) ... 6 more [2021-03-17 20:30:33,863] INFO Exiting AmbryMain (com.github.ambry.server.AmbryMain) [1]+ Exit 1 nohup java -Dlog4j.configuration=file:../config/log4j.properties -jar ambry.jar --serverPropsFilePath ../config/server.properties --hardwareLayoutFilePath ../config/HardwareLayout.json --partitionLayoutFilePath ../config/PartitionLayout.json > logs/server.log
I see that it says that mount path has to be an absolute path, so I adjusted my command to be: $ nohup java -Dlog4j.configuration=file:/d/users/sameeras/ambry2/config/log4j.properties -jar ambry.jar --serverPropsFilePath /d/users/sameeras/ambry2/config/server.properties --hardwareLayoutFilePath /d/users/sameeras/ambry2/config/HardwareLayout.json --partitionLayoutFilePath /d/users/sameeras/ambry2/config/PartitionLayout.json > logs/server.log &
And the result is:
$ cat logs/server.log log4j:ERROR Could not read configuration file from URL [file:/d/users/sameeras/ambry2/config/log4j.properties]. java.io.FileNotFoundException: \d\users\sameeras\ambry2\config\log4j.properties (The system cannot find the path specified) at java.base/java.io.FileInputStream.open0(Native Method) at java.base/java.io.FileInputStream.open(Unknown Source) at java.base/java.io.FileInputStream.
(Unknown Source) at java.base/java.io.FileInputStream. (Unknown Source) at java.base/sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source) at java.base/sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:557) at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526) at org.apache.log4j.LogManager. (LogManager.java:127) at org.slf4j.impl.Log4jLoggerFactory. (Log4jLoggerFactory.java:66) at org.slf4j.impl.StaticLoggerBinder. (StaticLoggerBinder.java:72) at org.slf4j.impl.StaticLoggerBinder. (StaticLoggerBinder.java:45) at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128) at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107) at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281) at com.github.ambry.server.AmbryMain. (AmbryMain.java:33) log4j:ERROR Ignoring configuration file [file:/d/users/sameeras/ambry2/config/log4j.properties]. log4j:WARN No appenders could be found for logger (com.github.ambry.server.AmbryMain). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. [1]+ Exit 1 nohup java -Dlog4j.configuration=file:/d/users/sameeras/ambry2/config/log4j.properties -jar ambry.jar --serverPropsFilePath /d/users/sameeras/ambry2/config/server.properties --hardwareLayoutFilePath /d/users/sameeras/ambry2/config/HardwareLayout.json --partitionLayoutFilePath /d/users/sameeras/ambry2/config/PartitionLayout.json > logs/server.log
Does anyone have any idea what could I be missing? Thanks in advance!
Hi @salamehsameera,
I will try this out on my windows machine later today, but could you try changing the paths to start with D:/ instead of /d/ (assuming D is the drive name)? Also, you may want to try removing the drive specifier (e.g. /users/sameeras/ambry2/config/log4j.properties instead)
Thanks @cgtz, I tried both and it did not work out unfortunately, here's the log output: 1.
sameeras@LT-260-PTH-6124 MINGW64 ~/ambry2/target (master) $ nohup java -Dlog4j.configuration=file:D:/users/sameeras/ambry2/config/log4j.properties -jar ambry.jar --serverPropsFilePath D:/users/sameeras/ambry2/config/server.properties --hardwareLayoutFilePath D:/users/sameeras/ambry2/config/HardwareLayout.json --partitionLayoutFilePath D:/users/sameeras/ambry2/config/PartitionLayout.json > logs/server.log & [1] 1425 nohup: ignoring input and redirecting stderr to stdout
sameeras@LT-260-PTH-6124 MINGW64 ~/ambry2/target (master) $ cat logs/server.log [2021-03-18 21:20:05,280] ERROR Exception during bootstrap of AmbryServer (com.github.ambry.server.AmbryMain) java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source) at com.github.ambry.utils.Utils.getObj(Utils.java:662) at com.github.ambry.server.AmbryMain.main(AmbryMain.java:45) Caused by: java.lang.IllegalStateException: Mount path has to be an absolute path. at com.github.ambry.clustermap.Disk.validateMountPath(Disk.java:128) at com.github.ambry.clustermap.Disk.validate(Disk.java:135) at com.github.ambry.clustermap.Disk.
(Disk.java:58) at com.github.ambry.clustermap.DataNode. (DataNode.java:78) at com.github.ambry.clustermap.Datacenter. (Datacenter.java:53) at com.github.ambry.clustermap.HardwareLayout. (HardwareLayout.java:58) at com.github.ambry.clustermap.StaticClusterAgentsFactory. (StaticClusterAgentsFactory.java:58) ... 6 more [2021-03-18 21:20:05,285] INFO Exiting AmbryMain (com.github.ambry.server.AmbryMain) [1]+ Exit 1 nohup java -Dlog4j.configuration=file:D:/users/sameeras/ambry2/config/log4j.properties -jar ambry.jar --serverPropsFilePath D:/users/sameeras/ambry2/config/server.properties --hardwareLayoutFilePath D:/users/sameeras/ambry2/config/HardwareLayout.json --partitionLayoutFilePath D:/users/sameeras/ambry2/config/PartitionLayout.json > logs/server.log
sameeras@LT-260-PTH-6124 MINGW64 ~/ambry2/target (master) $ nohup java -Dlog4j.configuration=file:/users/sameeras/ambry2/config/log4j.properties -jar ambry.jar --serverPropsFilePath /users/sameeras/ambry2/config/server.properties --hardwareLayoutFilePath /users/sameeras/ambry2/config/HardwareLayout.json --partitionLayoutFilePath /users/sameeras/ambry2/config/PartitionLayout.json > logs/server.log & [1] 1443 nohup: ignoring input and redirecting stderr to stdout
sameeras@LT-260-PTH-6124 MINGW64 ~/ambry2/target (master) $ cat logs/server.log [2021-03-18 21:21:17,432] ERROR Exception during bootstrap of AmbryServer (com.github.ambry.server.AmbryMain) java.io.FileNotFoundException: C:\Program Files\Git\users\sameeras\ambry2\config\server.properties (The system cannot find the path specified) at java.base/java.io.FileInputStream.open0(Native Method) at java.base/java.io.FileInputStream.open(Unknown Source) at java.base/java.io.FileInputStream.
(Unknown Source) at java.base/java.io.FileInputStream. (Unknown Source) at com.github.ambry.utils.Utils.loadProps(Utils.java:782) at com.github.ambry.server.AmbryMain.main(AmbryMain.java:40) [2021-03-18 21:21:17,434] INFO Exiting AmbryMain (com.github.ambry.server.AmbryMain) [1]+ Exit 1 nohup java -Dlog4j.configuration=file:/users/sameeras/ambry2/config/log4j.properties -jar ambry.jar --serverPropsFilePath /users/sameeras/ambry2/config/server.properties --hardwareLayoutFilePath /users/sameeras/ambry2/config/HardwareLayout.json --partitionLayoutFilePath /users/sameeras/ambry2/config/PartitionLayout.json > logs/server.log