nacos 开启启动不起来
1,开机启动增加脚本
/etc/rc.local
/opt/soft/nacos/bin/./startup-port.sh 8848
2,但是reboot机器之后,那nacos没有启动起来,java -version,echo $JAVA_HOME 都是有值的
3,检查/va/log/message 报如下错误
Apr 7 10:18:53 ip-172-30-10-185 systemd: Starting /etc/rc.d/rc.local Compatibility... Apr 7 10:18:53 ip-172-30-10-185 rc.local: which: no javac in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin) Apr 7 10:18:53 ip-172-30-10-185 rc.local: readlink: missing operand Apr 7 10:18:53 ip-172-30-10-185 rc.local: Try 'readlink --help' for more information. Apr 7 10:18:53 ip-172-30-10-185 rc.local: dirname: missing operand Apr 7 10:18:53 ip-172-30-10-185 systemd: Started /etc/rc.d/rc.local Compatibility. Apr 7 10:18:53 ip-172-30-10-185 rc.local: Try 'dirname --help' for more information. Apr 7 10:18:53 ip-172-30-10-185 rc.local: ERROR: Please set the JAVA_HOME variable in your environment, We need java(x64)! jdk8 or later is better! !!
4,原因应该是root启动的时候,JAVA_HOME环境变量没有设置进去,或者就没有读到
5,修改开机启动命令
source /etc/profile
/opt/soft/nacos/bin/./startup-port.sh 8848
本文来自博客园,作者:春江潮水连海平,转载请注明原文链接:https://www.cnblogs.com/alonewaiting/p/16111096.html