399 Star 1.3K Fork 1.5K

GVPopenGauss / openGauss-server

 / 详情

[GAUSS-50202] : The /opt/huawei/install must be empty...gs_preinstall 提示omm用户没有正确创建目录

待办的
缺陷
创建于  
2023-01-04 17:12

系统版本:
[root@openGaussNode1 opt]# cat /etc/openEuler-release
openEuler release 20.03 (LTS-SP3)

数据库版本:
[root@openGaussNode1 opt]# /opt/software/openGauss/script/gs_preinstall -V
gs_preinstall (openGauss OM 3.1.0 build 4a933fde) compiled at 2022-09-29 14:36:48 commit 0 last mr

数据库安装是单节点安装,按照文档提供的xml配置文件进行了修改:

<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
    <!-- openGauss整体信息 -->
    <CLUSTER>
        <!-- 数据库名称 -->
        <PARAM name="clusterName" value="openGaussCluster" />
        <!-- 数据库节点名称(hostname) -->
        <PARAM name="nodeNames" value="openGaussNode1" />
        <!-- 数据库安装目录-->
        <PARAM name="gaussdbAppPath" value="/opt/huawei/install/app" />
        <!-- 日志目录-->
        <PARAM name="gaussdbLogPath" value="/var/log/omm" />
        <!-- 临时文件目录-->
        <PARAM name="tmpMppdbPath" value="/opt/huawei/tmp" />
        <!-- 数据库工具目录-->
        <PARAM name="gaussdbToolPath" value="/opt/huawei/install/om" />
        <!-- 数据库core文件目录-->
        <PARAM name="corePath" value="/opt/huawei/corefile" />
        <!-- 节点IP,与数据库节点名称列表一一对应 -->
        <PARAM name="backIp1s" value="10.176.122.80"/>
    </CLUSTER>
    <!-- 每台服务器上的节点部署信息 -->
    <DEVICELIST>
        <!-- 节点1上的部署信息 -->
        <DEVICE sn="openGaussNode1">
            <!-- 节点1的主机名称 -->
            <PARAM name="name" value="openGaussNode1"/>
            <!-- 节点1所在的AZ及AZ优先级 -->
            <PARAM name="azName" value="AZ1"/>
            <PARAM name="azPriority" value="1"/>
            <!-- 节点1的IP,如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP -->
            <PARAM name="backIp1" value="10.176.122.80"/>
            <PARAM name="sshIp1" value="10.176.122.80"/>

	    <!--dbnode-->
	    <PARAM name="dataNum" value="1"/>
	    <PARAM name="dataPortBase" value="15400"/>
	    <PARAM name="dataNode1" value="/opt/huawei/install/data/dn"/>
            <PARAM name="dataNode1_syncNum" value="0"/>
        </DEVICE>
    </DEVICELIST>
</ROOT>

在执行gs_preinstall之前并没有手动创建/opt下的huawei目录,而是通过脚本自动生成目录,执行情况如下:

[root@openGaussNode1 opt]# /opt/software/openGauss/script/gs_preinstall -U omm -G dbgrp -X /opt/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
Preparing SSH service.
Successfully prepared SSH service.
Checking OS software.
Successfully check os software.
Checking OS version.
Successfully checked OS version.
Creating cluster's path.
[GAUSS-50202] : The /opt/huawei/install must be empty. Or user [omm] has write permission to directory /opt/huawei/install. Because it will create symbolic link [/opt/huawei/install/app] to install path [/opt/huawei/install/app_4e931f9a] in gs_install process with this user.

查看log,log显示如下:

