暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

ptk工具使用方法

是赐赐啊!🦄 2025-01-20
284

1、安装部署ptk:

在线安装

curl --proto '=https' --tlsv1.2 -sSf https://cdn-mogdb.enmotech.com/ptk/install.sh | sh

离线安装

mkdir -p $HOME/.ptk/bin
tar -xvf <安装包> -C $HOME/.ptk/bin
echo "export PATH=$HOME/.ptk/bin:$PATH" >> $HOME/.bashrc
source $HOME/.bashrc

2、创建opengauss 集群yaml模版 

执行后,会进入交互式终端,用户只需根据提示的问题,逐个填写即可。注意,在填写 db_servers 时,SSH 的登录信息如果相同可重复使用。当交互式终端退出后,会自动在当前文件夹下创建一个 config.yaml 的文件。

[root@appdb1 ptk_app]# ./ptk template create
✔ Please enter cluster name (default: burnell): cluster1
✔ Please enter system username (default: omm):
✔ Please enter group of user (default: omm):
✔ Please enter db password (8~15 characters, 3 classes): ************
✔ Retype db password: ************
✔ Please enter db port (range 1024~65535) (default: 26000): 15400
✔ Please enter mogdb base dir (which should be empty) (default: /opt/mogdb): /home/omm/
✔ Do you want to intall cm component (default=n) [y/n]: y
And then, let's add some db servers
================db server 1================
✔ Please enter server ip (IPv4 only): 192.168.56.200
✔ Please choose db role: primary
✔ Please enter available zone name (default: AZ1):
✔ Please enter zone("AZ1") priority (default: 1):
================ end ================
✔ Do you want to add another db server (default=n) [y/n]: y
================db server 2================
✔ Please enter server ip (IPv4 only): 192.168.56.201
✔ Please choose db role: standby
✔ Please enter available zone name (default: AZ1):
✔ [SSH] Please enter ssh user (default: root):
✔ [SSH] Please enter ssh port (default: 22):
✔ [SSH] Please enter ssh port (default: 22):
✔ [SSH] Please choice an auth method: : Password
✔ [SSH] Please enter ssh password: ************
================ end ================
✔ Do you want to add another db server (default=n) [y/n]: y
================db server 3================
✔ Please enter server ip (IPv4 only): 192.168.56.202
✔ Please choose db role: standby
✔ Please enter available zone name (default: AZ1):
✔ Do you want to reuse SSH configurations from other servers (default=n) [y/n]: y
✔ Please choose a server: 192.168.56.201
================ end ================
✔ Do you want to add another db server (default=n) [y/n]: n
Generate /root/ptk_app/config.2025-01-20T14_55_54.yaml successfully


3、查看集群yaml日志:more /root/ptk_app/config.2025-01-20T14_55_54.yaml

整个配置文件分为三个部分:global, db_servers 和 cm_servers

  • global: 定义集群内所有实例公用的信息及缺省值
  • db_servers: 实例列表,每个元素代表一个实例信息
  • cm_servers: CM server 部署节点信息,该部分仅在指定了 --install-cm 参数时生效,也可以省略,默认和 db_servers 部署在一起

[root@appdb1 ptk_app]# more /root/ptk_app/config.2025-01-20T14_55_54.yaml
global:
cluster_name: cluster1
user: omm
group: omm
db_password: pTk6MWFmNDFjMzc8PT48PUBBQk0zSGtuMGw0YklCQjBPSE1YS0E5aldZbDVfSHk1WTBFTDV2U2N3Yi1XQkk=
db_port: 15400
base_dir: /home/omm/
cm_option:
dir: /home/omm/cm
cm_server_port: 15300
db_servers:
- host: 192.168.56.200
role: primary
az_name: AZ1
az_priority: 1
- host: 192.168.56.201
role: standby
az_name: AZ1
az_priority: 1
ssh_option:
port: 22
user: root
password: pTk6MmYxNjc3NzA8PT48PUBBRDNscU1RMkxOeUkyQ3V0Znc2bm12c25LVER6WS1GaU5PVUZ6aktNc1hDR2c=
- host: 192.168.56.202
role: standby
az_name: AZ1
az_priority: 1
ssh_option:
port: 22
user: root
password: pTk6MmYxNjc3NzA8PT48PUBBRDNscU1RMkxOeUkyQ3V0Znc2bm12c25LVER6WS1GaU5PVUZ6aktNc1hDR2c=

4 、ptk工具安装opengauss 集群预检查:

 ./ptk checkos -f /root/ptk_app/config.2025-01-20T10_59_43.yaml --detail

  ./ptk checkos -f /root/ptk_app/config.2025-01-20T10_59_43.yaml --detail
