十三openGauss适配BCLinux欧拉版

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了十三openGauss适配BCLinux欧拉版相关的知识,希望对你有一定的参考价值。

一、简介

BCLinux for Euler是中国移动云基于openEuler社区版本的再发型版本
继承了欧拉社区自主可控、丰富的产业生态、全堆栈技术优化、鲲鹏CPU能力等优势

二、欧拉版本openGauss安装问题

1、bclinux版本
BigCloud Enterprise Linux For Euler 21.10 (GNU/Linux 4.19.90-2107.6.0.0100.oe1.bclinux.x86_64 x86_64)

2、使用欧拉版本openGauss初始化报错
./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/clusterconfig.xml
"Traceback (most recent call last):
File "./gs_preinstall", line 40, in <module>
from gspylib.common.Common import DefaultValue
File "/opt/software/openGauss/script/gspylib/common/Common.py", line 101, in <module>
from os_platform.UserPlatform import g_Platform
File "/opt/software/openGauss/script/os_platform/UserPlatform.py", line 67, in <module>
g_Platform = UserPlatform().userPlatform
File "/opt/software/openGauss/script/os_platform/UserPlatform.py", line 50, in __init__
SUPPORT_WHOLE_PLATFORM_LIST))
Exception: [GAUSS-51900] : The current OS is not supported.Supported platforms are: [suse, redhat, centos,
euleros, openeuler, kylin, fusionos, asianux, debian, ubuntu]."

3、操作系统检测
vi /opt/software/openGauss/script/os_platform/linux_distro.py
try:
etc_dir = os.listdir(/etc)
except os.error:
# Probably not a Unix system
return distname, version, idNum
etc_dir.sort()
gFile = None
_release_filename = re.compile(r(\\w+)[-_](release|version))
for file in etc_dir:
if os.path.islink(/etc/ + file):
continue
m = _release_filename.match(file)
if m is not None:
_distname, dummy = m.groups()
if _distname in supported_dists:
gFile = file
distname = _distname
break
大概流程是查找/etc下带release或者version关键字结尾的文件,
for循环去除掉软链接文件
获取文件名(比如openEuler-release)中前半部分然后和supported_dists中的适配

4、查找supported_dists
vi /opt/software/openGauss/script/os_platform/common.py
_supported_dists = (
SuSE, debian, fedora, redhat, centos, euleros, "openEuler",
mandrake, mandriva, rocks, slackware, yellowdog, gentoo,
"FusionOS", UnitedLinux, turbolinux, ubuntu, kylin, asianux)

5、查看服务器
[root@gsdb1 opt]# ll /etc/|grep -E release$|version$
-rw-r--r--. 1 root root 60 Dec 2 2021 bclinux-release
lrwxrwxrwx. 1 root root 15 Dec 2 2021 openEuler-release -> bclinux-release
-rw-r--r--. 1 root root 170 Dec 2 2021 os-release
lrwxrwxrwx. 1 root root 15 Dec 2 2021 redhat-release -> bclinux-release
lrwxrwxrwx. 1 root root 15 Dec 2 2021 system-release -> bclinux-release
排除掉软链接文件
bclinux-release、os-release
可以看到bclinux、os无法在_supported_dists中找到

6、解决办法
rm -f /etc/openEuler-release #将软链接删掉
cp /etc/bclinux-release /etc/openEuler-release #直接拷贝一份

7、重新初始化不再报错
./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/clusterconfig.xml

以上是关于十三openGauss适配BCLinux欧拉版的主要内容,如果未能解决你的问题,请参考以下文章

开源数据库 | 记一次基于鲲鹏欧拉操作系统openGauss实践过程

开源数据库 | 记一次基于鲲鹏欧拉操作系统openGauss实践过程

开源数据库 | 记一次基于鲲鹏欧拉操作系统openGauss实践过程

openEuler-22.03系统安装openGauss3.0.0 企业版过程中遇到的坑

openEuler-22.03系统安装openGauss3.0.0 企业版过程中遇到的坑

参赛作品44开源数据库 | 记一次基于鲲鹏欧拉操作系统openGauss实践过程