昨天在docker上跑了一个nacos,今天就寻思在本地上安装一下nacos,然后安装步骤一切正常,然后在配置自启和以systemd的方式管理docker后进行启动,出现了报错
1 ERROR: Please set the JAVA_HOME variable in your environment, We need java(x64)! jdk8 or later is better! !!
这里翻译一下:错误:请在您的环境中设置JAVA_HOME变量,我们需要JAVA(x64)!jdk8或更高版本更好!!
意思是说我们的java变量没有配置或者jdk版本过低,但是我用的是新下载的最高的版本,然后再排查java变量配置发现应该是启动脚本里面没有配置java变量
然后将启动脚本的java变量配置了一下
[root@node4 bin]# vi startup.sh
JAVA_HOME=/data/java/jdk1.8.0_341
##这里的地址的我的java绝对地址
[root@node4 bin]# pwd /data/nacos/bin
再次启动成功
[root@node4 bin]# systemctl start nacos [root@node4 bin]# systemctl status nacos ● nacos.service - nacos Loaded: loaded (/usr/lib/systemd/system/nacos.service; disabled; vendor preset: disabled) Active: active (running) since 五 2022-09-23 10:15:05 CST; 9min ago Process: 29478 ExecStart=/bin/bash /data/nacos/bin/startup.sh -m standalone (code=exited, status=0/SUCCESS) Tasks: 176 Memory: 612.8M CGroup: /system.slice/nacos.service └─29498 /data/java/jdk1.8.0_341/bin/java -Djava.ext.dirs=/data/java/jdk1.8.0_341/jre/lib/ext:/data/java/jdk1.8.0_341/lib/ext -Xms512m -Xmx512m -Xmn256m ... 9月 23 10:15:05 node4 systemd[1]: Starting nacos... 9月 23 10:15:05 node4 bash[29478]: /data/java/jdk1.8.0_341/bin/java -Djava.ext.dirs=/data/java/jdk1.8.0_341/jre/lib/ext:/data/java/jdk1.8.0_341/lib/ext ...-XX:+Print 9月 23 10:15:05 node4 bash[29478]: nacos is starting with standalone 9月 23 10:15:05 node4 systemd[1]: Started nacos. 9月 23 10:15:05 node4 bash[29478]: nacos is starting,you can check the /data/nacos/logs/start.out Hint: Some lines were ellipsized, use -l to show in full.
浏览器访问
标签:bin,set,java,nacos,报错,341,data,node4 From: https://www.cnblogs.com/daiqinghui/p/16721851.html