INFO[2025-01-20T11:05:26.532] prechecking dependent tools...
WARN[2025-01-20T11:05:28.609] [192.168.56.202][omm] device(/dev/sdc) readahead value=8192, expect 16384.
ERRO[2025-01-20T11:05:29.477] [192.168.56.200][omm] not found package: libaio
ERRO[2025-01-20T11:05:29.477] [192.168.56.200][omm] not found package: numactl
WARN[2025-01-20T11:05:35.887] [192.168.56.200][omm] net.ipv4.tcp_retries1=3, expect 5
WARN[2025-01-20T11:05:35.911] [192.168.56.200][omm] net.ipv4.tcp_syn_retries=2, expect 5
WARN[2025-01-20T11:05:35.929] [192.168.56.200][omm] net.ipv4.tcp_fin_timeout=10, expect 60
WARN[2025-01-20T11:05:35.965] [192.168.56.200][omm] net.ipv4.tcp_synack_retries=2, expect 5
WARN[2025-01-20T11:05:35.991] [192.168.56.200][omm] vm.min_free_kbytes=112640, expect 124771
INFO[2025-01-20T11:05:36.001] [192.168.56.200][omm] check kernel.core_pattern
INFO[2025-01-20T11:05:36.008] [192.168.56.200][omm] check RemoveIPC value
INFO[2025-01-20T11:05:36.014] [192.168.56.200][omm] check KillUserProcesses value
WARN[2025-01-20T11:05:36.273] [192.168.56.202][omm] net.ipv4.tcp_fin_timeout=10, expect 60
WARN[2025-01-20T11:05:36.415] [192.168.56.202][omm] net.ipv4.tcp_synack_retries=2, expect 5
WARN[2025-01-20T11:05:37.017] [192.168.56.201][omm] net.ipv4.tcp_syn_retries=2, expect 5
WARN[2025-01-20T11:05:37.017] [192.168.56.202][omm] vm.min_free_kbytes=45056, expect 124634
WARN[2025-01-20T11:05:37.540] [192.168.56.201][omm] net.ipv4.tcp_retries1=3, expect 5
WARN[2025-01-20T11:05:38.052] [192.168.56.201][omm] vm.min_free_kbytes=112640, expect 124770
WARN[2025-01-20T11:05:38.584] [192.168.56.202][omm] net.ipv4.tcp_retries1=3, expect 5
WARN[2025-01-20T11:05:38.598] [192.168.56.201][omm] net.ipv4.tcp_fin_timeout=10, expect 60
WARN[2025-01-20T11:05:38.781] [192.168.56.201][omm] net.ipv4.tcp_synack_retries=2, expect 5
WARN[2025-01-20T11:05:40.030] [192.168.56.202][omm] net.ipv4.tcp_syn_retries=2, expect 5
INFO[2025-01-20T11:05:40.030] [192.168.56.202][omm] check kernel.core_pattern
INFO[2025-01-20T11:05:40.061] [192.168.56.201][omm] check kernel.core_pattern
INFO[2025-01-20T11:05:40.337] [192.168.56.202][omm] check RemoveIPC value
INFO[2025-01-20T11:05:40.358] [192.168.56.201][omm] check RemoveIPC value
INFO[2025-01-20T11:05:40.456] [192.168.56.202][omm] check KillUserProcesses value
INFO[2025-01-20T11:05:40.476] [192.168.56.201][omm] check KillUserProcesses value
WARN[2025-01-20T11:05:40.722] [192.168.56.200][omm] device(sda) 'IO Request'=254, expect 256
WARN[2025-01-20T11:05:40.722] [192.168.56.200][omm] device(sdb) 'IO Request'=254, expect 256
WARN[2025-01-20T11:05:40.722] [192.168.56.200][omm] device(sdc) 'IO Request'=254, expect 256
WARN[2025-01-20T11:05:40.852] [192.168.56.202][omm] device(sda) 'IO Request'=254, expect 256
WARN[2025-01-20T11:05:40.852] [192.168.56.202][omm] device(sdb) 'IO Request'=254, expect 256
WARN[2025-01-20T11:05:40.852] [192.168.56.202][omm] device(sdc) 'IO Request'=254, expect 256
WARN[2025-01-20T11:05:40.858] [192.168.56.201][omm] device(sda) 'IO Request'=254, expect 256
WARN[2025-01-20T11:05:40.858] [192.168.56.201][omm] device(sdb) 'IO Request'=254, expect 256
WARN[2025-01-20T11:05:40.858] [192.168.56.201][omm] device(sdc) 'IO Request'=254, expect 256
INFO[2025-01-20T11:05:41.979] [192.168.56.200][omm] timezone: +0800
INFO[2025-01-20T11:05:42.096] [192.168.56.201][omm] timezone: +0800
INFO[2025-01-20T11:05:42.102] [192.168.56.202][omm] timezone: +0800
INFO[2025-01-20T11:05:42.109] [192.168.56.200][omm] swap memory 2097148kB, total memory 2495436kB
INFO[2025-01-20T11:05:42.226] [192.168.56.201][omm] swap memory 2097148kB, total memory 2495400kB
INFO[2025-01-20T11:05:42.229] [192.168.56.202][omm] swap memory 2097148kB, total memory 2492680kB
INFO[2025-01-20T11:05:42.694] [192.168.56.202][omm] check port 15400
INFO[2025-01-20T11:05:42.695] [192.168.56.200][omm] check port 15400
INFO[2025-01-20T11:05:42.695] [192.168.56.201][omm] check port 15400
INFO[2025-01-20T11:05:42.706] [192.168.56.200][omm] port 15400 is free
INFO[2025-01-20T11:05:43.245] [192.168.56.201][omm] port 15400 is free
INFO[2025-01-20T11:05:43.255] [192.168.56.202][omm] port 15400 is free
INFO[2025-01-20T11:05:43.255] [192.168.56.202][omm] platform: openEuler_22.03_64bit
INFO[2025-01-20T11:05:43.255] [192.168.56.201][omm] platform: openEuler_22.03_64bit
INFO[2025-01-20T11:05:43.255] [192.168.56.200][omm] platform: openEuler_22.03_64bit
INFO[2025-01-20T11:05:43.259] [192.168.56.200][omm] kernel version: 5.10.0-60.18.0.50.oe2203.x86_64
INFO[2025-01-20T11:05:43.376] [192.168.56.201][omm] kernel version: 5.10.0-60.18.0.50.oe2203.x86_64
INFO[2025-01-20T11:05:43.387] [192.168.56.202][omm] kernel version: 5.10.0-60.120.0.147.oe2203.x86_64
INFO[2025-01-20T11:05:44.855] all checkers finished
INFO[2025-01-20T11:05:44.855] write fix os script to root_fix_os.0120.110544.sh success
INFO[2025-01-20T11:05:44.855] time elapsed: 18s
# Check Results
Item | Level | Message
------------------------------------+----------+-------------------------------------------------------
A1.Check_OS_Version | OK |
A2.Check_Kernel_Version | OK |
A3.Check_Unicode | OK |
A4.Check_TimeZone | OK |
A5.Check_Swap_Memory_Configure | Warning | [192.168.56.202]:
| | available memory (2012584 KB) is less than 2 GB
| | [192.168.56.200]:
| | available memory (1895572 KB) is less than 2 GB
| | [192.168.56.201]:
| | available memory (1929536 KB) is less than 2 GB
A6.Check_SysCtl_Parameter | Warning | [192.168.56.200]:
| | Warning: net.ipv4.tcp_retries1=3, expect 5
| | Warning: net.ipv4.tcp_syn_retries=2, expect 5
| | Warning: net.ipv4.tcp_fin_timeout=10, expect 60
| | Warning: net.ipv4.tcp_synack_retries=2, expect 5
| | Warning: vm.min_free_kbytes=112640, expect 124771
| | [192.168.56.202]:
| | Warning: net.ipv4.tcp_fin_timeout=10, expect 60
| | Warning: net.ipv4.tcp_synack_retries=2, expect 5
| | Warning: vm.min_free_kbytes=45056, expect 124634
| | Warning: net.ipv4.tcp_retries1=3, expect 5
| | Warning: net.ipv4.tcp_syn_retries=2, expect 5
| | [192.168.56.201]:
| | Warning: net.ipv4.tcp_syn_retries=2, expect 5
| | Warning: net.ipv4.tcp_retries1=3, expect 5
| | Warning: vm.min_free_kbytes=112640, expect 124770
| | Warning: net.ipv4.tcp_fin_timeout=10, expect 60
| | Warning: net.ipv4.tcp_synack_retries=2, expect 5
A7.Check_FileSystem_Configure | OK |
A8.Check_Disk_Configure | OK |
A9.Check_BlockDev_Configure | Warning | [192.168.56.200]:
| | Normal
| | [192.168.56.202]:
| | device(/dev/sdc) readahead value=8192, expect 16384.
| | [192.168.56.201]:
| | Normal
A9.Check_Logical_Block | OK |
A10.Check_NR_Request | Warning | [192.168.56.200]:
| | Warning: device(sda) 'IO Request'=254, expect 256
| | Warning: device(sdb) 'IO Request'=254, expect 256
| | Warning: device(sdc) 'IO Request'=254, expect 256
| | [192.168.56.202]:
| | Warning: device(sda) 'IO Request'=254, expect 256
| | Warning: device(sdb) 'IO Request'=254, expect 256
| | Warning: device(sdc) 'IO Request'=254, expect 256
| | [192.168.56.201]:
| | Warning: device(sda) 'IO Request'=254, expect 256
| | Warning: device(sdb) 'IO Request'=254, expect 256
| | Warning: device(sdc) 'IO Request'=254, expect 256
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 | OK |
A14.Check_THP_Status | OK |
A15.Check_Dependent_Package | Abnormal | [192.168.56.200]:
| | Warning: not found package: flex
| | Warning: not found package: bison
| | Warning: not found package: ncurses-devel
| | Warning: not found package: glibc-devel
| | Warning: not found package: patch
| | Abnormal: not found package: libaio
| | Abnormal: not found package: numactl
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 1, warning count 4
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.0120.110544.sh for commands to resolve.

5、预先检查后解决os出现的问题

[root@appdb1 ptk_app]# sh root_fix_os.0120.110544.sh
++ ip addr
++ grep inet
++ grep -v 'inet6\|127.0.0.1\|grep'
++ awk -F / '{print $1}'
++ awk '{print $2}'
+ local_ips=192.168.56.200
+ for ip in ${local_ips}
+ [[ 192.168.56.200 == \1\9\2\.\1\6\8\.\5\6\.\2\0\0 ]]
+ sudo yum install -y libaio
sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: unable to load /usr/libexec/sudo/sudoers.so: /usr/lib64/libldap.so.2: undefined symbol: EVP_md2, version OPENSSL_1_1_0
sudo: fatal error, unable to load plugins
+ sudo yum install -y numactl
sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: unable to load /usr/libexec/sudo/sudoers.so: /usr/lib64/libldap.so.2: undefined symbol: EVP_md2, version OPENSSL_1_1_0
sudo: fatal error, unable to load plugins

6、PTK 支持在部署数据库集群的同时一同把 CM 集群部署好,您仅需在安装的命令中增加一个 --install-cm 参数即可:

