暂无图片
opengauss安装报错:The program "gaussdb" is needed by gs_initdb but was not found in the same directory as
我来答
分享
刘洪
2022-07-05
opengauss安装报错:The program "gaussdb" is needed by gs_initdb but was not found in the same directory as

VirtualBox Centos7.6 安装openGauss单节点,安装失败报错

opengauss xml安装配置文件

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

预安装:

[root@db1 script]# ${PG_HOME}/script/gs_preinstall -U omm -G dbgrp -X ${PG_HOME}/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 pssh path
Successfully set core path.
Are you sure you want to create the user[omm] and create trust for it (yes/no)? yes
Please enter password for cluster user.
Password: 
Please enter password for cluster user again.
Password: 
Successfully created [omm] user on all nodes.
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.
Successfully created cluster's path.
Set and check OS parameter.
Setting OS parameters.
Successfully set OS parameters.
Warning: Installation environment contains some warning messages.
Please get more details by "/data/software/openGauss/script/gs_checkos -i A -h db1 --detail".
Set and check OS parameter completed.
Preparing CRON service.
Successfully prepared CRON service.
Setting user environmental variables.
Successfully set user environmental variables.
Setting the dynamic link library.
Successfully set the dynamic link library.
Setting Core file
Successfully set core path.
Setting pssh path
Successfully set pssh path.
Setting Cgroup.
Successfully set Cgroup.
Set ARM Optimization.
No need to set ARM Optimization.
Fixing server package owner.
Setting finish flag.
Successfully set finish flag.
Preinstallation succeeded.

# 安装前检查
[root@db1 script]# /data/software/openGauss/script/gs_checkos -i A -h db1 --detail
Checking items:
    A1. [ OS version status ]                                   : Normal     
        [db1]
        centos_7.6.1810_64bit
               
    A2. [ Kernel version status ]                               : Normal     
        The names about all kernel versions are same. The value is "3.10.0-957.el7.x86_64".
    A3. [ Unicode status ]                                      : Normal     
        The values of all unicode are same. The value is "LANG=en_US.UTF-8".
    A4. [ Time zone status ]                                    : Normal     
        The informations about all timezones are same. The value is "+0800".
    A5. [ Swap memory status ]                                  : Normal     
        The value about swap memory is correct.            
    A6. [ System control parameters status ]                    : Normal     
        All values about system control  parameters are correct.
    A7. [ File system configuration status ]                    : Normal     
        Both soft nofile and hard nofile are correct.      
    A8. [ Disk configuration status ]                           : Normal     
        The value about XFS mount parameters is correct.   
    A9. [ Pre-read block size status ]                          : Normal     
        The value about Logical block size is correct.     
    A10.[ IO scheduler status ]                                 : Normal     
        The value of IO scheduler is correct.              
    A11.[ Network card configuration status ]                   : Warning    
        [db1]
BondMode Null
        Warning reason: network 'eth0' 'mtu' RealValue '1500' ExpectedValue '8192'

    A12.[ Time consistency status ]                             : Normal     
        The ntpd service is started, local time is "2022-07-05 23:23:36".
    A13.[ Firewall service status ]                             : Normal     
        The firewall service is stopped.                   
    A14.[ THP service status ]                                  : Normal     
        The THP service is stopped.                        
Total numbers:14. Abnormal numbers:0. Warning numbers:1.

预安装检查全部通过

自定义内存参数安装

安装报错:The program “gaussdb” is needed by gs_initdb but was not found in the same directory as “/data/huawei/install/app/bin/gs_initdb”.

[omm@db1 script]$ ./gs_install -X /data/software/openGauss/script/clusterconfig.xml \
> --gsinit-parameter="--encoding=UTF8" \
> --dn-guc="max_connections=1000" \
> --dn-guc="max_process_memory=3GB" \
> --dn-guc="shared_buffers=128MB" \
> --dn-guc="bulk_write_ring_size=128MB" \
> --dn-guc="cstore_buffers=16MB"
Parsing the configuration file.
Check preinstall on every node.
Successfully checked preinstall on every node.
Creating the backup directory.
Successfully created the backup directory.
begin deploy..
Installing the cluster.
begin prepare Install Cluster..
Checking the installation environment on all nodes.
begin install Cluster..
Installing applications on all nodes.
Successfully installed APP.
begin init Instance..
encrypt cipher and rand files for database.
Please enter password for database:
Please repeat for database:
begin to create CA cert files
The sslcert will be generated in /data/huawei/install/app/share/sslcert/om
Cluster installation is completed.
Configuring.
Deleting instances from all nodes.
Successfully deleted instances from all nodes.
Checking node configuration on all nodes.
Initializing instances on all nodes.
[GAUSS-51400] : Failed to execute the command: source /home/omm/.bashrc;python3 '/data/huawei/install/om/script/local/InitInstance.py' -U omm  -P "--encoding=UTF8" -l /data/huawei/log/omm/omm/om/gs_local.log.Error:
Initializing instance.
[GAUSS-51615] : Failed to initialize instance. Command:/data/huawei/install/app/bin/gs_initdb --locale=C -D /data/huawei/install/data/dn --nodename=dn_6001 --encoding=UTF8 -C /data/huawei/install/app/bin. Error:
no data was returned by command ""/data/huawei/install/app/bin/gaussdb" -V"
The program "gaussdb" is needed by gs_initdb but was not found in the
same directory as "/data/huawei/install/app/bin/gs_initdb".
Check your installation.

手动执行第一部分出现第2部分报错内容

