机器列表
| IP地址 | 用户名 | 密码 | ssh别名信息| | 主机名 | 操作系统内核 |
| 10.0.2.10 | root/omm | xxxxx | patroni3 | replicate1 | 5.10.0-153.12.0.92.oe2203sp2.x86_64 |
详情
[root@replicate1 script]# uname -r
5.10.0-153.12.0.92.oe2203sp2.x86_64
[root@replicate1 script]#
[root@replicate1 ~]# cat /etc/os-release
NAME="openEuler"
VERSION="22.03 (LTS-SP2)"
ID="openEuler"
VERSION_ID="22.03"
PRETTY_NAME="openEuler 22.03 (LTS-SP2)"
ANSI_COLOR="0;31"
[root@replicate1 ~]#
操作需要支持软件支持Python 3.7.X
- openEuler:支持Python 3.7.X
- CentOS:支持Python 3.6.X
- 麒麟:支持Python 3.7.X
- 说明 python需要通过--enable-shared方式编译
安装python3
yum install openssl-devel
yum install libaio-devel readline-devel expect
yum install -y libaio-devel flex bison ncurses-devel glibc-devel patch redhat-lsb-core
yum install libffi-devel
https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz
tar -zxvf Python-3.7.9.tgz
cd Python-3.7.9/
./configure --enable-shared --prefix=/usr/local/python3.7
make
make install
ln -s /usr/local/python3.7/bin/python3 /usr/bin/python3
ln -s /usr/local/python3.7bin/pip3 /usr/bin/pip3
加入环境变量
vim ~/.bashrc
export PATH=/usr/local/python3.7/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/python3.7/lib
export LD_LIBRARY_PATH=/soft/openGauss/script/gspylib/clib$LD_LIBRARY_PATH
测试
[root@replicate1 script]#/usr/bin/env python3
Python3.7.9(default,Aug22024,16:01:56)
[GCC 10.3.1] on linux
Type"help","copyright","credits"or"license"for more information.
>>>
建立用户并设置
groupadd dbgrp
useradd omm -g dbgrp
usermod -g dbgrp omm
passwd omm
omm
遇到问题
==_psutil_linux.so_3.7': No such file or directory==
[root@replicate1 script]# /usr/local/python3.7/bin/python3 ./gs_preinstall
Warnging version of python doesnot meet the expection, maybe third-party libs need to be compiled by yourself
Failed to execute cmd: rm -rf '/root/openGauss/script/gspylib/common/./../../../lib/psutil/_psutil_linux.so' && cp -r '/root/openGauss/script/gspylib/common/./../../../lib/psutil/_psutil_linux.so_3.7' '/root/openGauss/script/gspylib/common/./../../../lib/psutil/_psutil_linux.so' && rm -rf '/root/openGauss/script/gspylib/common/./../../../lib/psutil/_psutil_posix.so' && cp -r '/root/openGauss/script/gspylib/common/./../../../lib/psutil/_psutil_posix.so_3.7' '/root/openGauss/script/gspylib/common/./../../../lib/psutil/_psutil_posix.so' . Error:
cp: cannot stat '/root/openGauss/script/gspylib/common/./../../../lib/psutil/_psutil_linux.so_3.7': No such file or directory
[root@replicate1 script]#
根据路径是查看确实没有(没有细查)
[root@replicate1 psutil]# cd /root/openGauss/script/gspylib/common/./../../../lib/psutil
[root@replicate1 psutil]# pwd
/root/openGauss/lib/psutil
[root@replicate1 psutil]# ll
total 508
-rw-------.1 root root 26218Jan42024 _common.py
-rw-------.1 root root 14474Jan42024 _compat.py
-rw-------.1 root root 86749Jan42024 __init__.py
-rw-------.1 root root 18555Jan42024 _psaix.py
-rw-------.1 root root 31069Jan42024 _psbsd.py
-rw-------.1 root root 82101Jan42024 _pslinux.py
-rw-------.1 root root 17494Jan42024 _psosx.py
-rw-------.1 root root 8045Jan42024 _psposix.py
-rw-------.1 root root 25495Jan42024 _pssunos.py
-rw-------.1 root root 289Jan42024 _psutil_linux.py
-rwx------.1 root root 37648Jan42024 _psutil_linux.so_3.6
-rwx------.1 root root 37648Jan42024 _psutil_linux.so_3.7
-rw-------.1 root root 289Jan42024 _psutil_posix.py
-rwx------.1 root root 27152Jan42024 _psutil_posix.so_3.6
-rwx------.1 root root 27152Jan42024 _psutil_posix.so_3.7
-rw-------.1 root root 36841Jan42024 _pswindows.py
drwx------.2 root root 4096Jan42024 tests
[root@replicate1 psutil]#
[root@replicate1 psutil]# pwd
/root/openGauss/lib/psutil
[root@replicate1 psutil]#
[root@replicate1 psutil]# ls -al _psutil_linux.so_3.7
-rwx------.1 root root 37648Jan42024 _psutil_linux.so_3.7
[root@replicate1 psutil]# ldd _psutil_linux.so_3.7
linux-vdso.so.1(0x00007ffea8990000)
libpython3.7m.so.1.0=>/usr/local/python3.7/lib/libpython3.7m.so.1.0(0x00007f3f6364e000)
libpthread.so.0=>/usr/lib64/libpthread.so.0(0x00007f3f63641000)
libc.so.6=>/usr/lib64/libc.so.6(0x00007f3f63440000)
libcrypt.so.1=>/usr/lib64/libcrypt.so.1(0x00007f3f63400000)
libm.so.6=>/usr/lib64/libm.so.6(0x00007f3f63325000)
/lib64/ld-linux-x86-64.so.2(0x00007f3f63990000)
[root@replicate1 psutil]#
另辟蹊径解决
==若用户修改过系统python版本,则在安装数据库之前,还需手动安装下列python模块(pip安装即可)==
pip3 install psutil
pip3 install netifaces
pip3 install cffi
pip3 install pycparser
pip3 install cryptography
pip3 install pynacl
pip3 install bcrypt
pip3 install paramiko
预安装
[root@replicate1 script]#./gs_preinstall -U omm -G dbgrp -X /home/omm/dd.xml --unused-third-party
xxxx
"cipher": algorithms.TripleDES,
/usr/local/python3.7/lib/python3.7/site-packages/paramiko/transport.py:259:CryptographyDeprecationWarning:TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDESand will be removed fromthismodulein48.0.0.
"class": algorithms.TripleDES,
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
Successfullyset 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.
Successfullychecked OS version.
Creating cluster's path.
Successfully created cluster's path.
Setand check OS parameter.
Setting OS parameters.
Successfullyset OS parameters.
Warning:Installation environment contains some warning messages.
Pleaseget more details by"/home/omm/og2/script/gs_checkos -i A -h replicate1 --detail".
Setand check OS parameter completed.
Preparing CRON service.
Successfully prepared CRON service.
Setting user environmental variables.
Successfullyset user environmental variables.
Setting the dynamic link library.
Successfullyset the dynamic link library.
SettingCore file
Successfullyset core path.
Setting pssh path
Successfullyset pssh path.
SettingCgroup.
SuccessfullysetCgroup.
Set ARM Optimization.
No need to set ARM Optimization.
Fixing server package owner.
Setting finish flag.
安装
[omm@replicate1 ~]$ gs_install -X /home/omm/dd.xml
python3: error while loading shared libraries: libpython3.7m.so.1.0: cannot open shared object file:No such file or directory
[omm@replicate1 ~]$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/python3.7/lib
[omm@replicate1 ~]$ gs_install -X /home/omm/dd.xml
/usr/local/python3.7/lib/python3.7/site-packages/paramiko/pkey.py:100:CryptographyDeprecationWarning:TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDESand will be removed fromthismodulein48.0.0.
"cipher": algorithms.TripleDES,
/usr/local/python3.7/lib/python3.7/site-packages/paramiko/transport.py:259:CryptographyDeprecationWarning:TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDESand will be removed fromthismodulein48.0.0.
"class": algorithms.TripleDES,
Parsing the configuration file.
Check preinstall on every node.
Successfullychecked preinstall on every node.
Creating the backup directory.
Successfully created the backup directory.
begin deploy..
Installing the cluster.
begin prepare InstallCluster..
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/opt/huawei/install/app/share/sslcert/om
NO cm_server instance,no need to create CA for CM.
Non-dss_ssl_enable,no need to create CA for DSS
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.
Updating instance configuration on all nodes.
Check consistence of memCheck and coresCheck on database nodes.
Configuring pg_hba on all nodes.
Configurationis completed.
Successfully started cluster.
Successfully installed application.
end deploy..
启动
[omm@replicate1 ~]$ gs_om -t start
Starting cluster.
=========================================
[SUCCESS] replicate1:
[2024-08-0301:16:05.060][21376][][gs_ctl]: gs_ctl started,datadir is/opt/huawei/install/data/dn
[2024-08-0301:16:05.068][21376][][gs_ctl]: another server might be running;Pleaseuse the restart command
=========================================
Successfully started.
[omm@replicate1 ~]$ gs_om -t status --detail
"class": algorithms.TripleDES,
[ClusterState]
cluster_state :Normal
redistributing :No
current_az : AZ_ALL
[DatanodeState]
node node_ip port instance state
-------------------------------------------------------------------------------------------------
1 replicate1 10.0.2.10154006001/opt/huawei/install/data/dn P PrimaryNormal
[omm@replicate1 ~]$
连接
[omm@replicate1 ~]$ gsql -d posgres -p 15400
gsql: FATAL: database "posgres" does not exist
[omm@replicate1 ~]$ gsql -d postgres -p 15400
gsql ((openGauss 5.0.0 build a07d57c3) compiled at 2023-03-29 03:37:13 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
openGauss=#
配置文件
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<!-- openGauss整体信息 -->
<CLUSTER>
<!-- 数据库名称 -->
<PARAMname="clusterName"value="dbCluster"/>
<!-- 数据库节点名称(hostname) -->
<PARAMname="nodeNames"value="replicate1"/>
<!-- 数据库安装目录-->
<PARAMname="gaussdbAppPath"value="/gauss/huawei/install/app"/>
<!-- 日志目录-->
<PARAMname="gaussdbLogPath"value="/gauss/var/log/omm"/>
<!-- 临时文件目录-->
<PARAMname="tmpMppdbPath"value="/gauss/huawei/tmp"/>
<!-- 数据库工具目录-->
<PARAMname="gaussdbToolPath"value="/gauss/huawei/install/om"/>
<!-- 数据库core文件目录-->
<PARAMname="corePath"value="/gauss/huawei/corefile"/>
<!-- 节点IP,与数据库节点名称列表一一对应 -->
<PARAMname="backIp1s"value="10.0.2.10"/>
</CLUSTER>
<!-- 每台服务器上的节点部署信息 -->
<DEVICELIST>
<!-- 节点1上的部署信息 -->
<DEVICEsn="replicate1">
<!-- 节点1的主机名称 -->
<PARAMname="name"value="replicate1"/>
<!-- 节点1所在的AZ及AZ优先级 -->
<PARAMname="azName"value="AZ1"/>
<PARAMname="azPriority"value="1"/>
<!-- 节点1的IP,如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP -->
<PARAMname="backIp1"value="10.0.2.10"/>
<PARAMname="sshIp1"value="10.0.2.10"/>
<!--dbnode-->
<PARAMname="dataNum"value="1"/>
<PARAMname="dataPortBase"value="15400"/>
<PARAMname="dataNode1"value="/opt/huawei/install/data/dn"/>
<PARAMname="dataNode1_syncNum"value="0"/>
</DEVICE>
</DEVICELIST>
</ROOT>
报错
[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_4db7019a] in gs_install process with this user.
[root@iZ2zebtab4tvw9cw5060hmZ script]#
原因
因为路径已经存在,而且里面有东西
总结
之前安装过OpenGauss如果使用了企业版本的套件,而且使用了它自己的lib包安装的话,我记得是需要最低内存4GB,CPU也有要求(用过的朋友可以帮我确认一下),这次没有使用它的安装包居然不需要,看样子我的功能测试可以推进不少了
文章转载自SmallDB,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