默认 PTK 会将 CM server 和数据库实例部署在一起,和数据库的数量保持一致。如果集群的数量大于 3 个以上时,由于 CM 高可用采用的多数派选举算法要求,默认我们推荐是部署奇数个 CM server 节点,所以当部署偶数个数据库实例时, PTK 会通过交互来让您选择一个节点不部署 CM server。您如果仍希望 CM server 和数据库实例的个数保持一致,可以通过在安装命令里增加 --not-limit-cm-nodes 参数来取消该限制。

资源池化架构图

[root@appdb1 ptk_app]# ./ptk install -f config.yaml --install-cm -p ./openGauss-5.0.3-openEuler-64bit-all.tar.gz

INFO[2025-01-20T15:06:45.351] PTK Version: 1.7.5 release
INFO[2025-01-20T15:06:45.352] load config from config.yaml
open config.yaml: no such file or directory
[root@appdb1 ptk_app]#
[root@appdb1 ptk_app]#
[root@appdb1 ptk_app]# ./ptk install -f ./config.2025-01-20T1 --install-cm -p ./openGauss-5.0.3-openEuler-64bit-all.tar.gz
config.2025-01-20T10_59_43.yaml config.2025-01-20T14_55_54.yaml
[root@appdb1 ptk_app]# ./ptk install -f ./config.2025-01-20T14_55_54.yaml --install-cm -p ./openGauss-5.0.3-openEuler-64bit-all.tar.gz
INFO[2025-01-20T15:07:07.963] PTK Version: 1.7.5 release
INFO[2025-01-20T15:07:07.963] load config from ./config.2025-01-20T14_55_54.yaml
If you continue to install the software,
you are accepting the license agreement of the software.

[Y]: Accept and continue
[C]: Show content of licence agreement
[N]: Abort installation and exit

