linux单机模式启动nacos失败
使用命令
sh startup.sh -m standalone
启动报错:
./startup.sh: 78: ./startup.sh: [[: not found
./startup.sh: 88: ./startup.sh: [[: not found
./startup.sh: 90: ./startup.sh: [[: not found
./startup.sh: 96: ./startup.sh: [[: not found
问题原因:
startup.sh文件中:
if [ -z "$pid" ] ; then
echo "No nacosServer running."
exit -1;
linux 使用的是 sh ,而 macos 使用的是 bash 。
而”[[]]”是bash脚本中的命令,因此在执行时,使用sh命令会报错,将sh替换为bash命令即可。
解决方法:
bash -f ./startup.sh -m standalone