1. 错误现象
参考openGauss 官方手册安装,在执行初始化脚本时报错:
[dave@www.cndba.cn script]# pwd
/data/software/openGauss/script
[dave@www.cndba.cn script]# ./gs_preinstall -U omm -G dbgrp -X /data/software/openGauss/cluster_config.xml
Parsing the configuration file.
Successfully parsed the configuration file.
Installing the tools on the local node.
Successfully installed the tools on the local node.
Setting host ip env
Successfully set host ip env.
Are you sure you want to create the user[omm] (yes/no)? yes
Please enter password for cluster user.
Password:
Please enter password for cluster user again.
Password:
Generate cluster user password files successfully.
[GAUSS-51400] : Failed to execute the command: python3 '/data/software/openGauss/script/local/PreInstallUtility.py' -t create_os_user -u omm -g dbgrp -l /var/log/omm/omm/om/gs_local.log. Error:
not all arguments converted during string formatting
[dave@www.cndba.cn script]#
2. 分析并解决
[dave@www.cndba.cn script]# python3 '/data/software/openGauss/script/local/PreInstallUtility.py' --help
Usage:
python3 PreInstallUtility.py -t action -u user -T warning_type
[-g group] [-X xmlfile] [-P path] [-Q clusterToolPath] [-D mount_path]
[-e "envpara=value" [...]] [-w warningserverip] [-h nodename]
[-s mpprc_file] [--check_empty] [-l log]
Common options:
-t The type of action.
-u The OS user of cluster.
-g The OS user's group of cluster.
-X The XML file path.
-P The path to be check.
-Q The path of cluster tool.
-e "envpara=value" The OS user environment variable.
--check_empty Check path empty.
-s The path of MPP environment file.
-l The path of log file.
-R The path of cluster install path.
--help Show this help, then exit.
[dave@www.cndba.cn script]# id omm
uid=5701(omm) gid=5701(dbgroup) groups=5701(dbgroup)
[dave@www.cndba.cn script]#
查看脚本帮助,参数个数和大小都没有问题,但是传的参数名称错误。 脚本自动创建的omm 用户是组是: dbgroup,但是脚本传过去的是:-g dbgrp。
实际上这个group 是我们参考官方文档直接复制过来的,修改成dbgroup后,执行不在报错:
[dave@www.cndba.cn script]# ./gs_preinstall -U omm -G dbgroup -X /data/software/openGauss/cluster_config.xml
版权声明:本文为博主原创文章,未经博主允许不得转载。