✔ Please enter (default: Y):
INFO[2025-01-20T15:07:13.612] cm enabled but cm_servers is empty, use db servers as cm servers
INFO[2025-01-20T15:07:13.612] not mogdb package, auto add --not-limit-cm-nodes flag
Cluster Name: "cluster1"
+--------------+----------------+-------------+----------+------------+-------------------+----------+
| az(priority) | ip | user(group) | port | role | data dir | upstream |
+--------------+----------------+-------------+----------+------------+-------------------+----------+
| AZ1(1) | 192.168.56.201 | omm(omm) | db:15400 | db:standby | db:/home/omm/data | - |
| | | | cm:15300 | | cm:/home/omm/cm | |
| | 192.168.56.202 | omm(omm) | db:15400 | db:standby | db:/home/omm/data | - |
| | | | cm:15300 | | cm:/home/omm/cm | |
| | 192.168.56.200 | omm(omm) | db:15400 | db:primary | db:/home/omm/data | - |
| | | | cm:15300 | | cm:/home/omm/cm | |
+--------------+----------------+-------------+----------+------------+-------------------+----------+
✔ Is cluster config correct (default=n) [y/n]: y
INFO[2025-01-20T15:07:19.024] start check hostname ...
INFO[2025-01-20T15:07:19.592] check hostname success
INFO[2025-01-20T15:07:19.592] start check os ...
INFO[2025-01-20T15:07:19.593] prechecking dependent tools...
WARN[2025-01-20T15:07:20.826] [192.168.56.200][omm] net.ipv4.tcp_retries1=3, expect 5
WARN[2025-01-20T15:07:20.841] [192.168.56.200][omm] net.ipv4.tcp_fin_timeout=10, expect 60
WARN[2025-01-20T15:07:20.850] [192.168.56.200][omm] net.ipv4.tcp_synack_retries=2, expect 5
WARN[2025-01-20T15:07:20.873] [192.168.56.200][omm] net.ipv4.tcp_syn_retries=2, expect 5
WARN[2025-01-20T15:07:20.905] [192.168.56.200][omm] vm.min_free_kbytes=112640, expect 124771
INFO[2025-01-20T15:07:20.908] [192.168.56.200][omm] check kernel.core_pattern
INFO[2025-01-20T15:07:20.915] [192.168.56.200][omm] check RemoveIPC value
INFO[2025-01-20T15:07:20.920] [192.168.56.200][omm] check KillUserProcesses value
WARN[2025-01-20T15:07:20.948] [192.168.56.201][omm] net.ipv4.tcp_synack_retries=2, expect 5
WARN[2025-01-20T15:07:21.205] [192.168.56.201][omm] net.ipv4.tcp_retries1=3, expect 5
WARN[2025-01-20T15:07:22.291] [192.168.56.202][omm] net.ipv4.tcp_fin_timeout=10, expect 60
WARN[2025-01-20T15:07:22.359] [192.168.56.201][omm] net.ipv4.tcp_fin_timeout=10, expect 60
WARN[2025-01-20T15:07:22.808] [192.168.56.201][omm] vm.min_free_kbytes=112640, expect 124770
WARN[2025-01-20T15:07:23.891] [192.168.56.202][omm] net.ipv4.tcp_syn_retries=2, expect 5
WARN[2025-01-20T15:07:24.096] [192.168.56.202][omm] net.ipv4.tcp_retries1=3, expect 5
WARN[2025-01-20T15:07:24.122] [192.168.56.201][omm] net.ipv4.tcp_syn_retries=2, expect 5
WARN[2025-01-20T15:07:24.211] [192.168.56.202][omm] net.ipv4.tcp_synack_retries=2, expect 5
WARN[2025-01-20T15:07:24.490] [192.168.56.202][omm] vm.min_free_kbytes=45056, expect 124634
INFO[2025-01-20T15:07:24.616] [192.168.56.202][omm] check kernel.core_pattern
INFO[2025-01-20T15:07:24.840] [192.168.56.201][omm] check kernel.core_pattern
INFO[2025-01-20T15:07:24.922] [192.168.56.202][omm] check RemoveIPC value
INFO[2025-01-20T15:07:25.046] [192.168.56.202][omm] check KillUserProcesses value
INFO[2025-01-20T15:07:25.138] [192.168.56.201][omm] check RemoveIPC value
INFO[2025-01-20T15:07:25.310] [192.168.56.201][omm] check KillUserProcesses value
WARN[2025-01-20T15:07:26.241] [192.168.56.202][omm] device(/dev/sdc) readahead value=8192, expect 16384.
INFO[2025-01-20T15:07:26.566] [192.168.56.202][omm] check port 15400
INFO[2025-01-20T15:07:26.566] [192.168.56.200][omm] check port 15400
INFO[2025-01-20T15:07:26.566] [192.168.56.201][omm] check port 15400
INFO[2025-01-20T15:07:26.578] [192.168.56.200][omm] port 15400 is free
INFO[2025-01-20T15:07:27.143] [192.168.56.202][omm] port 15400 is free
INFO[2025-01-20T15:07:27.234] [192.168.56.201][omm] port 15400 is free
INFO[2025-01-20T15:07:27.368] [192.168.56.202][omm] platform: openEuler_22.03_64bit
INFO[2025-01-20T15:07:27.368] [192.168.56.200][omm] platform: openEuler_22.03_64bit
INFO[2025-01-20T15:07:27.368] [192.168.56.201][omm] platform: openEuler_22.03_64bit
INFO[2025-01-20T15:07:27.529] [192.168.56.200][omm] swap memory 2097148kB, total memory 2495436kB
INFO[2025-01-20T15:07:27.672] [192.168.56.201][omm] swap memory 2097148kB, total memory 2495400kB
INFO[2025-01-20T15:07:27.674] [192.168.56.202][omm] swap memory 2097148kB, total memory 2492680kB
INFO[2025-01-20T15:07:28.579] [192.168.56.200][omm] kernel version: 5.10.0-60.18.0.50.oe2203.x86_64
INFO[2025-01-20T15:07:28.725] [192.168.56.201][omm] kernel version: 5.10.0-60.18.0.50.oe2203.x86_64
INFO[2025-01-20T15:07:28.729] [192.168.56.202][omm] kernel version: 5.10.0-60.120.0.147.oe2203.x86_64
INFO[2025-01-20T15:07:29.393] [192.168.56.200][omm] timezone: +0800
INFO[2025-01-20T15:07:29.504] [192.168.56.202][omm] timezone: +0800
INFO[2025-01-20T15:07:29.507] [192.168.56.201][omm] timezone: +0800
WARN[2025-01-20T15:07:29.515] [192.168.56.200][omm] device(sdb) 'IO Request'=254, expect 256
WARN[2025-01-20T15:07:29.515] [192.168.56.200][omm] device(sdc) 'IO Request'=254, expect 256
WARN[2025-01-20T15:07:29.515] [192.168.56.200][omm] device(sda) 'IO Request'=254, expect 256
WARN[2025-01-20T15:07:29.631] [192.168.56.202][omm] device(sda) 'IO Request'=254, expect 256
WARN[2025-01-20T15:07:29.631] [192.168.56.202][omm] device(sdb) 'IO Request'=254, expect 256
WARN[2025-01-20T15:07:29.631] [192.168.56.202][omm] device(sdc) 'IO Request'=254, expect 256
WARN[2025-01-20T15:07:29.636] [192.168.56.201][omm] device(sda) 'IO Request'=254, expect 256
WARN[2025-01-20T15:07:29.636] [192.168.56.201][omm] device(sdb) 'IO Request'=254, expect 256
WARN[2025-01-20T15:07:29.636] [192.168.56.201][omm] device(sdc) 'IO Request'=254, expect 256
INFO[2025-01-20T15:07:36.465] all checkers finished
INFO[2025-01-20T15:07:36.465] time elapsed: 16s
INFO[2025-01-20T15:07:36.466] check os success
INFO[2025-01-20T15:07:36.466] start check distro ...
INFO[2025-01-20T15:07:36.466] check distro success
INFO[2025-01-20T15:07:36.466] start check user ...
INFO[2025-01-20T15:07:36.637] check user success
INFO[2025-01-20T15:07:36.637] start check port ...
INFO[2025-01-20T15:07:36.637] checking port 15400 on host 192.168.56.200 (db listen port) ...
INFO[2025-01-20T15:07:36.637] checking port 15400 on host 192.168.56.201 (db listen port) ...
INFO[2025-01-20T15:07:36.637] checking port 15400 on host 192.168.56.202 (db listen port) ...
INFO[2025-01-20T15:07:36.643] checking port 15401 on host 192.168.56.200 (db HA port) ...
INFO[2025-01-20T15:07:36.650] checking port 15300 on host 192.168.56.200 (cm listen port) ...
INFO[2025-01-20T15:07:37.197] checking port 15401 on host 192.168.56.202 (db HA port) ...
INFO[2025-01-20T15:07:37.226] checking port 15401 on host 192.168.56.201 (db HA port) ...
INFO[2025-01-20T15:07:37.769] checking port 15300 on host 192.168.56.202 (cm listen port) ...
INFO[2025-01-20T15:07:37.816] checking port 15300 on host 192.168.56.201 (cm listen port) ...
INFO[2025-01-20T15:07:38.325] check port success
INFO[2025-01-20T15:07:40.543] [192.168.56.200][omm] create os user omm, group omm
INFO[2025-01-20T15:07:40.593] [192.168.56.200][omm] set ulimit configs
INFO[2025-01-20T15:07:40.671] [192.168.56.202][omm] create os user omm, group omm
INFO[2025-01-20T15:07:40.684] [192.168.56.201][omm] create os user omm, group omm
INFO[2025-01-20T15:07:40.843] [192.168.56.201][omm] set ulimit configs
INFO[2025-01-20T15:07:40.843] [192.168.56.202][omm] set ulimit configs
INFO[2025-01-20T15:07:40.956] start prepare installation package ...
INFO[2025-01-20T15:07:40.956] installation package is ready
INFO[2025-01-20T15:07:40.956] parse installation package ...
INFO[2025-01-20T15:09:14.929] db product: openGauss, version: 5.0.3, number: 92.862, commit_id: 89d144c2
INFO[2025-01-20T15:09:15.628] extract openGauss-5.0.3-openEuler-64bit.tar.bz2 to dir /tmp/ptk_tmp_2469197284
INFO[2025-01-20T15:09:35.049] execute command: gaussdb --version
INFO[2025-01-20T15:09:35.128] parse installation package success
INFO[2025-01-20T15:09:35.130] start complete the configuration ...
WARN[2025-01-20T15:09:35.130] Not MogDB, skip check db version for installing CM
INFO[2025-01-20T15:09:35.130] complete the configuration success
INFO[2025-01-20T15:09:35.130] save the topology to metadata
INFO[2025-01-20T15:09:35.130] start distribute installation package ...
INFO[2025-01-20T15:09:43.268] distrubite packages success
INFO[2025-01-20T15:09:43.268] start install logic nodes ...
INFO[2025-01-20T15:09:43.268] deploy db to omm@192.168.56.200
INFO[2025-01-20T15:09:43.269] [192.168.56.200][omm] make user omm's dir(s): /home/omm/
INFO[2025-01-20T15:09:43.269] deploy db to omm@192.168.56.201
INFO[2025-01-20T15:09:43.269] [192.168.56.201][omm] make user omm's dir(s): /home/omm/
INFO[2025-01-20T15:09:43.269] deploy db to omm@192.168.56.202
INFO[2025-01-20T15:09:43.269] [192.168.56.202][omm] make user omm's dir(s): /home/omm/
INFO[2025-01-20T15:09:43.405] [192.168.56.200][omm] clean user omm's ipc resource
INFO[2025-01-20T15:09:43.702] [192.168.56.200][omm] make user omm's dir(s): /home/omm/tool,/home/omm/tool/ptk_tool/bin
INFO[2025-01-20T15:09:43.899] [192.168.56.201][omm] clean user omm's ipc resource
INFO[2025-01-20T15:09:43.984] [192.168.56.202][omm] clean user omm's ipc resource
INFO[2025-01-20T15:09:44.261] [192.168.56.201][omm] make user omm's dir(s): /home/omm/tool,/home/omm/tool/ptk_tool/bin
INFO[2025-01-20T15:09:44.359] [192.168.56.202][omm] make user omm's dir(s): /home/omm/tool,/home/omm/tool/ptk_tool/bin
INFO[2025-01-20T15:09:49.384] [192.168.56.200][omm] extract openGauss-5.0.3-openEuler-64bit-all.tar.gz to dir /home/omm/tool
INFO[2025-01-20T15:09:49.969] [192.168.56.201][omm] extract openGauss-5.0.3-openEuler-64bit-all.tar.gz to dir /home/omm/tool
INFO[2025-01-20T15:09:49.986] [192.168.56.202][omm] extract openGauss-5.0.3-openEuler-64bit-all.tar.gz to dir /home/omm/tool
INFO[2025-01-20T15:09:50.884] [192.168.56.200][omm] extract openGauss-5.0.3-openEuler-64bit-om.tar.gz to dir /home/omm/tool
INFO[2025-01-20T15:09:51.464] [192.168.56.202][omm] extract openGauss-5.0.3-openEuler-64bit-om.tar.gz to dir /home/omm/tool
INFO[2025-01-20T15:09:51.510] [192.168.56.201][omm] extract openGauss-5.0.3-openEuler-64bit-om.tar.gz to dir /home/omm/tool
INFO[2025-01-20T15:09:51.600] [192.168.56.200][omm] try to fix psutil python lib
WARN[2025-01-20T15:09:52.120] [192.168.56.200][omm] Not found python3.6 or 3.7, skip fix psutil dynamic lib,
please install proper python and fix it manually or reinstall by ptk
if you don't fix this, it will cause that gs_om and cm_ctl cannot run properly, but not ptk and database
INFO[2025-01-20T15:09:52.120] [192.168.56.200][omm] write file /home/omm/tool/script/py_pstree.py
INFO[2025-01-20T15:09:52.244] [192.168.56.202][omm] try to fix psutil python lib
INFO[2025-01-20T15:09:52.342] [192.168.56.200][omm] write file /home/omm/tool/ptk_tool/bin/README.md
INFO[2025-01-20T15:09:52.381] [192.168.56.201][omm] try to fix psutil python lib
INFO[2025-01-20T15:09:52.768] [192.168.56.200][omm] write file /home/omm/tool/ptk_tool/bin/pscp
WARN[2025-01-20T15:09:52.794] [192.168.56.202][omm] Not found python3.6 or 3.7, skip fix psutil dynamic lib,
please install proper python and fix it manually or reinstall by ptk
if you don't fix this, it will cause that gs_om and cm_ctl cannot run properly, but not ptk and database
INFO[2025-01-20T15:09:52.794] [192.168.56.202][omm] write file /home/omm/tool/script/py_pstree.py
WARN[2025-01-20T15:09:52.957] [192.168.56.201][omm] Not found python3.6 or 3.7, skip fix psutil dynamic lib,
please install proper python and fix it manually or reinstall by ptk
if you don't fix this, it will cause that gs_om and cm_ctl cannot run properly, but not ptk and database
INFO[2025-01-20T15:09:52.957] [192.168.56.201][omm] write file /home/omm/tool/script/py_pstree.py
INFO[2025-01-20T15:09:53.102] [192.168.56.202][omm] write file /home/omm/tool/ptk_tool/bin/README.md
INFO[2025-01-20T15:09:53.228] [192.168.56.200][omm] write file /home/omm/tool/ptk_tool/bin/pssh
INFO[2025-01-20T15:09:53.234] [192.168.56.201][omm] write file /home/omm/tool/ptk_tool/bin/README.md
INFO[2025-01-20T15:09:53.595] [192.168.56.202][omm] write file /home/omm/tool/ptk_tool/bin/pscp
INFO[2025-01-20T15:09:53.741] [192.168.56.200][omm] write file /home/omm/tool/ptk_tool/bin/task_pool.py
INFO[2025-01-20T15:09:53.754] [192.168.56.201][omm] write file /home/omm/tool/ptk_tool/bin/pscp
INFO[2025-01-20T15:09:54.082] [192.168.56.202][omm] write file /home/omm/tool/ptk_tool/bin/pssh
INFO[2025-01-20T15:09:54.201] [192.168.56.200][omm] make user omm's dir(s): /home/omm/app
INFO[2025-01-20T15:09:54.294] [192.168.56.201][omm] write file /home/omm/tool/ptk_tool/bin/pssh
INFO[2025-01-20T15:09:54.558] [192.168.56.202][omm] write file /home/omm/tool/ptk_tool/bin/task_pool.py
INFO[2025-01-20T15:09:54.633] [192.168.56.200][omm] extract openGauss-5.0.3-openEuler-64bit.tar.bz2 to dir /home/omm/app
INFO[2025-01-20T15:09:54.743] [192.168.56.201][omm] write file /home/omm/tool/ptk_tool/bin/task_pool.py
INFO[2025-01-20T15:09:55.029] [192.168.56.202][omm] make user omm's dir(s): /home/omm/app
INFO[2025-01-20T15:09:55.163] [192.168.56.201][omm] make user omm's dir(s): /home/omm/app
INFO[2025-01-20T15:09:55.502] [192.168.56.202][omm] extract openGauss-5.0.3-openEuler-64bit.tar.bz2 to dir /home/omm/app
INFO[2025-01-20T15:09:55.614] [192.168.56.201][omm] extract openGauss-5.0.3-openEuler-64bit.tar.bz2 to dir /home/omm/app
INFO[2025-01-20T15:10:18.744] [192.168.56.202][omm] change mode of /home/omm/app to 700
INFO[2025-01-20T15:10:18.973] [192.168.56.202][omm] make user omm's dir(s): /home/omm/app/share/postgresql
INFO[2025-01-20T15:10:19.401] [192.168.56.200][omm] change mode of /home/omm/app to 700
INFO[2025-01-20T15:10:19.598] [192.168.56.200][omm] make user omm's dir(s): /home/omm/app/share/postgresql
INFO[2025-01-20T15:10:19.869] [192.168.56.201][omm] change mode of /home/omm/app to 700
INFO[2025-01-20T15:10:19.973] [192.168.56.202][omm] copy /home/omm/tool/script/gspylib/etc/sql/pmk_schema.sql to /home/omm/app/share/postgresql
INFO[2025-01-20T15:10:20.118] [192.168.56.201][omm] make user omm's dir(s): /home/omm/app/share/postgresql
INFO[2025-01-20T15:10:20.218] [192.168.56.202][omm] copy /home/omm/tool/script/gspylib/etc/sql/pmk_schema_single_inst.sql to /home/omm/app/share/postgresql
INFO[2025-01-20T15:10:20.466] [192.168.56.202][omm] write file /home/omm/app/bin/transfer.py
INFO[2025-01-20T15:10:20.647] [192.168.56.200][omm] copy /home/omm/tool/script/gspylib/etc/sql/pmk_schema.sql to /home/omm/app/share/postgresql
INFO[2025-01-20T15:10:20.786] [192.168.56.202][omm] set user omm profiles
INFO[2025-01-20T15:10:20.832] [192.168.56.200][omm] copy /home/omm/tool/script/gspylib/etc/sql/pmk_schema_single_inst.sql to /home/omm/app/share/postgresql
INFO[2025-01-20T15:10:21.084] [192.168.56.200][omm] write file /home/omm/app/bin/transfer.py
INFO[2025-01-20T15:10:21.323] [192.168.56.201][omm] copy /home/omm/tool/script/gspylib/etc/sql/pmk_schema.sql to /home/omm/app/share/postgresql
INFO[2025-01-20T15:10:21.418] [192.168.56.200][omm] set user omm profiles
INFO[2025-01-20T15:10:21.535] [192.168.56.201][omm] copy /home/omm/tool/script/gspylib/etc/sql/pmk_schema_single_inst.sql to /home/omm/app/share/postgresql
INFO[2025-01-20T15:10:21.747] [192.168.56.201][omm] write file /home/omm/app/bin/transfer.py
INFO[2025-01-20T15:10:22.140] [192.168.56.201][omm] set user omm profiles
INFO[2025-01-20T15:10:22.530] [192.168.56.202][omm] validate and try to fix ld library for gs_initdb
INFO[2025-01-20T15:10:22.754] [192.168.56.200][omm] validate and try to fix ld library for gs_initdb
INFO[2025-01-20T15:10:22.810] [192.168.56.202][omm] validate and try to fix ld library for gaussdb
INFO[2025-01-20T15:10:23.037] [192.168.56.200][omm] validate and try to fix ld library for gaussdb
INFO[2025-01-20T15:10:23.079] [192.168.56.202][omm] make user omm's dir(s): /home/omm/log/gs_profile,/home/omm/log/pg_log,/home/omm/log/pg_audit,/home/omm/log/bin,/home/omm/log/pg_log/dn_6003,/home/omm/log/pg_audit/dn_6003
INFO[2025-01-20T15:10:23.300] [192.168.56.200][omm] make user omm's dir(s): /home/omm/log/gs_profile,/home/omm/log/pg_log,/home/omm/log/pg_audit,/home/omm/log/bin,/home/omm/log/pg_log/dn_6001,/home/omm/log/pg_audit/dn_6001
INFO[2025-01-20T15:10:23.637] [192.168.56.201][omm] validate and try to fix ld library for gs_initdb
INFO[2025-01-20T15:10:23.892] [192.168.56.201][omm] validate and try to fix ld library for gaussdb
INFO[2025-01-20T15:10:24.138] [192.168.56.201][omm] make user omm's dir(s): /home/omm/log/gs_profile,/home/omm/log/pg_log,/home/omm/log/pg_audit,/home/omm/log/bin,/home/omm/log/pg_log/dn_6002,/home/omm/log/pg_audit/dn_6002
INFO[2025-01-20T15:10:28.602] [192.168.56.200][omm] make user omm's dir(s): /home/omm/tmp
INFO[2025-01-20T15:10:28.902] [192.168.56.202][omm] make user omm's dir(s): /home/omm/tmp
INFO[2025-01-20T15:10:29.309] [192.168.56.200][omm] save version to upgrade_version
INFO[2025-01-20T15:10:29.660] [192.168.56.202][omm] save version to upgrade_version
INFO[2025-01-20T15:10:30.193] [192.168.56.201][omm] make user omm's dir(s): /home/omm/tmp
INFO[2025-01-20T15:10:30.339] [192.168.56.200][omm] create file cluster_manual_start
INFO[2025-01-20T15:10:30.589] [192.168.56.200][omm] generate cluster_static_config file
INFO[2025-01-20T15:10:30.816] [192.168.56.202][omm] create file cluster_manual_start
INFO[2025-01-20T15:10:30.921] [192.168.56.200][omm] make user omm's dir(s): /home/omm/data
INFO[2025-01-20T15:10:30.950] [192.168.56.201][omm] save version to upgrade_version
INFO[2025-01-20T15:10:31.061] [192.168.56.202][omm] generate cluster_static_config file
INFO[2025-01-20T15:10:31.469] [192.168.56.202][omm] make user omm's dir(s): /home/omm/data
INFO[2025-01-20T15:10:31.655] [192.168.56.200][omm] write file /home/omm/tool/.ptk_deployer
INFO[2025-01-20T15:10:32.081] [192.168.56.201][omm] create file cluster_manual_start
INFO[2025-01-20T15:10:32.169] [192.168.56.202][omm] write file /home/omm/tool/.ptk_deployer
INFO[2025-01-20T15:10:32.301] [192.168.56.201][omm] generate cluster_static_config file
INFO[2025-01-20T15:10:32.584] [192.168.56.201][omm] make user omm's dir(s): /home/omm/data
INFO[2025-01-20T15:10:33.172] [192.168.56.201][omm] write file /home/omm/tool/.ptk_deployer
INFO[2025-01-20T15:10:33.413] generate certification files
INFO[2025-01-20T15:10:35.261] download certification files
INFO[2025-01-20T15:10:36.795] upload certification files to omm@192.168.56.201
INFO[2025-01-20T15:10:38.918] upload certification files to omm@192.168.56.202
INFO[2025-01-20T15:10:40.765] generate ssl files for cm
INFO[2025-01-20T15:10:46.223] certification files setup success
INFO[2025-01-20T15:10:46.223] deploy CM to omm@192.168.56.200
INFO[2025-01-20T15:10:46.223] deploy CM to omm@192.168.56.201
INFO[2025-01-20T15:10:46.223] deploy CM to omm@192.168.56.202
INFO[2025-01-20T15:10:46.223] [192.168.56.202][omm] add user omm to cron.allow
INFO[2025-01-20T15:10:46.223] [192.168.56.201][omm] add user omm to cron.allow
INFO[2025-01-20T15:10:46.224] [192.168.56.200][omm] add user omm to cron.allow
INFO[2025-01-20T15:10:46.230] [192.168.56.200][omm] make user omm's dir(s): /home/omm/cm,/home/omm/cm/cm_server,/home/omm/cm/cm_agent,/home/omm/log/cm/om_monitor
INFO[2025-01-20T15:10:46.354] [192.168.56.202][omm] make user omm's dir(s): /home/omm/cm,/home/omm/cm/cm_server,/home/omm/cm/cm_agent,/home/omm/log/cm/om_monitor
INFO[2025-01-20T15:10:46.363] [192.168.56.201][omm] make user omm's dir(s): /home/omm/cm,/home/omm/cm/cm_server,/home/omm/cm/cm_agent,/home/omm/log/cm/om_monitor
INFO[2025-01-20T15:10:48.876] [192.168.56.200][omm] extract openGauss-5.0.3-openEuler-64bit-cm.tar.gz to dir /home/omm/app
INFO[2025-01-20T15:10:49.288] [192.168.56.202][omm] extract openGauss-5.0.3-openEuler-64bit-cm.tar.gz to dir /home/omm/app
INFO[2025-01-20T15:10:49.416] [192.168.56.201][omm] extract openGauss-5.0.3-openEuler-64bit-cm.tar.gz to dir /home/omm/app
INFO[2025-01-20T15:10:49.793] [192.168.56.200][omm] change /home/omm/app owner to omm
INFO[2025-01-20T15:10:49.793] [192.168.56.200][omm] copy /home/omm/app/share/config/cm_server.conf.sample to /home/omm/cm/cm_server/cm_server.conf
INFO[2025-01-20T15:10:49.971] [192.168.56.200][omm] copy /home/omm/app/share/config/cm_agent.conf.sample to /home/omm/cm/cm_agent/cm_agent.conf
INFO[2025-01-20T15:10:50.174] [192.168.56.200][omm] change /home/omm/cm owner to omm
INFO[2025-01-20T15:10:50.174] [192.168.56.200][omm] update cm config file: /home/omm/cm/cm_agent/cm_agent.conf
INFO[2025-01-20T15:10:50.251] [192.168.56.202][omm] change /home/omm/app owner to omm
INFO[2025-01-20T15:10:50.251] [192.168.56.202][omm] copy /home/omm/app/share/config/cm_server.conf.sample to /home/omm/cm/cm_server/cm_server.conf
INFO[2025-01-20T15:10:50.399] [192.168.56.201][omm] change /home/omm/app owner to omm
INFO[2025-01-20T15:10:50.399] [192.168.56.201][omm] copy /home/omm/app/share/config/cm_server.conf.sample to /home/omm/cm/cm_server/cm_server.conf
INFO[2025-01-20T15:10:50.467] [192.168.56.202][omm] copy /home/omm/app/share/config/cm_agent.conf.sample to /home/omm/cm/cm_agent/cm_agent.conf
INFO[2025-01-20T15:10:50.607] [192.168.56.200][omm] update cm config file: /home/omm/cm/cm_server/cm_server.conf
INFO[2025-01-20T15:10:50.608] [192.168.56.201][omm] copy /home/omm/app/share/config/cm_agent.conf.sample to /home/omm/cm/cm_agent/cm_agent.conf
INFO[2025-01-20T15:10:50.663] [192.168.56.202][omm] change /home/omm/cm owner to omm
INFO[2025-01-20T15:10:50.664] [192.168.56.202][omm] update cm config file: /home/omm/cm/cm_agent/cm_agent.conf
INFO[2025-01-20T15:10:50.824] [192.168.56.201][omm] change /home/omm/cm owner to omm
INFO[2025-01-20T15:10:50.824] [192.168.56.201][omm] update cm config file: /home/omm/cm/cm_agent/cm_agent.conf
INFO[2025-01-20T15:10:51.178] [192.168.56.202][omm] update cm config file: /home/omm/cm/cm_server/cm_server.conf
INFO[2025-01-20T15:10:51.301] [192.168.56.200][omm] start om_monitor
INFO[2025-01-20T15:10:51.405] [192.168.56.201][omm] update cm config file: /home/omm/cm/cm_server/cm_server.conf
INFO[2025-01-20T15:10:51.529] [192.168.56.200][omm] remove cron task: om_monitor
INFO[2025-01-20T15:10:51.857] [192.168.56.202][omm] start om_monitor
INFO[2025-01-20T15:10:51.890] [192.168.56.200][omm] set omm cron task: om_monitor
INFO[2025-01-20T15:10:51.997] [192.168.56.202][omm] remove cron task: om_monitor
INFO[2025-01-20T15:10:52.016] [192.168.56.201][omm] start om_monitor
INFO[2025-01-20T15:10:52.208] initialize db on omm@192.168.56.200
INFO[2025-01-20T15:10:52.208] [192.168.56.200][omm] the database is initializing, please wait a few minutes
INFO[2025-01-20T15:10:52.234] [192.168.56.201][omm] remove cron task: om_monitor
INFO[2025-01-20T15:10:52.469] [192.168.56.202][omm] set omm cron task: om_monitor
INFO[2025-01-20T15:10:52.760] [192.168.56.201][omm] set omm cron task: om_monitor
INFO[2025-01-20T15:10:52.871] initialize db on omm@192.168.56.202
INFO[2025-01-20T15:10:52.871] [192.168.56.202][omm] the database is initializing, please wait a few minutes
INFO[2025-01-20T15:10:53.135] initialize db on omm@192.168.56.201
INFO[2025-01-20T15:10:53.136] [192.168.56.201][omm] the database is initializing, please wait a few minutes
INFO[2025-01-20T15:11:31.147] [192.168.56.201][omm] config postgresql.conf
INFO[2025-01-20T15:11:31.315] [192.168.56.201][omm] config pg_hba.conf
INFO[2025-01-20T15:11:31.524] [192.168.56.201][omm] copy ssl files to data dir
INFO[2025-01-20T15:11:31.766] [192.168.56.200][omm] config postgresql.conf
INFO[2025-01-20T15:11:31.945] [192.168.56.200][omm] config pg_hba.conf
INFO[2025-01-20T15:11:32.136] [192.168.56.200][omm] copy ssl files to data dir
INFO[2025-01-20T15:11:35.892] [192.168.56.202][omm] config postgresql.conf
INFO[2025-01-20T15:11:36.044] [192.168.56.202][omm] config pg_hba.conf
INFO[2025-01-20T15:11:36.203] [192.168.56.202][omm] copy ssl files to data dir
ptk will add this config to /etc/sudoers on nodes [192.168.56.200,192.168.56.201,192.168.56.202]:
omm ALL=(ALL) NOPASSWD:/usr/sbin/ifconfig
✔ Are you sure and continue (default=n) [y/n]: y
INFO[2025-01-20T15:12:10.076] logic nodes installed success
INFO[2025-01-20T15:12:10.076] generating ptkc ...
INFO[2025-01-20T15:12:10.935] start build ssh trust ...
INFO[2025-01-20T15:12:12.996] ssh trust build success
INFO[2025-01-20T15:12:12.996] start launch db ...
INFO[2025-01-20T15:12:12.996] [192.168.56.200][omm] start cluster by cm_ctl ...
INFO[2025-01-20T15:12:12.996] [192.168.56.200][omm] the database is starting, please wait a few minutes
INFO[2025-01-20T15:12:57.718] [192.168.56.200][omm] start cluster by cm_ctl success
INFO[2025-01-20T15:12:57.718] [192.168.56.200][omm] check dn state of 192.168.56.200:15400
INFO[2025-01-20T15:13:08.657] [192.168.56.200][omm] switchover success
INFO[2025-01-20T15:13:08.657] clear temp dirs ...
INFO[2025-01-20T15:13:08.945] clear temp dirs success
INFO[2025-01-20T15:13:08.945] time elapsed: 5m55s

