在学习SpringCloud Alibaba时,需要安装部署nacos,在ubuntu18下我遇到了这样的问题
➜ bin sudo bash -f ./startup.sh -m standalone
readlink: missing operand
Try 'readlink --help' for more information.
dirname: missing operand
Try 'dirname --help' for more information.
ERROR: Please set the JAVA_HOME variable in your environment, We need java(x64)! jdk8 or later is better! !!
提示没有设定java环境变量,但是当我使用 java -version查看时又可以
➜ ~ java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
这个是nacos的脚本没有找到jdk的环境变量配置,需要修改一下nacos的启动脚本
[ ! -e "$JAVA_HOME/bin/java" ] && 你的javaHome地址
#例如
[ ! -e "$JAVA_HOME/bin/java" ] && JAVA_HOME=/home/frend/dev/tools/jdk1.8.0_144
接着就可以启动了
➜ bin sudo bash -f ./startup.sh -m standalone
/home/frend/dev/tools/jdk1.8.0_144/bin/java -Xms512m -Xmx512m -Xmn256m -Dnacos.standalone=true -Djava.ext.dirs=/home/frend/dev/tools/jdk1.8.0_144/jre/lib/ext:/home/frend/dev/tools/jdk1.8.0_144/lib/ext -Xloggc:/home/frend/dev/tools/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dloader.path=/home/frend/dev/tools/nacos/plugins/health,/home/frend/dev/tools/nacos/plugins/cmdb,/home/frend/dev/tools/nacos/plugins/mysql -Dnacos.home=/home/frend/dev/tools/nacos -jar /home/frend/dev/tools/nacos/target/nacos-server.jar --spring.config.location=classpath:/,classpath:/config/,file:./,file:./config/,file:/home/frend/dev/tools/nacos/conf/ --logging.config=/home/frend/dev/tools/nacos/conf/nacos-logback.xml --server.max-http-header-size=524288
nacos is starting with standalone
nacos is starting,you can check the /home/frend/dev/tools/nacos/logs/start.out
网友评论