[omm@db1 bin]$ source /home/omm/.bashrc;python3 '/data/huawei/install/om/script/local/InitInstance.py' -U omm  -P "--encoding=UTF8" -l /data/huawei/log/omm/omm/om/gs_local.log
Initializing instance.
[GAUSS-51615] : Failed to initialize instance. Command:/data/huawei/install/app/bin/gs_initdb --locale=C -D /data/huawei/install/data/dn --nodename=dn_6001 --encoding=UTF8 -C /data/huawei/install/app/bin. Error:
no data was returned by command ""/data/huawei/install/app/bin/gaussdb" -V"
The program "gaussdb" is needed by gs_initdb but was not found in the
same directory as "/data/huawei/install/app/bin/gs_initdb".
Check your installation.

# 猜测是在第一个命令里面调用了第二个命令
"gaussdb" is needed by gs_initdb but was not found in the same directory  

# ls /data/huawei/install/app/bin/gaussdb  --> 文件存在
# ls /data/huawei/install/app/bin/gs_initdb --> 文件存在

[omm@db1 script]$ ls /data/huawei/install/app/bin/gaussdb
/data/huawei/install/app/bin/gaussdb
[omm@db1 script]$ ls /data/huawei/install/app/bin/gs_initdb
/data/huawei/install/app/bin/gs_initdb

手动执行第二个命令

[omm@db1 om]$ /data/huawei/install/app/bin/gs_initdb --locale=C -D /data/huawei/install/data/dn --nodename=dn_6001 --encoding=UTF8 -C /data/huawei/install/app/bin
no data was returned by command ""/data/huawei/install/app/bin/gaussdb" -V"
The program "gaussdb" is needed by gs_initdb but was not found in the
same directory as "/data/huawei/install/app/bin/gs_initdb".
Check your installation.

相关检查

1 /home/omm/.bashrc 目录存在

2 /data/huawei/install/app/bin/gs_initdb目录不存在,因为是存在了一个文件
[omm@db1 script]$ ll /data/huawei/install/app/bin/gs_initdb
-rwx------ 1 omm dbgrp 201K 2021-09-30 14:37 /data/huawei/install/app/bin/gs_initdb
[omm@db1 script]$ ll /data/huawei/install/app/bin/gaussdb
-rwx------ 1 omm dbgrp 105M 2021-09-30 14:37 /data/huawei/install/app/bin/gaussdb

# 如果/data/huawei/install/app/bin/gs_initdb是一个目录(mkdir 目录测试),则会报这个错
[GAUSS-51400] : Failed to execute the command: source /home/omm/.bashrc;python3 '/data/huawei/install/om/script/local/InitInstance.py' -U omm  -P "--encoding=UTF8" -l /data/huawei/log/omm/omm/om/gs_local.log.Error:
Initializing instance.
[GAUSS-51615] : Failed to initialize instance. Command:/data/huawei/install/app/bin/gs_initdb --locale=C -D /data/huawei/install/data/dn --nodename=dn_6001 --encoding=UTF8 -C /data/huawei/install/app/bin. Error:
/bin/sh: /data/huawei/install/app/bin/gs_initdb: Is a directory

3 python3存在且是3.6
[omm@db1 script]$ python3 --version
Python 3.6.13
[omm@db1 script]$ which python3
/usr/local/python3/bin/python3

4 InitInstance.py文件存在
[omm@db1 script]$ ll /data/huawei/install/om/script/local/InitInstance.py
-rwx------ 1 omm dbgrp 7.5K 2021-09-30 14:40 /data/huawei/install/om/script/local/InitInstance.py
我来答
添加附件
收藏
分享
问题补充
2条回答
默认
最新
刘洪

执行 “/data/huawei/install/app/bin/gaussdb” -V"命令时提示无效指令
Illegal instruction

可能是由于CPU不支持bmi2指令集,需要虚拟机支持
lscpu | grep bmi2 # Centos需要支持CPU指令集bmi2

暂无图片 评论
暂无图片 有用 0
加了盐海盗
2022-10-18
我这个命令可以正常显示版本,但是执行报错与文中一致

这个错误通常是因为系统没有正确设置PATH环境变量或者gaussdb可执行文件没有被正确安装到系统中。


在安装OpenGauss之前,请确保您的系统满足OpenGauss的最小硬件和软件要求,并按照OpenGauss官方文档中的指南进行安装。


如果您已经安装了OpenGauss但出现了这个错误,请尝试以下解决方案:


  1. 检查PATH环境变量

确保您的PATH环境变量包含了OpenGauss的安装目录。您可以在命令行中输入以下命令来查看PATH环境变量:

echo $PATH


如果您的PATH环境变量中不包含OpenGauss的安装目录,请将其添加到PATH环境变量中。例如,如果您的OpenGauss安装目录是/opt/opengauss/bin,您可以在命令行中执行以下命令来将其添加到PATH环境变量中:

export PATH=$PATH:/opt/opengauss/bin


  1. 检查gaussdb可执行文件是否存在

确保您的OpenGauss安装目录中包含gaussdb可执行文件。您可以在命令行中输入以下命令来查找gaussdb文件:

find / -name gaussdb


如果您无法找到gaussdb文件,说明它可能没有被正确安装到系统中。请重新安装OpenGauss并确保安装过程中没有出现任何错误。


如果您能够找到gaussdb文件,但它没有被正确识别,请尝试将其添加到PATH环境变量中,如上所述。


希望这些解决方案能够帮助您解决问题。

暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