cluste_name | host | user | port | status | message
--------------+----------------+------+-------+---------------+----------
cluster1 | 192.168.56.200 | omm | 15400 | start_success | success
| 192.168.56.202 | omm | 15400 | start_success | success

| 192.168.56.201 | omm | 15400 | start_success | success 

7、您可以通过如下命令进行查看集群列表:

ptk ls  cluster_name |  id  |              addr               | user |    data_dir    |            db_version            |     create_time     | comment  
---------------+------+---------------------------------+------+----------------+----------------------------------+---------------------+----------
  cluster1     | 6001 | 192.168.56.200:15400 (cm:15300) | omm  | /home/omm/data | openGauss 5.0.3 (build 89d144c2) | 2025-01-20T15:09:35 |          
               | 6002 | 192.168.56.201:15400 (cm:15300) | omm  | /home/omm/data |                                  |                     |          
               | 6003 | 192.168.56.202:15400 (cm:15300) | omm  | /home/omm/data |                                  |                     |          
[root@appdb1 ptk_app]# 

在输出的表格中,会展示这些信息:

  • cluster_name: 集群名称
  • id: 数据库实例的 ID,这个 ID 是在部署集群是 PTK 分配给每个实例的唯一 ID
  • addr: 数据库实例的监听地址,形式为 IP:PORT
  • user: 运行数据库的操作系统用户名
  • data_dir: 数据库实例的数据目录
  • db_version: 数据库的版本信息
  • create_time: 集群创建时间
  • comment: 集群备注,可以在安装集群时通过 --comment 参数来指定,也可以在安装好后通过 ptk cluster modify-comment 命令进行修改

