【MogDB】在刚发布的银河麒麟V11上安装MogDB
背景
最近各种官媒开始宣传银河麒麟V11,我注意到材料里面有提到其linux内核已经升到了6.6,不再是V10里的4.x。在眼下AI飞速发展的时代,4.x内核里很多依赖库都已经过时,很多AI相关的工具和软件都无法安装或安装很麻烦,对于高新科技行业,升级到6.x是必须要走的一步。之前只能用国外的linux发行版,现在除了 openEuler 24.03 这个开源版本,又多了银河麒麟V11这个商业版本的选择,这无疑具有重大意义。
本文简单尝试一下在一个刚出的操作系统上,是否可以运行MogDB 5.0.12
先看看麒麟V11长什么样
银河麒麟V11官网介绍页面
https://www.kylinos.cn/productPc/server/serverMainV11/
银河麒麟镜像下载地址
https://www.kylinos.cn/support/trial/download/
登录画面
桌面
开始菜单
开始菜单2
锁屏画面
默认带桌面安装,内存占用有点大,我装的时候先设置的4G,free直接就是0了,然后才扩到了6G
[root@kylinv11 ~]# free -g
total used free shared buff/cache available
Mem: 5 0 3 0 0 4
Swap: 3 0 3
操作系统版本信息,Linux 内核 6.6,Kylin代号Swan25
[root@kylinv11 ~]# cat /etc/os-release
NAME="Kylin Linux Advanced Server"
VERSION="V11 (Swan25)"
ID="kylin"
VERSION_ID="V11"
PRETTY_NAME="Kylin Linux Advanced Server V11 (Swan25)"
ANSI_COLOR="0;31"
[root@kylinv11 ~]# uname -a
Linux kylinv11 6.6.0-32.7.v2505.ky11.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 4 13:31:43 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
[root@kylinv11 ~]# nkvers
############## Kylin Linux Version #################
Release:
Kylin Linux Advanced Server release V11 (Swan25)
Kernel:
6.6.0-32.7.v2505.ky11.x86_64
Build:
Kylin Linux Advanced Server
release V11 2503/(Swan25)-x86_64-Build20/20250715
#################################################
[root@kylinv11 ~]#
python版本为 3.11
[root@kylinv11 ~]# python3
Python 3.11.6 (main, Mar 22 2025, 04:40:18) [GCC 12.3.1 (kylin 12.3.1-62.p01.ky11)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
gcc 版本12,GLIBCXX最高支持版本3.4.30
[root@kylinv11 ~]# gcc -v
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-kylin-linux/12/lto-wrapper
目标:x86_64-kylin-linux
配置为:../configure --disable-bootstrap --disable-libgcj --without-cloog --enable-languages=c,c++,fortran,objc,obj-c++,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitee.com/src-openeuler/gcc/issues --enable-shared --enable-threads=posix --enable-checking=release --disable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --without-isl --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_64=x86-64-v2 --build=x86_64-kylin-linux
线程模型:posix
Supported LTO compression algorithms: zlib
gcc 版本 12.3.1 (kylin 12.3.1-62.p02.ky11) (GCC)
[root@kylinv11 ~]# strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28
GLIBCXX_3.4.29
GLIBCXX_3.4.30
GLIBCXX_DEBUG_MESSAGE_LENGTH
[root@kylinv11 ~]#
安装MogDB
在线下载PTK
[root@kylinv11 ~]# curl --proto '=https' --tlsv1.2 -sSf https://cdn-mogdb.enmotech.com/ptk/install.sh | sh
Downloading ptk package...
Detected shell: bash
Shell profile: /root/.bash_profile
ptk has been added to PATH in /root/.bash_profile
open a new terminal or source /root/.bash_profile to active it
Installed path: /root/.ptk/bin/ptk
[root@kylinv11 ~]# source /root/.bash_profile
[root@kylinv11 ~]# ptk ls
cluster_name | id | addr | user | data_dir | db_version | create_time | comment
---------------+----+------+------+----------+------------+-------------+----------
[root@kylinv11 ~]# ptk -v
PTK Version: 1.7.5 release
Go Version: go1.19.10
Build Date: 2024-11-11T14:15:18
Git Hash: fc269d2a
OS/Arch: linux/amd64
生成本地单机配置文件
[root@kylinv11 ~]# ptk template --local > config.yaml
检查环境
[root@kylinv11 ~]# ptk checkos -f config.yaml
INFO[2025-08-27T13:11:47.609] 预检查依赖工具...
INFO[2025-08-27T13:11:47.637] [192.168.163.135][omm] 内核版本: 6.6.0-32.7.v2505.ky11.x86_64
ERRO[2025-08-27T13:11:47.640] [192.168.163.135][omm] kernel.sem=32000 1024000000 500 32000, expect 250 6400000 1000 25600
WARN[2025-08-27T13:11:47.642] [192.168.163.135][omm] net.ipv4.tcp_max_syn_backlog=512, expect 65535
WARN[2025-08-27T13:11:47.648] [192.168.163.135][omm] net.ipv4.tcp_retries1=3, expect 5
WARN[2025-08-27T13:11:47.650] [192.168.163.135][omm] net.ipv4.tcp_retries2=15, expect 12
WARN[2025-08-27T13:11:47.653] [192.168.163.135][omm] net.ipv4.tcp_rmem=4096 131072 6291456, expect 8192 250000 16777216
WARN[2025-08-27T13:11:47.656] [192.168.163.135][omm] net.ipv4.tcp_wmem=4096 16384 4194304, expect 8192 250000 16777216
WARN[2025-08-27T13:11:47.658] [192.168.163.135][omm] net.ipv4.tcp_tw_reuse=2, expect 1
WARN[2025-08-27T13:11:47.661] [192.168.163.135][omm] net.ipv4.tcp_keepalive_time=7200, expect 30
ERRO[2025-08-27T13:11:47.664] [192.168.163.135][omm] net.core.wmem_max=229376, expect 1048576
ERRO[2025-08-27T13:11:47.666] [192.168.163.135][omm] net.core.rmem_default=229376, expect 262144
ERRO[2025-08-27T13:11:47.678] [192.168.163.135][omm] net.core.rmem_max=229376, expect 1048576
WARN[2025-08-27T13:11:47.684] [192.168.163.135][omm] net.ipv4.tcp_syn_retries=6, expect 5
WARN[2025-08-27T13:11:47.687] [192.168.163.135][omm] net.core.somaxconn=4096, expect 65535
WARN[2025-08-27T13:11:47.700] [192.168.163.135][omm] net.ipv4.tcp_keepalive_intvl=75, expect 30
WARN[2025-08-27T13:11:47.703] [192.168.163.135][omm] net.core.netdev_max_backlog=1000, expect 65535
WARN[2025-08-27T13:11:47.710] [192.168.163.135][omm] vm.min_free_kbytes=67584, expect 276841
ERRO[2025-08-27T13:11:47.715] [192.168.163.135][omm] net.core.wmem_default=229376, expect 262144
INFO[2025-08-27T13:11:47.718] [192.168.163.135][omm] 检查 kernel.core_pattern
INFO[2025-08-27T13:11:47.723] [192.168.163.135][omm] 检查 RemoveIPC 的值
INFO[2025-08-27T13:11:47.732] [192.168.163.135][omm] 检查 KillUserProcesses 的值
ERRO[2025-08-27T13:11:52.260] [192.168.163.135][omm] firewall status='enabled', expect 'disabled'.
ERRO[2025-08-27T13:11:52.262] [192.168.163.135][omm] transparent_hugepage status is 'always', expect 'never'
INFO[2025-08-27T13:11:52.263] [192.168.163.135][omm] 检查端口 26000
INFO[2025-08-27T13:11:52.269] [192.168.163.135][omm] 端口 26000 空闲
INFO[2025-08-27T13:11:52.273] [192.168.163.135][omm] 时区: +0800
WARN[2025-08-27T13:11:52.279] [192.168.163.135][omm] device(/dev/sda) readahead value=8192, expect 16384.
INFO[2025-08-27T13:11:52.302] [192.168.163.135][omm] platform: kylin_V11_64bit
INFO[2025-08-27T13:11:52.308] [192.168.163.135][omm] 交换内存 4136956kB,总内存 5536828kB
INFO[2025-08-27T13:11:52.335] 完成所有检查项
INFO[2025-08-27T13:11:52.335] 将修复 OS 脚本写入 root_fix_os.0827.131152.sh 成功
INFO[2025-08-27T13:11:52.335] 用时: 4s
# Check Results
Item | Level
------------------------------------+-----------
A1.Check_OS_Version | OK
A2.Check_Kernel_Version | OK
A3.Check_Unicode | OK
A4.Check_TimeZone | OK
A5.Check_Swap_Memory_Configure | OK
A6.Check_SysCtl_Parameter | Abnormal
A7.Check_FileSystem_Configure | OK
A8.Check_Disk_Configure | OK
A9.Check_BlockDev_Configure | Warning
A9.Check_Logical_Block | OK
A10.Check_NR_Request | OK
A10.Check_Asynchronous_IO_Request | OK
A10.Check_IO_Configure | OK
A11.Check_Network_Configure | OK
A12.Check_Time_Consistency | OK
A13.Check_Firewall_Status | Abnormal
A14.Check_THP_Status | Abnormal
A15.Check_Dependent_Package | Warning
A16.Check_CPU_Instruction_Set | OK
A17.Check_Port | OK
A18.Check_Selinux | OK
A19.Check_User_Ulimit | OK
A20.Check_Directory | OK
Total count 23, abnormal count 3, warning count 2
Failed to check os, can’t perform installation unless fix all the abnormal items.
You can use 'ptk checkos -i ITEM --detail' to get detail message
Please check root_fix_os.0827.131152.sh for commands to resolve.
[root@kylinv11 ~]#
修复环境
[root@kylinv11 ~]# ./root_fix_os.0827.131152.sh
++ ip addr
++ grep inet
++ grep -v 'inet6\|127.0.0.1\|grep'
++ awk -F / '{print $1}'
++ awk '{print $2}'
+ local_ips=192.168.163.135
+ for ip in ${local_ips}
+ [[ 192.168.163.135 == \1\9\2\.\1\6\8\.\1\6\3\.\1\3\5 ]]
+ sed -i /kernel.sem/d /etc/sysctl.conf
+ echo kernel.sem = 250 6400000 1000 25600
+ sed -i /net.core.wmem_max/d /etc/sysctl.conf
+ echo net.core.wmem_max = 1048576
+ sed -i /net.core.rmem_default/d /etc/sysctl.conf
+ echo net.core.rmem_default = 262144
+ sed -i /net.core.rmem_max/d /etc/sysctl.conf
+ echo net.core.rmem_max = 1048576
+ sed -i /net.core.wmem_default/d /etc/sysctl.conf
+ echo net.core.wmem_default = 262144
+ sysctl -p
kernel.sysrq = 0
net.ipv4.ip_forward = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.default.secure_redirects = 0
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.tcp_syncookies = 1
kernel.dmesg_restrict = 1
net.ipv6.conf.all.accept_redirects = 0
net.ipv6.conf.default.accept_redirects = 0
kernel.sem = 250 6400000 1000 25600
net.core.wmem_max = 1048576
net.core.rmem_default = 262144
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
+ systemctl disable firewalld
Removed "/etc/systemd/system/multi-user.target.wants/firewalld.service".
Removed "/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service".
+ systemctl stop firewalld
+ '[' -f /sys/kernel/mm/redhat_transparent_hugepage/enabled ']'
+ '[' -f /sys/kernel/mm/transparent_hugepage/enabled ']'
+ echo never
+ sudo tee /sys/kernel/mm/transparent_hugepage/enabled
+ cat
+ sudo systemctl daemon-reload
+ sudo systemctl start disable-transparent-huge-pages
+ sudo systemctl enable disable-transparent-huge-pages
Created symlink /etc/systemd/system/basic.target.wants/disable-transparent-huge-pages.service → /etc/systemd/system/disable-transparent-huge-pages.service.
+ echo 'WARNING: You should reboot host to disable transparent huge pages(THP) permanently!'
WARNING: You should reboot host to disable transparent huge pages(THP) permanently!
[root@kylinv11 ~]#
再次检查环境
[root@kylinv11 ~]# ptk checkos -f config.yaml
INFO[2025-08-27T13:12:02.208] 预检查依赖工具...
INFO[2025-08-27T13:12:02.232] [192.168.163.135][omm] platform: kylin_V11_64bit
INFO[2025-08-27T13:12:02.236] [192.168.163.135][omm] 时区: +0800
WARN[2025-08-27T13:12:02.239] [192.168.163.135][omm] net.ipv4.tcp_syn_retries=6, expect 5
WARN[2025-08-27T13:12:02.242] [192.168.163.135][omm] net.core.somaxconn=4096, expect 65535
WARN[2025-08-27T13:12:02.247] [192.168.163.135][omm] net.ipv4.tcp_retries2=15, expect 12
WARN[2025-08-27T13:12:02.255] [192.168.163.135][omm] net.ipv4.tcp_keepalive_time=7200, expect 30
WARN[2025-08-27T13:12:02.260] [192.168.163.135][omm] net.core.netdev_max_backlog=1000, expect 65535
WARN[2025-08-27T13:12:02.263] [192.168.163.135][omm] net.ipv4.tcp_max_syn_backlog=512, expect 65535
WARN[2025-08-27T13:12:02.276] [192.168.163.135][omm] vm.min_free_kbytes=9394, expect 276841
WARN[2025-08-27T13:12:02.288] [192.168.163.135][omm] net.ipv4.tcp_tw_reuse=2, expect 1
WARN[2025-08-27T13:12:02.291] [192.168.163.135][omm] net.ipv4.tcp_rmem=4096 131072 6291456, expect 8192 250000 16777216
WARN[2025-08-27T13:12:02.294] [192.168.163.135][omm] net.ipv4.tcp_wmem=4096 16384 4194304, expect 8192 250000 16777216
WARN[2025-08-27T13:12:02.296] [192.168.163.135][omm] net.ipv4.tcp_keepalive_intvl=75, expect 30
WARN[2025-08-27T13:12:02.299] [192.168.163.135][omm] net.ipv4.tcp_retries1=3, expect 5
INFO[2025-08-27T13:12:02.317] [192.168.163.135][omm] 检查 kernel.core_pattern
INFO[2025-08-27T13:12:02.322] [192.168.163.135][omm] 检查 RemoveIPC 的值
INFO[2025-08-27T13:12:02.330] [192.168.163.135][omm] 检查 KillUserProcesses 的值
WARN[2025-08-27T13:12:02.345] [192.168.163.135][omm] device(/dev/sda) readahead value=8192, expect 16384.
INFO[2025-08-27T13:12:06.869] [192.168.163.135][omm] 检查端口 26000
INFO[2025-08-27T13:12:06.875] [192.168.163.135][omm] 端口 26000 空闲
INFO[2025-08-27T13:12:06.888] [192.168.163.135][omm] 内核版本: 6.6.0-32.7.v2505.ky11.x86_64
INFO[2025-08-27T13:12:06.891] [192.168.163.135][omm] 交换内存 4136956kB,总内存 5536828kB
INFO[2025-08-27T13:12:06.905] 完成所有检查项
INFO[2025-08-27T13:12:06.905] 用时: 5s
# Check Results
Item | Level
------------------------------------+----------
A1.Check_OS_Version | OK
A2.Check_Kernel_Version | OK
A3.Check_Unicode | OK
A4.Check_TimeZone | OK
A5.Check_Swap_Memory_Configure | OK
A6.Check_SysCtl_Parameter | Warning
A7.Check_FileSystem_Configure | OK
A8.Check_Disk_Configure | OK
A9.Check_BlockDev_Configure | Warning
A9.Check_Logical_Block | OK
A10.Check_Asynchronous_IO_Request | OK
A10.Check_IO_Configure | OK
A10.Check_NR_Request | OK
A11.Check_Network_Configure | OK
A12.Check_Time_Consistency | OK
A13.Check_Firewall_Status | OK
A14.Check_THP_Status | OK
A15.Check_Dependent_Package | Warning
A16.Check_CPU_Instruction_Set | OK
A17.Check_Port | OK
A18.Check_Selinux | OK
A19.Check_User_Ulimit | OK
A20.Check_Directory | OK
Total count 23, abnormal count 0, warning count 3
[root@kylinv11 ~]#
使用在线包安装数据库
[root@kylinv11 ~]# ptk install -f config.yaml -p https://cdn-mogdb.enmotech.com/mogdb-media/5.0.12/Kylin_x86_64/MogDB-5.0.12-Kylin-x86_64-all.tar.gz
INFO[2025-08-27T13:12:10.256] PTK 版本: 1.7.5 release
INFO[2025-08-27T13:12:10.256] 从 config.yaml 加载配置
如果您选择继续安装软件,
就代表您接受该软件的许可协议。
[Y]: 接受并继续
[C]: 显示许可协议内容
[N]: 中止安装并退出
✔ 请输入 (默认: Y): y
集群名:"payne"
+--------------+-----------------+-------------+-------+---------+-----------------+----------+
| az(priority) | ip | user(group) | port | role | data dir | upstream |
+--------------+-----------------+-------------+-------+---------+-----------------+----------+
| AZ1(1) | 192.168.163.135 | omm(omm) | 26000 | primary | /opt/mogdb/data | - |
+--------------+-----------------+-------------+-------+---------+-----------------+----------+
✔ 集群配置是否正确 (默认 n) [y/n]: y
INFO[2025-08-27T13:12:12.251] 检查主机名 ...
INFO[2025-08-27T13:12:12.255] 主机名检查成功
INFO[2025-08-27T13:12:12.255] 检查操作系统 ...
INFO[2025-08-27T13:12:12.255] 预检查依赖工具...
INFO[2025-08-27T13:12:12.291] [192.168.163.135][omm] platform: kylin_V11_64bit
INFO[2025-08-27T13:12:16.785] [192.168.163.135][omm] 时区: +0800
WARN[2025-08-27T13:12:16.789] [192.168.163.135][omm] net.core.netdev_max_backlog=1000, expect 65535
WARN[2025-08-27T13:12:16.796] [192.168.163.135][omm] net.ipv4.tcp_retries1=3, expect 5
WARN[2025-08-27T13:12:16.802] [192.168.163.135][omm] net.ipv4.tcp_retries2=15, expect 12
WARN[2025-08-27T13:12:16.805] [192.168.163.135][omm] net.ipv4.tcp_wmem=4096 16384 4194304, expect 8192 250000 16777216
WARN[2025-08-27T13:12:16.810] [192.168.163.135][omm] net.ipv4.tcp_syn_retries=6, expect 5
WARN[2025-08-27T13:12:16.822] [192.168.163.135][omm] vm.min_free_kbytes=9394, expect 276841
WARN[2025-08-27T13:12:16.828] [192.168.163.135][omm] net.ipv4.tcp_keepalive_time=7200, expect 30
WARN[2025-08-27T13:12:16.839] [192.168.163.135][omm] net.ipv4.tcp_tw_reuse=2, expect 1
WARN[2025-08-27T13:12:16.849] [192.168.163.135][omm] net.core.somaxconn=4096, expect 65535
WARN[2025-08-27T13:12:16.852] [192.168.163.135][omm] net.ipv4.tcp_keepalive_intvl=75, expect 30
WARN[2025-08-27T13:12:16.854] [192.168.163.135][omm] net.ipv4.tcp_rmem=4096 131072 6291456, expect 8192 250000 16777216
WARN[2025-08-27T13:12:16.867] [192.168.163.135][omm] net.ipv4.tcp_max_syn_backlog=512, expect 65535
INFO[2025-08-27T13:12:16.867] [192.168.163.135][omm] 检查 kernel.core_pattern
INFO[2025-08-27T13:12:16.872] [192.168.163.135][omm] 检查 RemoveIPC 的值
INFO[2025-08-27T13:12:16.879] [192.168.163.135][omm] 检查 KillUserProcesses 的值
WARN[2025-08-27T13:12:16.894] [192.168.163.135][omm] device(/dev/sda) readahead value=8192, expect 16384.
INFO[2025-08-27T13:12:16.900] [192.168.163.135][omm] 检查端口 26000
INFO[2025-08-27T13:12:16.906] [192.168.163.135][omm] 端口 26000 空闲
INFO[2025-08-27T13:12:16.915] [192.168.163.135][omm] 交换内存 4136956kB,总内存 5536828kB
INFO[2025-08-27T13:12:16.966] [192.168.163.135][omm] 内核版本: 6.6.0-32.7.v2505.ky11.x86_64
INFO[2025-08-27T13:12:16.972] 完成所有检查项
INFO[2025-08-27T13:12:16.972] 用时: 5s
INFO[2025-08-27T13:12:16.972] 操作系统检查成功
INFO[2025-08-27T13:12:16.973] 检查系统发行版 ...
INFO[2025-08-27T13:12:16.973] 发行版检查成功
INFO[2025-08-27T13:12:16.973] 检查用户 ...
INFO[2025-08-27T13:12:16.976] 检查用户成功
INFO[2025-08-27T13:12:16.976] 检查端口 ...
INFO[2025-08-27T13:12:16.976] checking port 26000 on host 192.168.163.135 (db listen port) ...
INFO[2025-08-27T13:12:16.983] checking port 26001 on host 192.168.163.135 (db HA port) ...
INFO[2025-08-27T13:12:16.989] 端口检查成功
INFO[2025-08-27T13:12:16.992] [192.168.163.135][omm] 创建操作系统用户omm, 组omm
INFO[2025-08-27T13:12:17.109] [192.168.163.135][omm] set ulimit configs
INFO[2025-08-27T13:12:17.112] 准备安装包 ...
INFO[2025-08-27T13:12:17.112] 正在下载 MogDB-5.0.12-Kylin-x86_64-all.tar.gz...
INFO[2025-08-27T13:12:22.466] 下载成功
INFO[2025-08-27T13:12:22.466] 安装包已经就绪
INFO[2025-08-27T13:12:22.466] 解析安装包...
INFO[2025-08-27T13:12:28.139] 数据库产品: MogDB, 版本: 5.0.12, number: 92.941, commit_id: 55a1eed3
INFO[2025-08-27T13:12:28.508] 将 MogDB-5.0.12-Kylin-64bit.tar.gz 提取到目录/tmp/ptk_tmp_3585163411
INFO[2025-08-27T13:12:30.512] execute command: mogdb --version
INFO[2025-08-27T13:12:30.611] 安装包解析成功
INFO[2025-08-27T13:12:30.611] 开始完善配置 ...
✔ 请输入数据库密码 (8~15 个字符, 3 种类型): ********
✔ 再次输入数据库密码: ********
INFO[2025-08-27T13:12:39.141] 完善配置成功
INFO[2025-08-27T13:12:39.141] save the topology to metadata
INFO[2025-08-27T13:12:39.142] 开始分发安装包...
INFO[2025-08-27T13:12:39.201] 安装包分发成功
INFO[2025-08-27T13:12:39.201] 开始安装逻辑节点 ...
INFO[2025-08-27T13:12:39.201] 部署数据库到 omm@192.168.163.135
INFO[2025-08-27T13:12:39.201] [192.168.163.135][omm] 创建用户omm的目录:/opt/mogdb
INFO[2025-08-27T13:12:39.304] [192.168.163.135][omm] 清除用户 omm 的 IPC 资源
INFO[2025-08-27T13:12:39.623] [192.168.163.135][omm] 创建用户omm的目录:/opt/mogdb/tool,/opt/mogdb/tool/ptk_tool/bin
INFO[2025-08-27T13:12:44.810] [192.168.163.135][omm] 将 MogDB-5.0.12-Kylin-x86_64-all.tar.gz 提取到目录/opt/mogdb/tool
INFO[2025-08-27T13:12:45.755] [192.168.163.135][omm] 将 MogDB-5.0.12-Kylin-64bit-om.tar.gz 提取到目录/opt/mogdb/tool
INFO[2025-08-27T13:12:46.177] [192.168.163.135][omm] 尝试修复psutil Python库
WARN[2025-08-27T13:12:46.452] [192.168.163.135][omm] 没有找到 python3.6 or 3.7,跳过修复 psutil 动态库,
请安装合适的 python 并手动修复或通过 ptk 重新安装
如果不解决这个问题,它可能会导致 gs_om 和 cm_ctl 不能正常工作,但不影响 ptk 和数据库
INFO[2025-08-27T13:12:46.452] [192.168.163.135][omm] 写入文件 /opt/mogdb/tool/script/py_pstree.py
INFO[2025-08-27T13:12:46.596] [192.168.163.135][omm] 写入文件 /opt/mogdb/tool/ptk_tool/bin/README.md
INFO[2025-08-27T13:12:46.831] [192.168.163.135][omm] 写入文件 /opt/mogdb/tool/ptk_tool/bin/pscp
INFO[2025-08-27T13:12:47.066] [192.168.163.135][omm] 写入文件 /opt/mogdb/tool/ptk_tool/bin/pssh
INFO[2025-08-27T13:12:47.301] [192.168.163.135][omm] 写入文件 /opt/mogdb/tool/ptk_tool/bin/task_pool.py
INFO[2025-08-27T13:12:47.543] [192.168.163.135][omm] 创建用户omm的目录:/opt/mogdb/app
INFO[2025-08-27T13:12:47.830] [192.168.163.135][omm] 将 MogDB-5.0.12-Kylin-64bit.tar.gz 提取到目录/opt/mogdb/app
INFO[2025-08-27T13:12:49.970] [192.168.163.135][omm] 将 /opt/mogdb/app 的权限更改为 700
INFO[2025-08-27T13:12:50.085] [192.168.163.135][omm] 创建用户omm的目录:/opt/mogdb/app/share/postgresql
INFO[2025-08-27T13:12:50.586] [192.168.163.135][omm] 将 /opt/mogdb/tool/script/gspylib/etc/sql/pmk_schema.sql 复制到 /opt/mogdb/app/share/postgresql
INFO[2025-08-27T13:12:50.686] [192.168.163.135][omm] 将 /opt/mogdb/tool/script/gspylib/etc/sql/pmk_schema_single_inst.sql 复制到 /opt/mogdb/app/share/postgresql
INFO[2025-08-27T13:12:50.786] [192.168.163.135][omm] 写入文件 /opt/mogdb/app/bin/transfer.py
INFO[2025-08-27T13:12:50.935] [192.168.163.135][omm] 设置用户omm的配置文件
INFO[2025-08-27T13:12:51.666] [192.168.163.135][omm] 验证并尝试修复 gs_initdb 的 ld 库
INFO[2025-08-27T13:12:51.768] [192.168.163.135][omm] 验证并尝试修复 mogdb 的 ld 库
INFO[2025-08-27T13:12:51.872] [192.168.163.135][omm] 创建用户omm的目录:/opt/mogdb/log/gs_profile,/opt/mogdb/log/pg_log,/opt/mogdb/log/pg_audit,/opt/mogdb/log/bin,/opt/mogdb/log/pg_log/dn_6001,/opt/mogdb/log/pg_audit/dn_6001
INFO[2025-08-27T13:12:54.439] [192.168.163.135][omm] 创建用户omm的目录:/opt/mogdb/tmp
INFO[2025-08-27T13:12:54.735] [192.168.163.135][omm] 将版本保存为 upgrade_version
INFO[2025-08-27T13:12:55.190] [192.168.163.135][omm] 创建文件 cluster_manual_start
INFO[2025-08-27T13:12:55.292] [192.168.163.135][omm] 生成 cluster_static_config 文件
INFO[2025-08-27T13:12:55.445] [192.168.163.135][omm] 创建用户omm的目录:/opt/mogdb/data
INFO[2025-08-27T13:12:55.756] [192.168.163.135][omm] 写入文件 /opt/mogdb/tool/.ptk_deployer
INFO[2025-08-27T13:12:55.915] 生成认证文件
INFO[2025-08-27T13:12:56.918] 下载认证文件
INFO[2025-08-27T13:12:57.929] 认证文件安装成功
INFO[2025-08-27T13:12:57.929] 在 omm@192.168.163.135 上初始化数据库
WARN[2025-08-27T13:12:58.029] [192.168.163.135][omm] 未找到版本 5.0.12 的推荐配置, 默认使用版本 5.0.9 的推荐配置
INFO[2025-08-27T13:12:58.029] [192.168.163.135][omm] 数据库正在初始化, 请稍等一会儿
INFO[2025-08-27T13:13:19.341] [192.168.163.135][omm] 配置 postgresql.conf 文件
INFO[2025-08-27T13:13:19.483] [192.168.163.135][omm] 配置 pg_hba.conf 文件
INFO[2025-08-27T13:13:19.594] [192.168.163.135][omm] 将 SSL 文件复制到数据目录
INFO[2025-08-27T13:13:19.698] 逻辑节点安装成功
INFO[2025-08-27T13:13:19.698] 生成 PTKC ...
INFO[2025-08-27T13:13:19.897] 开始构建 SSH 互信 ...
INFO[2025-08-27T13:13:20.672] SSH 互信构建成功
INFO[2025-08-27T13:13:20.672] 启动数据库 ...
INFO[2025-08-27T13:13:20.672] [192.168.163.135][omm] 使用 gs_ctl 启动数据库中 ...
INFO[2025-08-27T13:13:20.672] [192.168.163.135][omm] 数据库正在启动,请稍等一会儿
INFO[2025-08-27T13:13:22.022] [192.168.163.135][omm] 数据库启动成功
INFO[2025-08-27T13:13:22.022] 数据库启动成功
INFO[2025-08-27T13:13:22.022] 正在清理临时目录 ...
INFO[2025-08-27T13:13:22.037] 临时目录清理成功
INFO[2025-08-27T13:13:22.038] 用时: 1m10s
cluste_name | host | user | port | status | message
--------------+-----------------+------+-------+---------------+----------
payne | 192.168.163.135 | omm | 26000 | start_success | success
[root@kylinv11 ~]#
连接测试
[root@kylinv11 ~]# su - omm
[omm@kylinv11 ~]$ gsql -r
gsql ((MogDB 5.0.12 build 55a1eed3) compiled at 2025-07-11 02:22:45 commit 0 last mr 1804 )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
MogDB=# \q
[omm@kylinv11 ~]$ exit
[root@kylinv11 ~]#
解除om的python版本依赖
不做这步,数据库已经是可以正常对外提供服务了,但gs_om命令会报下面这样的错误,虽然完全可以用ptkc来替代gs_om,但是openGauss生态的一些外部工具可能还是会调用gs_om
[omm@kylinv11 ~]$ gs_om -t status
/opt/mogdb/tool/script/gspylib/common/../../../lib/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
raise TypeError("%s and %s are not of the same version" (a, b))
^CTraceback (most recent call last):
File "/opt/mogdb/tool/script/gspylib/common/Common.py", line 64, in <module>
import psutil
File "/opt/mogdb/tool/script/gspylib/common/../../../lib/psutil/__init__.py", line 102, in <module>
from . import _pslinux as _psplatform
File "/opt/mogdb/tool/script/gspylib/common/../../../lib/psutil/_pslinux.py", line 26, in <module>
from . import _psutil_linux as cext
File "/opt/mogdb/tool/script/gspylib/common/../../../lib/psutil/_psutil_linux.py", line 7, in <module>
__bootstrap__()
File "/opt/mogdb/tool/script/gspylib/common/../../../lib/psutil/_psutil_linux.py", line 6, in __bootstrap__
imp.load_dynamic(__name__,__file__)
File "/usr/lib64/python3.11/imp.py", line 343, in load_dynamic
return _load(spec)
^^^^^^^^^^^
ImportError: /opt/mogdb/tool/script/gspylib/common/../../../lib/psutil/_psutil_linux.so: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/mogdb/tool/script/gs_om", line 29, in <module>
from gspylib.common.ParameterParsecheck import Parameter
File "/opt/mogdb/tool/script/gspylib/common/ParameterParsecheck.py", line 27, in <module>
from gspylib.common.Common import DefaultValue
File "/opt/mogdb/tool/script/gspylib/common/Common.py", line 87, in <module>
time.sleep(1)
KeyboardInterrupt
[omm@kylinv11 ~]$
安装python3开发包
[root@kylinv11 ~]# yum install python3-devel
Last metadata expiration check: 0:08:39 ago on 2025年08月27日 星期三 13时56分47秒.
Dependencies resolved.
========================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================
Installing:
python3-devel x86_64 3.11.6-10.p01.ky11 v11-adv-os 16 M
Installing dependencies:
python3-rpm-generators noarch 9-5.ky11 v11-adv-os 22 k
Transaction Summary
========================================================================================================================
Install 2 Packages
Total download size: 16 M
Installed size: 102 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): python3-rpm-generators-9-5.ky11.noarch.rpm 67 kB/s | 22 kB 00:00
(2/2): python3-devel-3.11.6-10.p01.ky11.x86_64.rpm 16 MB/s | 16 MB 00:01
------------------------------------------------------------------------------------------------------------------------
Total 16 MB/s | 16 MB 00:01
Kylin Linux Advanced Server 11 - Os 95 kB/s | 1.7 kB 00:00
Importing GPG key 0x7A486D9F:
Userid : "NeoKylin (release key) <support@cs2c.com.cn>"
Fingerprint: B814 9E68 5286 4585 CE41 143B 41F8 AEBE 7A48 6D9F
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-kylin
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : python3-rpm-generators-9-5.ky11.noarch 1/2
Installing : python3-devel-3.11.6-10.p01.ky11.x86_64 2/2
Running scriptlet: python3-devel-3.11.6-10.p01.ky11.x86_64 2/2
Verifying : python3-devel-3.11.6-10.p01.ky11.x86_64 1/2
Verifying : python3-rpm-generators-9-5.ky11.noarch 2/2
Installed:
python3-devel-3.11.6-10.p01.ky11.x86_64 python3-rpm-generators-9-5.ky11.noarch
Complete!
[root@kylinv11 ~]#
安装python依赖库
[root@kylinv11 ~]# pip3 install psutil netifaces cffi pycparser cryptography pynacl bcrypt paramiko -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Requirement already satisfied: psutil in /usr/lib64/python3.11/site-packages (5.9.5)
Collecting netifaces
Downloading http://mirrors.aliyun.com/pypi/packages/a6/91/86a6eac449ddfae239e93ffc1918cf33fd9bab35c04d1e963b311e347a73/netifaces-0.11.0.tar.gz (30 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: cffi in /usr/lib64/python3.11/site-packages (1.16.0)
Requirement already satisfied: pycparser in /usr/lib/python3.11/site-packages (2.21)
Requirement already satisfied: cryptography in /usr/lib64/python3.11/site-packages (42.0.2)
Collecting pynacl
Downloading http://mirrors.aliyun.com/pypi/packages/ee/87/f1bb6a595f14a327e8285b9eb54d41fef76c585a0edef0a45f6fc95de125/PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (856 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 856.7/856.7 kB 5.1 MB/s eta 0:00:00
Collecting bcrypt
Downloading http://mirrors.aliyun.com/pypi/packages/dc/7f/1e36379e169a7df3a14a1c160a49b7b918600a6008de43ff20d479e6f4b5/bcrypt-4.3.0-cp39-abi3-manylinux_2_34_x86_64.whl (284 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 284.2/284.2 kB 11.3 MB/s eta 0:00:00
Collecting paramiko
Downloading http://mirrors.aliyun.com/pypi/packages/a9/90/a744336f5af32c433bd09af7854599682a383b37cfd78f7de263de6ad6cb/paramiko-4.0.0-py3-none-any.whl (223 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 223.9/223.9 kB 12.6 MB/s eta 0:00:00
Collecting invoke>=2.0 (from paramiko)
Downloading http://mirrors.aliyun.com/pypi/packages/0a/66/7f8c48009c72d73bc6bbe6eb87ac838d6a526146f7dab14af671121eb379/invoke-2.2.0-py3-none-any.whl (160 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.3/160.3 kB 14.0 MB/s eta 0:00:00
Building wheels for collected packages: netifaces
Building wheel for netifaces (pyproject.toml) ... done
Created wheel for netifaces: filename=netifaces-0.11.0-cp311-cp311-linux_x86_64.whl size=14507 sha256=d59c9d48c151098de1107914e9ab8a74b9fa7d8a9f685c2e2461b7ec4f5ddc8a
Stored in directory: /root/.cache/pip/wheels/e5/f1/18/af17b61ea61d7b917eb8f55d59c7070dec8c613facd23c204a
Successfully built netifaces
Installing collected packages: invoke, bcrypt, pynacl, paramiko, netifaces
Successfully installed bcrypt-4.3.0 invoke-2.2.0 paramiko-4.0.0 pynacl-1.5.0 netifaces-0.11.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[root@kylinv11 ~]#
移除om自带的python依赖库
[root@kylinv11 ~]# ptk cluster shell -n payne -c "mv \$GPHOME/lib \$GPHOME/lib_bak"
****** Host[192.168.163.135] Result ******
[root@kylinv11 ~]#
修改om的校验代码,添加支持kylin11的枚举值
[root@kylinv11 ~]# ptk cluster shell -n payne -c "if ! grep -A1 'SUPPORT_RHEL7X_VERSION_LIST = ' \$GPHOME/script/os_platform/common.py | grep -q '\"11\"'; then sed -i '/SUPPORT_RHEL7X_VERSION_LIST = /,/]/s/\"10\"]/\"10\", \"11\"]/' \$GPHOME/script/os_platform/common.py && echo \"已添加kylin11支持到SUPPORT_RHEL7X_VERSION_LIST\"; else echo \"SUPPORT_RHEL7X_VERSION_LIST中已包含11版本,无需修改\"; fi"
****** Host[192.168.163.135] Result ******
已添加kylin11支持到SUPPORT_RHEL7X_VERSION_LIST
[root@kylinv11 ~]#
测试om命令
[root@kylinv11 ~]# su - omm
上一次登录: 2025年08月27日 星期三 14:11:29 CST 于 pts/0
[omm@kylinv11 ~]$ gs_om -t status --detail
[ Cluster State ]
cluster_state : Normal
redistributing : No
current_az : AZ_ALL
[ Datanode State ]
node node_ip port instance state
-----------------------------------------------------------------------------------
1 kylinv11 192.168.163.135 26000 6001 /opt/mogdb/data P Primary Normal
[omm@kylinv11 ~]$ gs_om -t stop
Stopping cluster.
=========================================
Successfully stopped cluster.
=========================================
End stop cluster.
[omm@kylinv11 ~]$ gs_om -t start
Starting cluster.
=========================================
[SUCCESS] kylinv11
2025-08-27 14:38:22.078 [unknown] [unknown] localhost 22621224164480 0[0:0#0] 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets
2025-08-27 14:38:22.078 [unknown] [unknown] localhost 22621224164480 0[0:0#0] 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets
2025-08-27 14:38:22.081 [unknown] [unknown] localhost 22621224164480 0[0:0#0] 0 [BACKEND] WARNING: Failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (16 Mbytes) or shared memory (3498 Mbytes) is larger.
=========================================
Successfully started.
[omm@kylinv11 ~]$
gs_om命令也已经可以正常使用了
总结
MogDB在最新的麒麟V11上也可以正常运行,只是om的代码需要调整一下,可以期待后续官方补丁支持。