[2023-01-04 17:05:36.600396][21670][gs_preinstall(initGlobals:390)][gs_preinstall][LOG][Step1]:Parsing the configuration file.
[2023-01-04 17:05:36.606543][21670][gs_preinstall(initGlobals:406)][gs_preinstall][LOG][Step1]:Successfully parsed the configuration file.
[2023-01-04 17:05:47.856063][21670][gs_preinstall][DEBUG]:gs_preinstall execution takes 14 steps in total
[2023-01-04 17:05:48.015617][21670][gs_preinstall][DEBUG]:There is no install cluster exist. Skip check repeat install.
[2023-01-04 17:05:48.015784][21670][PreinstallImplOLAP.py(installToolsPhase1:79)][gs_preinstall][LOG][Step2]:Installing the tools on the local node.
[2023-01-04 17:05:48.317976][21670][gs_preinstall][DEBUG]:Modifying logPath owner
[2023-01-04 17:05:48.318133][21670][gs_preinstall][DEBUG]:Successfully modified logPath owner
[2023-01-04 17:05:55.911266][21670][PreinstallImplOLAP.py(installToolsPhase1:247)][gs_preinstall][LOG][Step2]:Successfully installed the tools on the local node.
[2023-01-04 17:05:55.915725][21670][PreinstallImplOLAP.py(setHostIpEnv:398)][gs_preinstall][LOG][Step3]:Setting host ip env
[2023-01-04 17:05:55.921048][21670][PreinstallImplOLAP.py(setHostIpEnv:410)][gs_preinstall][LOG][Step3]:Successfully set host ip env.
[2023-01-04 17:05:55.921196][21670][gs_preinstall][DEBUG]:Creating OS user and create trust for user
[2023-01-04 17:06:24.411442][21670][gs_preinstall][DEBUG]:Setting the flag for creating user's trust.
[2023-01-04 17:06:24.583955][21670][gs_preinstall][DEBUG]:Successfully set the flag for creating user's trust
[2023-01-04 17:06:24.584287][21670][PreinstallImpl.py(prepareSshdService:1113)][gs_preinstall][LOG][Step4]:Preparing SSH service.
[2023-01-04 17:06:24.766592][21670][PreinstallImpl.py(prepareSshdService:1132)][gs_preinstall][LOG][Step4]:Successfully prepared SSH service.
[2023-01-04 17:06:25.137047][21670][PreinstallImpl.py(checkOSSoftware:1455)][gs_preinstall][LOG][Step5]:Checking OS software.
[2023-01-04 17:06:25.137762][21670][gs_preinstall][DEBUG]:Checking OS software: python3 '/opt/software/openGauss/script/local/PreInstallUtility.py' -t check_os_software -u omm -l /var/log/omm/omm/om/gs_local.log 
[2023-01-04 17:06:25.318613][21670][PreinstallImpl.py(checkOSSoftware:1475)][gs_preinstall][LOG][Step5]:Successfully check os software.
[2023-01-04 17:06:25.318792][21670][PreinstallImpl.py(checkOSVersion:722)][gs_preinstall][LOG][Step6]:Checking OS version.
[2023-01-04 17:06:25.487440][21670][PreinstallImpl.py(checkOSVersion:737)][gs_preinstall][LOG][Step6]:Successfully checked OS version.
[2023-01-04 17:06:25.487626][21670][PreinstallImpl.py(createDirs:917)][gs_preinstall][LOG][Step7]:Creating cluster's path.
[2023-01-04 17:06:25.487754][21670][gs_preinstall][DEBUG]:Paths need to be fixed owner:['/opt/huawei'].
[2023-01-04 17:06:26.279246][21670][gs_preinstall][ERROR]:[GAUSS-50202] : The /opt/huawei/install must be empty. Or user [omm] has write permission to directory /opt/huawei/install. Because it will create symbolic link [/opt/huawei/install/app] to install path [/opt/huawei/install/app_4e931f9a] in gs_install process with this user.

倒数第二条log显示Paths need to be fixed owner:['/opt/huawei'].不太理解

尝试手动创建/opt/huawei/install目录、手动创建/opt/huawei目录、手动创建/opt/huawei/install目录并给omm用户增加权限均无法解决问题。

在另一台配置设置相同的机器上重复上述操作依然出现上述bug,并且报错信息:

[GAUSS-50202] : The /opt/huawei/install must be empty. Or user [omm] has write permission to directory /opt/huawei/install. Because it will create symbolic link [/opt/huawei/install/app] to install path [/opt/huawei/install/app_4e931f9a] in gs_install process with this user.

中app_4e931f9a与上一台机器相同

2023.01.05 更新:
尝试反复修改文件夹和owner未果,遂尝试阅读gs_preinstall代码,检索"Or user [omm] has write permission to directory"报错内容发现/opt/software/openGauss/script/local/PreInstallUtility.py文件中如图所示的cmd返回结果显示bc库缺失,通过yum -y install bc解决。

su - omm -c "if [ -w *** ];then echo *** else echo *** line 26: bc: command not found
/etc/profile.d/system-info.sh: line 35: bc: command not found

输入图片说明

建议这里如果cmd执行报错,logger应当打印cmd执行报错内容。

评论 (3)

张添翼 创建了缺陷

Hey @张添翼, Welcome to openGauss Community.
All of the projects in openGauss Community are maintained by @opengauss-bot.
That means the developers can comment below every pull request or issue to trigger Bot Commands.
Please follow instructions at Here to find the details.

Hi @张添翼, please use the command /sig xxx to add a SIG label to this issue.
For example: /sig sqlengine or /sig storageengine or /sig om or /sig ai and so on.
You can find more SIG labels from Here.
If you have no idea about that, please contact with @xiangxinyong , @zhangxubo .

张添翼 修改了描述
张添翼 修改了标题
yansong_lee 负责人设置为zhangxubo
yansong_lee 优先级设置为不重要
张添翼 修改了描述
张添翼 修改了描述
张添翼 修改了描述
张添翼 修改了描述

建议这里如果cmd执行报错,logger应当打印cmd执行报错内容。

周斌 负责人zhangxubo 修改为蒋宏博
周斌 计划截止日期设置为2023-04-22

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
5622128 opengauss bot 1581905080
C++
1
https://gitee.com/opengauss/openGauss-server.git
git@gitee.com:opengauss/openGauss-server.git
opengauss
openGauss-server
openGauss-server

搜索帮助