如果您仅需要获取集群的名称,可以通过增加 -n 参数即可:

ptk ls -n

8、可以通过如下命令查看指定集群的状态信息:

[root@appdb1 ptk_app]# ./ptk cluster -n cluster1 status
[   Cluster State   ]
cluster_name                   : cluster1
cluster_state                  : Normal
database_version               : openGauss 5.0.3 (build 89d144c2)
cm_version                     : 5.0.3 (build dcddf6f6)

[  CMServer State   ]
  id |       ip       | port  | hostname |  role    
-----+----------------+-------+----------+----------
  1  | 192.168.56.200 | 15300 | appdb1   | primary  
  2  | 192.168.56.201 | 15300 | appdb2   | standby  
  3  | 192.168.56.202 | 15300 | appdb3   | standby  

[  Datanode State   ]
  cluster_name |  id  |       ip       | port  | user | nodename | db_role | state  |  uptime  | upstream  
---------------+------+----------------+-------+------+----------+---------+--------+----------+-----------
  cluster1     | 6001 | 192.168.56.200 | 15400 | omm  | dn_6001  | primary | Normal | 00:42:33 | -         
               | 6002 | 192.168.56.201 | 15400 | omm  | dn_6002  | standby | Normal | 00:43:00 | -         
               | 6003 | 192.168.56.202 | 15400 | omm  | dn_6003  | standby | Normal | 00:42:24 | -         

