合 人大金仓执行root.sh报错“line 22: can not find startupcfg.sh: command not found”
现象
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | [root@lhrkingbase /]# /opt/Kingbase/ES/V8/install/script/root.sh /opt/Kingbase/ES/V8/install/script/root.sh: line 22: can not find startupcfg.sh: command not found [root@lhrkingbase /]# cat /opt/Kingbase/ES/V8/install/script/root.sh #!/bin/bash ROOT_UID=0 INSTALLDIR=@@INSTALL_DIR@@ USERNAME=@@USER_NAME@@ DATADIR=@@DATA_DIR@@ VERSION=V8 SERVICENAME=kingbase8d # Run as root, of course. if [ x"$UID" != x"$ROOT_UID" ] then echo "Must be root to run this script, and root.sh should be executed in the '$0' way, not 'sh $0'." exit 1 fi if [ -d $INSTALLDIR/Scripts ]; then $INSTALLDIR/Scripts/startupcfg.sh $VERSION $USERNAME $INSTALLDIR $DATADIR $SERVICENAME elif [ -d $INSTALLDIR/install/script ]; then $INSTALLDIR/install/script/startupcfg.sh $VERSION $USERNAME $INSTALLDIR $DATADIR $SERVICENAME else "can not find startupcfg.sh" fi [root@lhrkingbase /]# cd /opt/Kingbase/ES/V8/install/script/ [root@lhrkingbase script]# ll total 28 -rwxr-xr-x 1 kingbase kingbase 321 Mar 5 2021 consoleCloud-uninstall.sh -rwxr-xr-x 1 kingbase kingbase 2199 Nov 25 21:26 initcluster.sh -rwxr-x--- 1 kingbase kingbase 289 Apr 9 2020 javatools.sh -rwxr-xr-x 1 kingbase kingbase 578 Feb 15 19:46 rootDeployClusterware.sh -rwxr-x--- 1 kingbase kingbase 702 Mar 31 08:32 root.sh -rwxr-x--- 1 kingbase kingbase 690 Sep 22 2020 rootuninstall.sh -rwxr-x--- 1 kingbase kingbase 3694 Feb 11 18:37 startupcfg.sh |
分析
安装过程可能有错误导致root.sh中的几个参数没有被正确替换,
1 2 3 | INSTALLDIR=@@INSTALL_DIR@@ USERNAME=@@USER_NAME@@ DATADIR=@@DATA_DIR@@ |
解决
手动初始化实例, 然后根据初始化后的路径修改对应参数,例如: