1.背景介绍:
随着Redhat和CentOS系列操作系统演进到8.x以上版本,X86架构服务器+CentOS/Redhat8.x操作系统下安装部署GBase 8a MPP Cluster产品成为一种趋势。
本文旨在描述上述软硬件环境下安装部署GBase 8a MPP Cluster需要特别关注的问题,以期解决在上述生产环境下部署GBase 8a集群出现的问题。
2.部署案例集环境:
服务器硬件:X86架构PC服务器
操作系统版本:CentOS/Redhat8.2
GBase 8a软件版本:GBase8a_MPP_Cluster-NoLicense-9.5.2.42-129983-redhat8-x86_64.tar.bz2
3.CentOS/Redhat8.2操作系统安装GBase 8a集群注意事项:
1)调整操作系统默认python版本:
CentOS/Redhat8.x操作系统默认使用python3版本作为操作系统默认的python版本,由于GBase 8a MPP Cluster安装部署脚本目前尚不支持python3,因此需要调整操作系统默认的python版本,否则安装脚本会在执行过程中报错。
具体方法参考如下:
检查操作系统是否安装了python2 rpm包:
rpm -aq | grep python2
如果没有安装python2版本的rpm执行dnf命令进行安装:
dnf install python2 -y
alternatives命令设置python2的软连接,并检查:
alternatives --install /usr/bin/python2 python2 /usr/bin/python2.7 1000000
alternatives --display python2
python2 - status is auto.
link currently points to /usr/bin/python2.7
/usr/bin/python2.7 - priority 1000000
Current `best' version is /usr/bin/python2.7.
执行alternatives指令查看python在操作系统中多版本信息:
alternatives --list
libnssckbi.so.x86_64 auto /usr/lib64/pkcs11/p11-kit-trust.so
ld auto /usr/bin/ld.bfd
java auto /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-4.el8.x86_64/jre/bin/java
jre_openjdk auto /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-4.el8.x86_64/jre
jre_1.8.0 auto /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-4.el8.x86_64/jre
jre_1.8.0_openjdk auto /usr/lib/jvm/jre-1.8.0-openjdk-1.8.0.242.b08-4.el8.x86_64
ifup auto /usr/libexec/nm-ifup
cifs-idmap-plugin auto /usr/lib64/cifs-utils/cifs_idmap_sss.so
python3 auto /usr/bin/python3.6
python2 auto /usr/bin/python2.7
python auto /usr/bin/python3.6
默认操作系统python指令对应python3.6版本
检查当前alternatives python设置:
alternatives --display python
python - status is manual.
link currently points to /usr/bin/python2
/usr/libexec/no-python - priority 404
slave unversioned-python: (null)
slave unversioned-python-man: /usr/share/man/man1/unversioned-python.1.gz
/usr/bin/python3 - priority 300
slave unversioned-python: /usr/bin/python3
slave unversioned-python-man: /usr/share/man/man1/python3.1.gz
/usr/bin/python2 - priority 200
slave unversioned-python: /usr/bin/python2
slave unversioned-python-man: /usr/share/man/man1/python2.1.gz
Current `best' version is /usr/libexec/no-python.
手工设置alternatives python默认链接:
alternatives --config python
有 3 个候选项可用于替换 python (提供 /usr/bin/python)。
选择 路径 优先级 状态
------------------------------------------------------------
* 0 /usr/bin/python3.6 3 自动模式
1 /usr/bin/python3.6 1 手动模式
2 /usr/bin/python2.7 3 手动模式
要维持当前值[*]请按<回车键>,或者键入选择的编号:
选择 python2对一个的那个值,例如2。将python的默认链接切换为手动模式并指向python2。
检查设置:
alternatives --list
libnssckbi.so.x86_64 auto /usr/lib64/pkcs11/p11-kit-trust.so
ld auto /usr/bin/ld.bfd
java auto /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-4.el8.x86_64/jre/bin/java
jre_openjdk auto /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-4.el8.x86_64/jre
jre_1.8.0 auto /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-4.el8.x86_64/jre
jre_1.8.0_openjdk auto /usr/lib/jvm/jre-1.8.0-openjdk-1.8.0.242.b08-4.el8.x86_64
ifup auto /usr/libexec/nm-ifup
cifs-idmap-plugin auto /usr/lib64/cifs-utils/cifs_idmap_sss.so
python3 auto /usr/bin/python3.6
python2 auto /usr/bin/python2.7
python manual /usr/bin/python2
完成设置后默认python命令已经指向python2,此时再执行GBase 安装脚本 gcinstall.py可保证不出现因操作系统python编译器版本造成的问题。
2)解决资源管理依赖cgconfig服务启动报错问题:
如果安装集群软件执行SetSysEnv.py环境设置脚本中设置了 --cgroup选项即配置8a资源管理功能并初始化cgroup配置(/etc/cgconfig.conf内写入gbase用户挂载配置信息)
需要提前安装cgconfig服务相关rpm包:
yum install -y libcgroup.x86_64
yum install -y libcgroup-tools.x86_64
此时启动cgconfig服务时会出现报错问题:
systemctl start cgconfig.service
会报错,类似如下:
systemctl status cgconfig.service
● cgconfig.service - Control Group configuration service
Loaded: loaded (/usr/lib/systemd/system/cgconfig.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2021-10-12 20:40:14 CST; 19min ago
Process: 115107 ExecStart=/usr/sbin/cgconfigparser -l /etc/cgconfig.conf -s 1664 (code=exited, status=101)
Main PID: 115107 (code=exited, status=101)
Oct 12 20:40:14 BMMPPSDN06 systemd[1]: Starting Control Group configuration service...
Oct 12 20:40:14 BMMPPSDN06 cgconfigparser[115107]: /usr/sbin/cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failed
Oct 12 20:40:14 BMMPPSDN06 cgconfigparser[115107]: Error: cannot mount cpu to /gbasecgroup/cgroup/cpu: Device or resource busy
Oct 12 20:40:14 BMMPPSDN06 systemd[1]: cgconfig.service: Main process exited, code=exited, status=101/n/a
Oct 12 20:40:14 BMMPPSDN06 systemd[1]: cgconfig.service: Failed with result 'exit-code'.
解决方法:
先手工mount cpu目录:
mount -t cgroup -o cpu,cpuacct cpu /cgroup/cpu
然后执行umount:
umount /cgroup/cpu
然后在重新执行启动服务指令:
systemctl start cgconfig.service
如果正常启动后可以查询在etc/cgconfig.conf文件中的挂载点是否正常挂载了:
lssubsys -m
正常挂载时显示如下:
cpu /cgroup/cpu
cpuacct /cgroup/cpuacct
blkio /cgroup/blkio
4.附录:
alternatives命令参考:
[root@localhost tools]# alternatives
alternatives version 1.3.36 - Copyright (C)
2001 Red Hat, Inc.
This may be freely redistributed under the
terms of the GNU Public License.
usage: alternatives --install <link>
<name> <path> <priority>
[--initscript <service>]
[--slave <link>
<name> <path>]*
alternatives --remove <name> <path>
alternatives --auto <name>
alternatives --config <name>
alternatives --display <name>
alternatives --set <name> <path>
common options: --verbose --test --help
--usage --version
--altdir <directory>
--admindir <directory>
说明:
alternatives --install <link>
<name> <path> <priority>
其中,
install表示安装
link是符号链接
name则是标识符
path是执行文件的路径
priority则表示优先级
以java的安装为例,我的Fedora 8下自带了两种java版本,分别如下:
Selection Command
-----------------------------------------------
*
1
/usr/lib/jvm/jre-1.7.0-icedtea/bin/java
2
/usr/lib/jvm/jre-1.5.0-gcj/bin/java
我在目录/tools/jdk安装了java version "1.4.2_19"
[root@localhost test]# alternatives
--install /usr/bin/java java /tools/jdk/bin/java 3
[root@localhost test]# alternatives
--config java
There are 3 programs which provide 'java'.
Selection Command
-----------------------------------------------
*+ 1
/usr/lib/jvm/jre-1.7.0-icedtea/bin/java
2
/usr/lib/jvm/jre-1.5.0-gcj/bin/java
3 /tools/jdk/bin/java
Enter to keep the current selection[+], or
type selection number: 3
我还在目录/tools/jdk6下安装了java version "1.6.0_12"
[root@localhost test]# alternatives
--install /usr/bin/java java /tools/jdk6/bin/java 4
[root@localhost test]# alternatives
--config java
There are 4 programs which provide 'java'.
Selection Command
-----------------------------------------------
*
1
/usr/lib/jvm/jre-1.7.0-icedtea/bin/java
2
/usr/lib/jvm/jre-1.5.0-gcj/bin/java
+
3 /tools/jdk/bin/java
4 /tools/jdk6/bin/java
Enter to keep the current selection[+], or
type selection number: 4
用alternatives --config java就可以选择你想要的Java版本。