8.1 如果存在多个集群,可以通过不知道集群名称,指定 -a 参数来一次性列出所有集群的状态信息:

ptk cluster status -a

8.2 PTK 也支持指定 --detail 参数来查看状态时列出集群内每个实例的流复制信息:

ptk cluster -n <CLUSTER_NAME> status --detail

8.3 如果集群状态列表展示宽度过宽导致折行不便于查看,可以通过增加 -G 参数来实现纵向展示:

ptk cluster -n <CLUSTER_NAME> status -G

集群状态定义

状态含义
Normal集群所有实例正常可用
Unavailable集群无主不可用, 或者主库不是正常状态
Degraded集群可用,但是部分备节点不可用
Stopped集群全部节点停止
MultiPrimary集群出现多个主实例

9、主备切换 PTK 封装了 switchover 的集群操作命令,可以通过 PTK 实现任意实例的主备倒换。

-H 或 --host 参数指定实例的 IP

ptk cluster -n <CLUSTER_NAME> switchover -H <IP>

-i 或 --id 参数可以指定实例的 ID (ID 可通过 ptk ls 查看)

ptk cluster -n <CLUSTER_NAME> switchover -i <ID>

10、故障切换 如果集群内的主库由于某种原因宕机而无法通过重启实例来恢复的话,为了保证集群的可用性,您需要通过 failover 命令来将当前集群内一个正常的备库提升为主库来恢复对外提供服务。

-H 或 --host 参数指定实例的 IP

ptk cluster -n <CLUSTER_NAME> failover -H <IP>

-i 或 --id 参数可以指定实例的 ID (ID 可通过 ptk ls 查看)

ptk cluster -n <CLUSTER_NAME> failover -i <ID>


11、使用ptk工具启动、关闭、重启集群

您可以通过该命令指定集群名称来启动整个集群:

ptk cluster -n <CLUSTER_NAME> start

PTK 默认会启动集群内所有实例,您也可以指定具体的某个或多个实例来进行启动:

-H 或 --host 参数指定实例的 IP

ptk cluster -n <CLUSTER_NAME> start -H <IP>

-i 或 --id 参数可以指定实例的 ID (ID 可通过 ptk ls 查看)

ptk cluster -n <CLUSTER_NAME> start -i <ID>

PTK 是多集群管理软件,所以 PTK 也支持一键启动 PTK 管理的所有集群:

ptk cluster start [-a|--all]

11、使用ptk工具卸载集群:

[root@appdb1 ptk_app]# ./ptk uninstall -n opengauss5.0.3
INFO[2025-01-20T15:05:27.672] PTK Version: 1.7.5 release
Cluster Name: "opengauss5.0.3"
+--------------+----------------+-------------+-------+---------+----------------+----------+
| az(priority) | ip | user(group) | port | role | data dir | upstream |
+--------------+----------------+-------------+-------+---------+----------------+----------+
| AZ1(1) | 192.168.56.200 | omm(omm) | 15400 | primary | /home/omm/data | - |
| | 192.168.56.201 | omm(omm) | 15400 | standby | /home/omm/data | - |
| | 192.168.56.202 | omm(omm) | 15400 | standby | /home/omm/data | - |
+--------------+----------------+-------------+-------+---------+----------------+----------+
✔ Do you really want to uninstall this cluster? Please confirm carefully (default=n) [y/n]: y
✔ Do you want to delete db data (default=n) [y/n]: y
✔ Do you want to delete os user (default=n) [y/n]: y
INFO[2025-01-20T15:05:33.345] [192.168.56.202][omm] check db dirs owner
INFO[2025-01-20T15:05:33.346] [192.168.56.200][omm] check db dirs owner
INFO[2025-01-20T15:05:33.346] [192.168.56.201][omm] check db dirs owner
INFO[2025-01-20T15:05:33.845] [192.168.56.200][omm] check db process status
INFO[2025-01-20T15:05:33.848] [192.168.56.201][omm] check db process status
INFO[2025-01-20T15:05:33.875] [192.168.56.202][omm] check db process status
INFO[2025-01-20T15:05:34.055] [192.168.56.200][omm] remove files: /home/omm/app,/home/omm/tool,/home/omm/tmp,/home/omm/data,/home/omm/log
INFO[2025-01-20T15:05:34.055] [192.168.56.201][omm] remove files: /home/omm/app,/home/omm/tool,/home/omm/tmp,/home/omm/data,/home/omm/log
INFO[2025-01-20T15:05:34.056] [192.168.56.202][omm] remove files: /home/omm/app,/home/omm/tool,/home/omm/tmp,/home/omm/data,/home/omm/log
INFO[2025-01-20T15:05:38.323] [192.168.56.200][omm] kill user "omm" processes if exist: [krb5kdc]
INFO[2025-01-20T15:05:38.339] [192.168.56.202][omm] kill user "omm" processes if exist: [krb5kdc]
INFO[2025-01-20T15:05:38.350] [192.168.56.201][omm] kill user "omm" processes if exist: [krb5kdc]
INFO[2025-01-20T15:05:38.476] [192.168.56.200][omm] remove user "omm" from cron.allow
INFO[2025-01-20T15:05:38.480] [192.168.56.200][omm] remove user "omm" ulimits
INFO[2025-01-20T15:05:38.484] [192.168.56.200][omm] remove files: /home/omm/app,/home/omm/tool,/home/omm/tmp,/home/omm/data,/home/omm/log
INFO[2025-01-20T15:05:38.487] [192.168.56.200][omm] remove dir "/home/omm/" if empty
WARN[2025-01-20T15:05:38.502] [192.168.56.200][omm] unable to delete, because %!s(MISSING)/home/omm/dir "/home/omm/" contains other files:
-rw------- 1 omm omm 116 Jan 20 14:55 .bash_history
-rw-r--r-- 1 omm omm 75 Nov 2 2021 .bash_logout
-rw-r--r-- 1 omm omm 71 Nov 2 2021 .bash_profile
-rw-r--r-- 1 omm omm 213 Jan 20 11:36 .bashrc
-rw-rw-r-- 1 omm omm 934 Jan 20 11:36 .ptk_mogdb_env
-rw------- 1 omm omm 1024 Jan 20 11:36 .rnd
drwx------ 2 omm omm 104 Jan 20 11:42 .ssh
INFO[2025-01-20T15:05:38.502] [192.168.56.200][omm] kill user "omm" all processes
INFO[2025-01-20T15:05:38.551] [192.168.56.200][omm] delete user "omm"
INFO[2025-01-20T15:05:38.761] [192.168.56.201][omm] remove user "omm" from cron.allow
INFO[2025-01-20T15:05:38.764] [192.168.56.202][omm] remove user "omm" from cron.allow
INFO[2025-01-20T15:05:38.885] [192.168.56.201][omm] remove user "omm" ulimits
INFO[2025-01-20T15:05:38.889] [192.168.56.202][omm] remove user "omm" ulimits
INFO[2025-01-20T15:05:39.023] [192.168.56.201][omm] remove files: /home/omm/app,/home/omm/tool,/home/omm/tmp,/home/omm/data,/home/omm/log
INFO[2025-01-20T15:05:39.024] [192.168.56.202][omm] remove files: /home/omm/app,/home/omm/tool,/home/omm/tmp,/home/omm/data,/home/omm/log
INFO[2025-01-20T15:05:39.140] [192.168.56.201][omm] remove dir "/home/omm/" if empty
INFO[2025-01-20T15:05:39.142] [192.168.56.202][omm] remove dir "/home/omm/" if empty
WARN[2025-01-20T15:05:39.438] [192.168.56.201][omm] unable to delete, because %!s(MISSING)/home/omm/dir "/home/omm/" contains other files:
-rw-r--r-- 1 omm omm 75 Nov 2 2021 .bash_logout
-rw-r--r-- 1 omm omm 71 Nov 2 2021 .bash_profile
-rw-r--r-- 1 omm omm 213 Jan 20 11:36 .bashrc
-rw-rw-r-- 1 omm omm 934 Jan 20 11:36 .ptk_mogdb_env
drwx------ 2 omm omm 104 Jan 20 11:38 .ssh
INFO[2025-01-20T15:05:39.438] [192.168.56.201][omm] kill user "omm" all processes
WARN[2025-01-20T15:05:39.443] [192.168.56.202][omm] unable to delete, because %!s(MISSING)/home/omm/dir "/home/omm/" contains other files:
-rw-r--r-- 1 omm omm 75 Nov 2 2021 .bash_logout
-rw-r--r-- 1 omm omm 71 Nov 2 2021 .bash_profile
-rw-r--r-- 1 omm omm 213 Jan 20 11:36 .bashrc
-rw-rw-r-- 1 omm omm 934 Jan 20 11:36 .ptk_mogdb_env
drwx------ 2 omm omm 85 Jan 20 11:37 .ssh
INFO[2025-01-20T15:05:39.443] [192.168.56.202][omm] kill user "omm" all processes
INFO[2025-01-20T15:05:39.621] [192.168.56.202][omm] delete user "omm"
INFO[2025-01-20T15:05:39.623] [192.168.56.201][omm] delete user "omm"
INFO[2025-01-20T15:05:39.864] uninstall successfully
 

===========================其他用户=========================================

1、收集系统和集群信息用于分析

[root@appdb1 ptk_app]# ./ptk collect -n cluster1

INFO[2025-01-20T15:37:43.891] dump data to "ptk-collect-2025-01-20T15_37_43.data.tar.gz" successfully 


2、显示解析后的静态文件内容

ptk view-static-config -f <STATIC_CONFIG_FILENAME> 


3、检查主机信息

# 检查当前主机
ptk checkos

# 检查特定的项目,并展示详细信息
ptk checkos -i A1,A2,A3 --detail

# 通过指定 config.yaml 来检查集群的机器,并且仅显示 abormal 的详细信息
ptk checkos -f config.yaml --only-abnormal-detail

# 通过指定 config.yaml 来检查集群的机器,同时在生成修复命令时包含 warning 级别的修复命令
ptk checkos -f config.yaml --gen-warning-fix

4、ptk encrypt提供一个便捷的方式来加密您的文本或密码

# Wrap the string to be encrypted with single quotes to prevent it from being interpreted
ptk encrypt 'Abcd@1234'

# Enter text by interaction
ptk encrypt --stdin

# Or pass text by pipe
echo '<TextToEncrypt>' | ptk encrypt --stdin [--disable-prompt]


















「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论