自openGauss 开源后,一直关注相关产品。云和恩墨的商业版是比较成功的产品之一,在openGauss发布3.0后发布了mogdb3.0.1,并升级了一键安装工具ptk。几位老师做了centos 7.6下的安装测试,决定试试国产操作系统银河麒麟V10的安装。
本次安装使用三台VBOX虚拟机,IP分别是:192.168.56.11/12/13
确认操作系统版本
[root@node1 ~]# cat /etc/os-release
NAME="Kylin Linux Advanced Server"
VERSION="V10 (Sword)"
ID="kylin"
VERSION_ID="V10"
PRETTY_NAME="Kylin Linux Advanced Server V10 (Sword)"
ANSI_COLOR="0;31"
在线安装PTK工具
curl --proto '=https' --tlsv1.2 -sSf https://cdn-mogdb.enmotech.com/ptk/install.sh | sh
安装后在当前用户下,修改了登录环境
cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export PATH=/root/.ptk/bin:$PATH
重新登录或source ~/.bash_profile生效。
source .bash_profile
查看mogdb支持的操作系统
[root@node1 ~]# ptk candidate os
software | version
-----------+---------------------------------
OS | UOS 20 (arm64)
| UOS 20 (x86_64)
| CentOS 8 (arm64)
| CentOS 7 (x86_64)
| CentOS 8 (x86_64)
| EulerOS 2 (arm64)
| EulerOS 2 (x86_64)
| Kylin V10 (arm64)
| Kylin V10 (x86_64)
| Oracle Linux Server 7 (x86_64)
| Oracle Linux Server 8 (x86_64)
| openEuler 20 (arm64)
| openEuler 22 (arm64)
| openEuler 20 (x86_64)
| openEuler 22 (x86_64)
| RedHat 7 (x86_64)
| Rocky Linux 7 (x86_64)
| Rocky Linux 8 (x86_64)
| SLES 12 (arm64)
| Ubuntu 18 (x86_64)
使用PTK交互式生成配置文件,一主两备
[root@node2 ~]# ptk template create
Please enter cluster name you want: (default: cluster_unphares) mogdb
Please enter system username: (default: omm)
Please enter group of user: (default: omm)
Please enter an initial db password (8 to 16 characters):
Please retype db password to confirm:
Please enter db port, range [1024~65535]: (default: 26000)
Please enter cm server port, range [1024~65535]: (default: 15300)
Please enter mogdb base dir (which should be empty): (default: /opt/mogdb)
And then, let's add some db servers
================db server 1================
Please enter server ip (IPv4 only): 192.168.56.11
Please choose db role:
1: primary
2: standby
3: cascade_standby
Enter your choice: 1
Please enter available zone name: (default: AZ1)
================ end ================
Do you want to add another db server?[Y|Yes](default=N) Y
================db server 2================
Please enter server ip (IPv4 only): 192.168.56.12
Please choose db role:
1: primary
2: standby
3: cascade_standby
Enter your choice: 2
Please enter available zone name: (default: AZ1)
[SSH] Please enter ssh user: (default: root)
[SSH] Please enter ssh port: (default: 22)
[SSH] Please choice an auth method:
1: Password
2: KeyFile
Enter your choice: 1
[SSH] Please enter ssh password:
================ end ================
Do you want to add another db server?[Y|Yes](default=N) Y
================db server 3================
Please enter server ip (IPv4 only): 192.168.56.13
Please choose db role:
1: primary
2: standby
3: cascade_standby
Enter your choice: 2
Please enter available zone name: (default: AZ1)
[SSH] Please enter ssh user: (default: root)
[SSH] Please enter ssh port: (default: 22)
[SSH] Please choice an auth method:
1: Password
2: KeyFile
Enter your choice: 1
[SSH] Please enter ssh password:
================ end ================
Do you want to add another db server?[Y|Yes](default=N) n
Generate /root/config.yaml successfully
默认文件名是config.yaml,相比于openGauss的XML格式更简洁。
安装前操作系统检查
[root@node2 bin]# ptk checkos
INFO[2022-08-20T09:45:01.861] prechecking dependent tools...
INFO[2022-08-20T09:45:01.868] platform: openEuler_22.03_64bit host=192.168.56.11
INFO[2022-08-20T09:45:01.870] kernel version: 5.10.0-60.20.0.52.oe2203.x86_64 host=192.168.56.11
INFO[2022-08-20T09:45:01.970] locale: LANG=en_US.UTF-8 host=192.168.56.11
INFO[2022-08-20T09:45:01.973] timezone: +0800 host=192.168.56.11
INFO[2022-08-20T09:45:01.975] swap memory 4194300kB, total memory 9668244kB host=192.168.56.11
INFO[2022-08-20T09:45:02.044] check kernel.core_pattern host=192.168.56.11
INFO[2022-08-20T09:45:02.048] check removeIPC value host=192.168.56.11
WARN[2022-08-20T09:45:02.450] device(dm-0) 'IO Request'=128, expect 256 host=192.168.56.11
WARN[2022-08-20T09:45:02.450] device(dm-1) 'IO Request'=128, expect 256 host=192.168.56.11
WARN[2022-08-20T09:45:02.450] device(sda) 'IO Request'=254, expect 256 host=192.168.56.11
WARN[2022-08-20T09:45:02.450] device(sr0) 'IO Request'=2, expect 256 host=192.168.56.11
[host 192.168.56.11]: not found package: numactl
INFO[2022-08-20T09:45:03.788] check port 26000 host=192.168.56.11
INFO[2022-08-20T09:45:03.886] port 26000 is free host=192.168.56.11
INFO[2022-08-20T09:45:03.886] write fix os script to root_fix_os.2022.0820.094503.sh successfully
INFO[2022-08-20T09:45:03.886] all checkers finished
# 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 | OK
A7.Check_FileSystem_Configure | OK
A8.Check_Disk_Configure | OK
A9.Check_BlockDev_Configure | OK
A9.Check_Logical_Block | OK
A10.Check_IO_Request | Warning
A10.Check_Asynchronous_IO_Request | OK
A10.Check_IO_Configure | OK
A11.Check_Network_Configure | OK
A12.Check_Time_Consistency | OK
A13.Check_Firewall_Service | OK
A14.Check_THP_Service | OK
A15.Check_Dependent_Package | Abnormal
A16.Check_CPU_Instruction_Set | OK
A17.Check_Port | OK
Total count 20, abnormal count 1, warning count 1
Failed to check os, can’t perform installation unless fix all the abnormal items
You can use 'ptk checkos -i ITEM --detail' to see detail message
Please check root_fix_os.[TIMESTAMP].sh for commands to resolve.
有影响安装的numactl包没有,生成了以时间戳标志的可执行文件root_fix_os.2022.0820.094503.sh,执行就可补上需要的包。
[root@node2 bin]# sh root_fix_os.2022.0820.094503.sh
OS 27 kB/s | 3.8 kB 00:00
everything 27 kB/s | 3.8 kB 00:00
EPOL 19 kB/s | 3.0 kB 00:00
debuginfo 28 kB/s | 3.8 kB 00:00
source 26 kB/s | 3.8 kB 00:00
update 25 kB/s | 3.5 kB 00:00
update 4.2 MB/s | 16 MB 00:03
Dependencies resolved.
================================================================================
Package Architecture Version Repository Size
================================================================================
Installing:
numactl x86_64 2.0.14-2.oe2203 OS 61 k
Transaction Summary
================================================================================
Install 1 Package
Total download size: 61 k
Installed size: 163 k
Downloading Packages:
numactl-2.0.14-2.oe2203.x86_64.rpm 234 kB/s | 61 kB 00:00
--------------------------------------------------------------------------------
Total 233 kB/s | 61 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : numactl-2.0.14-2.oe2203.x86_64 1/1
Running scriptlet: numactl-2.0.14-2.oe2203.x86_64 1/1
Verifying : numactl-2.0.14-2.oe2203.x86_64 1/1
Installed:
numactl-2.0.14-2.oe2203.x86_64
Complete!
在其余两节点安装numactl.
安装数据库、OM组件、CM组件
[root@node1 ~]# ptk install -f config.yaml --install-cm
INFO[2022-08-20T14:37:48.013] no package specified, use online package: https://cdn-mogdb.enmotech.com/mogdb-media/3.0.1/MogDB-3.0.1-openEuler-x86_64.tar.gz
INFO[2022-08-20T14:37:48.013] start check operating system
INFO[2022-08-20T14:37:48.304] prechecking dependent tools...
INFO[2022-08-20T14:37:48.547] platform: kylin_V10_64bit host=192.168.56.13
INFO[2022-08-20T14:37:48.547] platform: kylin_V10_64bit host=192.168.56.11
INFO[2022-08-20T14:37:48.547] platform: kylin_V10_64bit host=192.168.56.12
INFO[2022-08-20T14:37:48.549] kernel version: 4.19.90-24.4.v2101.ky10.x86_64 host=192.168.56.11
INFO[2022-08-20T14:37:48.594] kernel version: 4.19.90-24.4.v2101.ky10.x86_64 host=192.168.56.13
INFO[2022-08-20T14:37:48.598] kernel version: 4.19.90-24.4.v2101.ky10.x86_64 host=192.168.56.12
INFO[2022-08-20T14:37:48.692] locale: LANG=en_US.UTF-8 host=192.168.56.11
INFO[2022-08-20T14:37:48.718] locale: LANG=en_US.UTF-8 host=192.168.56.12
INFO[2022-08-20T14:37:48.723] locale: LANG=en_US.UTF-8 host=192.168.56.13
INFO[2022-08-20T14:37:48.726] timezone: +0800 host=192.168.56.11
INFO[2022-08-20T14:37:48.770] timezone: +0800 host=192.168.56.13
INFO[2022-08-20T14:37:48.772] timezone: +0800 host=192.168.56.12
INFO[2022-08-20T14:37:48.775] swap memory 5181436kB, total memory 8913004kB host=192.168.56.11
INFO[2022-08-20T14:37:48.820] swap memory 5181436kB, total memory 8913000kB host=192.168.56.12
INFO[2022-08-20T14:37:48.820] swap memory 5181436kB, total memory 8913004kB host=192.168.56.13
WARN[2022-08-20T14:37:48.828] net.core.wmem_default=212992, expect 21299200 host=192.168.56.11
WARN[2022-08-20T14:37:48.830] net.ipv4.tcp_tw_reuse=2, expect 1 host=192.168.56.11
WARN[2022-08-20T14:37:48.838] net.core.wmem_max=212992, expect 21299200 host=192.168.56.11
WARN[2022-08-20T14:37:48.843] net.core.netdev_max_backlog=1000, expect 65535 host=192.168.56.11
WARN[2022-08-20T14:37:48.849] vm.min_free_kbytes=67584, expect 445650 host=192.168.56.11
WARN[2022-08-20T14:37:48.851] kernel.sem=32000 1024000000 500 32000, expect 250 6400000 1000 25600 host=192.168.56.11
WARN[2022-08-20T14:37:48.853] net.ipv4.tcp_keepalive_time=7200, expect 30 host=192.168.56.11
WARN[2022-08-20T14:37:48.855] net.ipv4.tcp_retries2=15, expect 12 host=192.168.56.11
WARN[2022-08-20T14:37:48.857] net.ipv4.tcp_rmem=4096 131072 6291456, expect 8192 250000 16777216 host=192.168.56.11
WARN[2022-08-20T14:37:48.860] net.ipv4.tcp_wmem=4096 16384 4194304, expect 8192 250000 16777216 host=192.168.56.11
WARN[2022-08-20T14:37:48.863] net.core.rmem_max=212992, expect 21299200 host=192.168.56.11
WARN[2022-08-20T14:37:48.867] net.ipv4.tcp_keepalive_intvl=75, expect 30 host=192.168.56.11
WARN[2022-08-20T14:37:48.871] net.ipv4.tcp_max_syn_backlog=512, expect 65535 host=192.168.56.11
WARN[2022-08-20T14:37:48.874] net.ipv4.tcp_syn_retries=6, expect 5 host=192.168.56.11
WARN[2022-08-20T14:37:48.874] net.core.netdev_max_backlog=1000, expect 65535 host=192.168.56.12
WARN[2022-08-20T14:37:48.878] net.core.rmem_default=212992, expect 21299200 host=192.168.56.11
WARN[2022-08-20T14:37:48.883] net.ipv4.tcp_retries1=3, expect 5 host=192.168.56.11
WARN[2022-08-20T14:37:48.888] net.core.somaxconn=128, expect 65535 host=192.168.56.11
INFO[2022-08-20T14:37:48.892] check kernel.core_pattern host=192.168.56.11
INFO[2022-08-20T14:37:48.897] check removeIPC value host=192.168.56.11
WARN[2022-08-20T14:37:49.020] net.ipv4.tcp_rmem=4096 131072 6291456, expect 8192 250000 16777216 host=192.168.56.12
WARN[2022-08-20T14:37:49.067] net.ipv4.tcp_retries2=15, expect 12 host=192.168.56.13
WARN[2022-08-20T14:37:49.115] net.ipv4.tcp_max_syn_backlog=512, expect 65535 host=192.168.56.13
WARN[2022-08-20T14:37:49.210] net.ipv4.tcp_syn_retries=6, expect 5 host=192.168.56.12
WARN[2022-08-20T14:37:49.211] net.core.somaxconn=128, expect 65535 host=192.168.56.13
WARN[2022-08-20T14:37:49.258] net.core.rmem_max=212992, expect 21299200 host=192.168.56.12
WARN[2022-08-20T14:37:49.359] net.ipv4.tcp_keepalive_time=7200, expect 30 host=192.168.56.13
WARN[2022-08-20T14:37:49.360] net.ipv4.tcp_max_syn_backlog=512, expect 65535 host=192.168.56.12
WARN[2022-08-20T14:37:49.410] net.ipv4.tcp_syn_retries=6, expect 5 host=192.168.56.13
WARN[2022-08-20T14:37:49.462] net.core.wmem_default=212992, expect 21299200 host=192.168.56.13
WARN[2022-08-20T14:37:49.464] kernel.sem=32000 1024000000 500 32000, expect 250 6400000 1000 25600 host=192.168.56.12
WARN[2022-08-20T14:37:49.559] net.core.rmem_default=212992, expect 21299200 host=192.168.56.13
WARN[2022-08-20T14:37:49.563] net.ipv4.tcp_keepalive_intvl=75, expect 30 host=192.168.56.12
WARN[2022-08-20T14:37:49.612] net.core.rmem_default=212992, expect 21299200 host=192.168.56.12
WARN[2022-08-20T14:37:49.657] net.core.rmem_max=212992, expect 21299200 host=192.168.56.13
WARN[2022-08-20T14:37:49.718] net.core.wmem_default=212992, expect 21299200 host=192.168.56.12
WARN[2022-08-20T14:37:49.800] net.ipv4.tcp_retries1=3, expect 5 host=192.168.56.13
WARN[2022-08-20T14:37:49.815] vm.min_free_kbytes=67584, expect 445650 host=192.168.56.12
WARN[2022-08-20T14:37:49.850] net.ipv4.tcp_rmem=4096 131072 6291456, expect 8192 250000 16777216 host=192.168.56.13
WARN[2022-08-20T14:37:49.914] net.core.wmem_max=212992, expect 21299200 host=192.168.56.12
WARN[2022-08-20T14:37:49.946] net.core.netdev_max_backlog=1000, expect 65535 host=192.168.56.13
WARN[2022-08-20T14:37:49.993] net.ipv4.tcp_tw_reuse=2, expect 1 host=192.168.56.13
WARN[2022-08-20T14:37:50.008] net.ipv4.tcp_keepalive_time=7200, expect 30 host=192.168.56.12
WARN[2022-08-20T14:37:50.041] net.ipv4.tcp_wmem=4096 16384 4194304, expect 8192 250000 16777216 host=192.168.56.13
WARN[2022-08-20T14:37:50.057] net.ipv4.tcp_retries1=3, expect 5 host=192.168.56.12
WARN[2022-08-20T14:37:50.088] net.core.wmem_max=212992, expect 21299200 host=192.168.56.13
WARN[2022-08-20T14:37:50.104] net.ipv4.tcp_retries2=15, expect 12 host=192.168.56.12
WARN[2022-08-20T14:37:50.136] net.ipv4.tcp_keepalive_intvl=75, expect 30 host=192.168.56.13
WARN[2022-08-20T14:37:50.151] net.ipv4.tcp_wmem=4096 16384 4194304, expect 8192 250000 16777216 host=192.168.56.12
WARN[2022-08-20T14:37:50.232] vm.min_free_kbytes=67584, expect 445650 host=192.168.56.13
WARN[2022-08-20T14:37:50.250] net.core.somaxconn=128, expect 65535 host=192.168.56.12
WARN[2022-08-20T14:37:50.289] kernel.sem=32000 1024000000 500 32000, expect 250 6400000 1000 25600 host=192.168.56.13
INFO[2022-08-20T14:37:50.289] check kernel.core_pattern host=192.168.56.13
WARN[2022-08-20T14:37:50.304] net.ipv4.tcp_tw_reuse=2, expect 1 host=192.168.56.12
INFO[2022-08-20T14:37:50.304] check kernel.core_pattern host=192.168.56.12
INFO[2022-08-20T14:37:50.385] check removeIPC value host=192.168.56.13
INFO[2022-08-20T14:37:50.396] check removeIPC value host=192.168.56.12
WARN[2022-08-20T14:37:50.866] device(/dev/sda) readahead value=8192, expect 16384. host=192.168.56.11
WARN[2022-08-20T14:37:50.882] device(/dev/sda) readahead value=8192, expect 16384. host=192.168.56.13
WARN[2022-08-20T14:37:50.914] device(/dev/sda) readahead value=8192, expect 16384. host=192.168.56.12
WARN[2022-08-20T14:37:51.195] device(sr0) 'IO Request'=2, expect 256 host=192.168.56.11
WARN[2022-08-20T14:37:51.195] device(dm-0) 'IO Request'=128, expect 256 host=192.168.56.11
WARN[2022-08-20T14:37:51.195] device(dm-1) 'IO Request'=128, expect 256 host=192.168.56.11
WARN[2022-08-20T14:37:51.195] device(dm-2) 'IO Request'=128, expect 256 host=192.168.56.11
WARN[2022-08-20T14:37:51.195] device(sda) 'IO Request'=64, expect 256 host=192.168.56.11
WARN[2022-08-20T14:37:51.239] device(dm-0) 'IO Request'=128, expect 256 host=192.168.56.12
WARN[2022-08-20T14:37:51.239] device(dm-1) 'IO Request'=128, expect 256 host=192.168.56.12
WARN[2022-08-20T14:37:51.239] device(dm-2) 'IO Request'=128, expect 256 host=192.168.56.12
WARN[2022-08-20T14:37:51.239] device(sda) 'IO Request'=64, expect 256 host=192.168.56.12
WARN[2022-08-20T14:37:51.239] device(sr0) 'IO Request'=2, expect 256 host=192.168.56.12
WARN[2022-08-20T14:37:51.241] device(dm-0) 'IO Request'=128, expect 256 host=192.168.56.13
WARN[2022-08-20T14:37:51.241] device(dm-1) 'IO Request'=128, expect 256 host=192.168.56.13
WARN[2022-08-20T14:37:51.241] device(dm-2) 'IO Request'=128, expect 256 host=192.168.56.13
WARN[2022-08-20T14:37:51.241] device(sda) 'IO Request'=64, expect 256 host=192.168.56.13
WARN[2022-08-20T14:37:51.241] device(sr0) 'IO Request'=2, expect 256 host=192.168.56.13
INFO[2022-08-20T14:37:53.747] check port 26000 host=192.168.56.13
INFO[2022-08-20T14:37:53.747] check port 26000 host=192.168.56.11
INFO[2022-08-20T14:37:53.747] check port 26000 host=192.168.56.12
INFO[2022-08-20T14:37:53.777] port 26000 is free host=192.168.56.11
INFO[2022-08-20T14:37:53.845] port 26000 is free host=192.168.56.13
INFO[2022-08-20T14:37:53.856] port 26000 is free host=192.168.56.12
=============================
global:
cluster_name: mogdb
user: omm
group: omm
app_dir: /opt/mogdb/app
data_dir: /opt/mogdb/data
log_dir: /opt/mogdb/log
tool_dir: /opt/mogdb/tool
tmp_dir: /opt/mogdb/tmp
cm_server_port: 15300
db_servers:
- host: 192.168.56.11
db_port: 26000
role: primary
az_name: AZ1
az_priority: 1
- host: 192.168.56.12
db_port: 26000
role: standby
az_name: AZ1
az_priority: 1
- host: 192.168.56.13
db_port: 26000
role: standby
az_name: AZ1
az_priority: 1
=============================
Is cluster topo correct?[Y|Yes](default=N) y
INFO[2022-08-20T14:38:09.949] use cache /root/.ptk/cache/MogDB-3.0.1-openEuler-x86_64.tar.gz
INFO[2022-08-20T14:38:10.827] validation: installation package is safe
INFO[2022-08-20T14:38:10.827] parse version.cfg from MogDB-3.0.1-openEuler-64bit.tar.gz
INFO[2022-08-20T14:38:12.476] detected db version: MogDB-3.0.1, number: 92.605, commit_id: 1a363ea9
INFO[2022-08-20T14:38:12.479] [stage=precheck]: start host=192.168.56.13
INFO[2022-08-20T14:38:12.479] check user 'omm' host=192.168.56.13
INFO[2022-08-20T14:38:12.479] [stage=precheck]: start host=192.168.56.11
INFO[2022-08-20T14:38:12.479] check user 'omm' host=192.168.56.11
INFO[2022-08-20T14:38:12.479] [stage=precheck]: start host=192.168.56.12
INFO[2022-08-20T14:38:12.479] check user 'omm' host=192.168.56.12
INFO[2022-08-20T14:38:12.483] [stage=precheck]: successful host=192.168.56.11
INFO[2022-08-20T14:38:12.528] [stage=precheck]: successful host=192.168.56.13
INFO[2022-08-20T14:38:12.531] [stage=precheck]: successful host=192.168.56.12
INFO[2022-08-20T14:38:12.531] scp file from /root/.ptk/cache/MogDB-3.0.1-openEuler-x86_64.tar.gz to 192.168.56.12:/tmp/MogDB-3.0.1-openEuler-x86_64.tar.gz host=192.168.56.12
INFO[2022-08-20T14:38:12.531] scp file from /root/.ptk/cache/MogDB-3.0.1-openEuler-x86_64.tar.gz to 192.168.56.13:/tmp/MogDB-3.0.1-openEuler-x86_64.tar.gz host=192.168.56.13
INFO[2022-08-20T14:38:12.531] scp file from /root/.ptk/cache/MogDB-3.0.1-openEuler-x86_64.tar.gz to 192.168.56.11:/tmp/MogDB-3.0.1-openEuler-x86_64.tar.gz host=192.168.56.11
> upload MogDB-3.0.1-openEule...: 134.31 MiB / 134.31 MiB [-------------] 100.00% 77.08 MiB p/s 1.9s
> upload MogDB-3.0.1-openEule...: 134.31 MiB / 134.31 MiB [-------------] 100.00% 77.08 MiB p/s 1.9s
INFO[2022-08-20T14:38:14.503] [stage=initial]: start host=192.168.56.13
INFO[2022-08-20T14:38:14.503] [stage=initial]: start host=192.168.56.11
INFO[2022-08-20T14:38:14.503] [stage=initial]: start host=192.168.56.12
INFO[2022-08-20T14:38:14.506] create os user omm, group omm host=192.168.56.11
INFO[2022-08-20T14:38:14.533] set ulimits host=192.168.56.11
INFO[2022-08-20T14:38:14.535] set user omm profiles host=192.168.56.11
INFO[2022-08-20T14:38:14.556] create os user omm, group omm host=192.168.56.13
INFO[2022-08-20T14:38:14.558] create os user omm, group omm host=192.168.56.12
INFO[2022-08-20T14:38:14.577] add c library /usr/local/lib to /etc/ld.so.conf.d/libc.conf host=192.168.56.11
INFO[2022-08-20T14:38:14.580] mkdir /opt/mogdb/tool host=192.168.56.11
INFO[2022-08-20T14:38:14.629] decompress MogDB-3.0.1-openEuler-x86_64.tar.gz to dir /opt/mogdb/tool host=192.168.56.11
INFO[2022-08-20T14:38:14.630] set ulimits host=192.168.56.13
INFO[2022-08-20T14:38:14.631] set ulimits host=192.168.56.12
INFO[2022-08-20T14:38:14.679] set user omm profiles host=192.168.56.13
INFO[2022-08-20T14:38:14.680] set user omm profiles host=192.168.56.12
INFO[2022-08-20T14:38:14.791] add c library /usr/local/lib to /etc/ld.so.conf.d/libc.conf host=192.168.56.13
INFO[2022-08-20T14:38:14.793] add c library /usr/local/lib to /etc/ld.so.conf.d/libc.conf host=192.168.56.12
INFO[2022-08-20T14:38:14.839] mkdir /opt/mogdb/tool host=192.168.56.13
INFO[2022-08-20T14:38:14.843] mkdir /opt/mogdb/tool host=192.168.56.12
INFO[2022-08-20T14:38:15.025] decompress MogDB-3.0.1-openEuler-x86_64.tar.gz to dir /opt/mogdb/tool host=192.168.56.13
INFO[2022-08-20T14:38:15.041] decompress MogDB-3.0.1-openEuler-x86_64.tar.gz to dir /opt/mogdb/tool host=192.168.56.12
INFO[2022-08-20T14:38:15.329] remove files /tmp/MogDB-3.0.1-openEuler-x86_64.tar.gz host=192.168.56.11
INFO[2022-08-20T14:38:15.337] decompress *-om.tar.gz to dir /opt/mogdb/tool host=192.168.56.11
INFO[2022-08-20T14:38:15.590] fix psutil lib host=192.168.56.11
INFO[2022-08-20T14:38:15.599] change /opt/mogdb/tool owner to omm host=192.168.56.11
INFO[2022-08-20T14:38:15.604] mkdir /opt/mogdb/app host=192.168.56.11
INFO[2022-08-20T14:38:15.684] decompress MogDB-3.0.1-openEuler-64bit.tar.gz to dir /opt/mogdb/app host=192.168.56.11
INFO[2022-08-20T14:38:15.802] remove files /tmp/MogDB-3.0.1-openEuler-x86_64.tar.gz host=192.168.56.13
INFO[2022-08-20T14:38:15.829] remove files /tmp/MogDB-3.0.1-openEuler-x86_64.tar.gz host=192.168.56.12
INFO[2022-08-20T14:38:15.855] decompress *-om.tar.gz to dir /opt/mogdb/tool host=192.168.56.13
INFO[2022-08-20T14:38:15.884] decompress *-om.tar.gz to dir /opt/mogdb/tool host=192.168.56.12
INFO[2022-08-20T14:38:16.146] fix psutil lib host=192.168.56.13
INFO[2022-08-20T14:38:16.179] fix psutil lib host=192.168.56.12
INFO[2022-08-20T14:38:16.300] change /opt/mogdb/tool owner to omm host=192.168.56.13
INFO[2022-08-20T14:38:16.339] change /opt/mogdb/tool owner to omm host=192.168.56.12
INFO[2022-08-20T14:38:16.351] mkdir /opt/mogdb/app host=192.168.56.13
INFO[2022-08-20T14:38:16.395] mkdir /opt/mogdb/app host=192.168.56.12
INFO[2022-08-20T14:38:16.567] decompress MogDB-3.0.1-openEuler-64bit.tar.gz to dir /opt/mogdb/app host=192.168.56.13
INFO[2022-08-20T14:38:16.617] decompress MogDB-3.0.1-openEuler-64bit.tar.gz to dir /opt/mogdb/app host=192.168.56.12
INFO[2022-08-20T14:38:17.434] fix dynamic library for gs_initdb host=192.168.56.11
INFO[2022-08-20T14:38:17.476] fix dynamic library for mogdb host=192.168.56.11
INFO[2022-08-20T14:38:17.521] change /opt/mogdb/app owner to omm host=192.168.56.11
INFO[2022-08-20T14:38:17.527] mkdir /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,/opt/mogdb/log/pg_log/dn_6002,/opt/mogdb/log/pg_audit/dn_6002,/opt/mogdb/log/pg_log/dn_6003,/opt/mogdb/log/pg_audit/dn_6003 host=192.168.56.11
INFO[2022-08-20T14:38:18.435] fix dynamic library for gs_initdb host=192.168.56.13
INFO[2022-08-20T14:38:18.468] fix dynamic library for gs_initdb host=192.168.56.12
INFO[2022-08-20T14:38:18.579] fix dynamic library for mogdb host=192.168.56.13
INFO[2022-08-20T14:38:18.612] fix dynamic library for mogdb host=192.168.56.12
INFO[2022-08-20T14:38:18.722] change /opt/mogdb/app owner to omm host=192.168.56.13
INFO[2022-08-20T14:38:18.754] change /opt/mogdb/app owner to omm host=192.168.56.12
INFO[2022-08-20T14:38:18.776] mkdir /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,/opt/mogdb/log/pg_log/dn_6002,/opt/mogdb/log/pg_audit/dn_6002,/opt/mogdb/log/pg_log/dn_6003,/opt/mogdb/log/pg_audit/dn_6003 host=192.168.56.13
INFO[2022-08-20T14:38:18.807] mkdir /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,/opt/mogdb/log/pg_log/dn_6002,/opt/mogdb/log/pg_audit/dn_6002,/opt/mogdb/log/pg_log/dn_6003,/opt/mogdb/log/pg_audit/dn_6003 host=192.168.56.12
INFO[2022-08-20T14:38:18.899] mkdir /opt/mogdb/tmp host=192.168.56.11
INFO[2022-08-20T14:38:18.985] save version to /opt/mogdb/app/bin/upgrade_version host=192.168.56.11
INFO[2022-08-20T14:38:19.028] create cluster_manual_start file host=192.168.56.11
INFO[2022-08-20T14:38:19.068] generate static config to /opt/mogdb/app/bin/cluster_static_config host=192.168.56.11
INFO[2022-08-20T14:38:19.074] change /opt/mogdb/app/bin/cluster_static_config owner to omm host=192.168.56.11
INFO[2022-08-20T14:38:19.076] mkdir /opt/mogdb/data host=192.168.56.11
INFO[2022-08-20T14:38:19.160] change /opt/mogdb/data owner to omm host=192.168.56.11
INFO[2022-08-20T14:38:19.162] initial database host=192.168.56.11
INFO[2022-08-20T14:38:22.416] mkdir /opt/mogdb/tmp host=192.168.56.13
INFO[2022-08-20T14:38:22.486] mkdir /opt/mogdb/tmp host=192.168.56.12
INFO[2022-08-20T14:38:22.638] save version to /opt/mogdb/app/bin/upgrade_version host=192.168.56.13
INFO[2022-08-20T14:38:22.708] save version to /opt/mogdb/app/bin/upgrade_version host=192.168.56.12
INFO[2022-08-20T14:38:22.752] create cluster_manual_start file host=192.168.56.13
INFO[2022-08-20T14:38:22.822] create cluster_manual_start file host=192.168.56.12
INFO[2022-08-20T14:38:22.840] generate static config to /opt/mogdb/app/bin/cluster_static_config host=192.168.56.13
INFO[2022-08-20T14:38:22.906] generate static config to /opt/mogdb/app/bin/cluster_static_config host=192.168.56.12
⣾ executing...INFO[2022-08-20T14:38:22.916] change /opt/mogdb/app/bin/cluster_static_config owner to omm host=192.168.56.13
INFO[2022-08-20T14:38:22.963] mkdir /opt/mogdb/data host=192.168.56.13
⣾ executing...INFO[2022-08-20T14:38:22.989] change /opt/mogdb/app/bin/cluster_static_config owner to omm host=192.168.56.12
INFO[2022-08-20T14:38:23.037] mkdir /opt/mogdb/data host=192.168.56.12
INFO[2022-08-20T14:38:23.178] change /opt/mogdb/data owner to omm host=192.168.56.13
INFO[2022-08-20T14:38:23.229] initial database host=192.168.56.13
INFO[2022-08-20T14:38:23.262] change /opt/mogdb/data owner to omm host=192.168.56.12
INFO[2022-08-20T14:38:23.311] initial database host=192.168.56.12
INFO[2022-08-20T14:38:28.780] set 192.168.56.11 postgresql.conf host=192.168.56.11
INFO[2022-08-20T14:38:28.844] set 192.168.56.11 hba config host=192.168.56.11
INFO[2022-08-20T14:38:28.892] mkdir /opt/mogdb/log/cm/om_monitor,/opt/mogdb/cm,/opt/mogdb/cm/cm_server,/opt/mogdb/cm/cm_agent host=192.168.56.11
INFO[2022-08-20T14:38:29.357] decompress *-cm.tar.gz to dir /opt/mogdb/app host=192.168.56.11
INFO[2022-08-20T14:38:29.452] change /opt/mogdb/app owner to omm host=192.168.56.11
INFO[2022-08-20T14:38:29.458] copy /opt/mogdb/app/share/config/cm_server.conf.sample to /opt/mogdb/cm/cm_server/cm_server.conf host=192.168.56.11
INFO[2022-08-20T14:38:29.501] copy /opt/mogdb/app/share/config/cm_agent.conf.sample to /opt/mogdb/cm/cm_agent/cm_agent.conf host=192.168.56.11
INFO[2022-08-20T14:38:29.539] update config file /opt/mogdb/cm/cm_agent/cm_agent.conf: set unix_socket_directory to '/opt/mogdb/tmp' host=192.168.56.11
INFO[2022-08-20T14:38:29.543] add user omm to cron.allow host=192.168.56.11
INFO[2022-08-20T14:38:29.547] set corntab: */1 * * * * [ -f ~/.profile ] && source ~/.profile; [ -f ~/.bashrc ] && source ~/.bashrc; source ~/.ptk_mogdb_env; nohup /opt/mogdb/app/bin/om_monitor -L /opt/mogdb/log/cm/om_monitor >/dev/null 2>&1 & host=192.168.56.11
INFO[2022-08-20T14:38:29.594] create CA files host=192.168.56.11
INFO[2022-08-20T14:38:29.945] move CA files to server host=192.168.56.11
INFO[2022-08-20T14:38:29.950] download ca files from host 192.168.56.11 host=192.168.56.11
INFO[2022-08-20T14:38:29.987] [stage=initial]: successful host=192.168.56.11
INFO[2022-08-20T14:38:32.307] set 192.168.56.13 postgresql.conf host=192.168.56.13
INFO[2022-08-20T14:38:32.391] set 192.168.56.12 postgresql.conf host=192.168.56.12
INFO[2022-08-20T14:38:32.406] set 192.168.56.13 hba config host=192.168.56.13
INFO[2022-08-20T14:38:32.499] mkdir /opt/mogdb/log/cm/om_monitor,/opt/mogdb/cm,/opt/mogdb/cm/cm_server,/opt/mogdb/cm/cm_agent host=192.168.56.13
INFO[2022-08-20T14:38:32.504] set 192.168.56.12 hba config host=192.168.56.12
INFO[2022-08-20T14:38:32.596] mkdir /opt/mogdb/log/cm/om_monitor,/opt/mogdb/cm,/opt/mogdb/cm/cm_server,/opt/mogdb/cm/cm_agent host=192.168.56.12
INFO[2022-08-20T14:38:33.641] decompress *-cm.tar.gz to dir /opt/mogdb/app host=192.168.56.13
INFO[2022-08-20T14:38:33.767] decompress *-cm.tar.gz to dir /opt/mogdb/app host=192.168.56.12
INFO[2022-08-20T14:38:33.779] change /opt/mogdb/app owner to omm host=192.168.56.13
INFO[2022-08-20T14:38:33.832] copy /opt/mogdb/app/share/config/cm_server.conf.sample to /opt/mogdb/cm/cm_server/cm_server.conf host=192.168.56.13
INFO[2022-08-20T14:38:33.905] change /opt/mogdb/app owner to omm host=192.168.56.12
INFO[2022-08-20T14:38:33.911] copy /opt/mogdb/app/share/config/cm_agent.conf.sample to /opt/mogdb/cm/cm_agent/cm_agent.conf host=192.168.56.13
INFO[2022-08-20T14:38:33.960] copy /opt/mogdb/app/share/config/cm_server.conf.sample to /opt/mogdb/cm/cm_server/cm_server.conf host=192.168.56.12
INFO[2022-08-20T14:38:33.991] update config file /opt/mogdb/cm/cm_agent/cm_agent.conf: set unix_socket_directory to '/opt/mogdb/tmp' host=192.168.56.13
INFO[2022-08-20T14:38:34.040] add user omm to cron.allow host=192.168.56.13
INFO[2022-08-20T14:38:34.046] copy /opt/mogdb/app/share/config/cm_agent.conf.sample to /opt/mogdb/cm/cm_agent/cm_agent.conf host=192.168.56.12
INFO[2022-08-20T14:38:34.089] set corntab: */1 * * * * [ -f ~/.profile ] && source ~/.profile; [ -f ~/.bashrc ] && source ~/.bashrc; source ~/.ptk_mogdb_env; nohup /opt/mogdb/app/bin/om_monitor -L /opt/mogdb/log/cm/om_monitor >/dev/null 2>&1 & host=192.168.56.13
INFO[2022-08-20T14:38:34.128] update config file /opt/mogdb/cm/cm_agent/cm_agent.conf: set unix_socket_directory to '/opt/mogdb/tmp' host=192.168.56.12
INFO[2022-08-20T14:38:34.177] add user omm to cron.allow host=192.168.56.12
INFO[2022-08-20T14:38:34.181] waitting for generate CA files... host=192.168.56.13
INFO[2022-08-20T14:38:34.181] upload CA files host=192.168.56.13
INFO[2022-08-20T14:38:34.230] set corntab: */1 * * * * [ -f ~/.profile ] && source ~/.profile; [ -f ~/.bashrc ] && source ~/.bashrc; source ~/.ptk_mogdb_env; nohup /opt/mogdb/app/bin/om_monitor -L /opt/mogdb/log/cm/om_monitor >/dev/null 2>&1 & host=192.168.56.12
INFO[2022-08-20T14:38:34.324] waitting for generate CA files... host=192.168.56.12
INFO[2022-08-20T14:38:34.324] upload CA files host=192.168.56.12
INFO[2022-08-20T14:38:34.637] move CA files to server host=192.168.56.13
INFO[2022-08-20T14:38:34.686] [stage=initial]: successful host=192.168.56.13
INFO[2022-08-20T14:38:34.773] move CA files to server host=192.168.56.12
INFO[2022-08-20T14:38:34.820] [stage=initial]: successful host=192.168.56.12
INFO[2022-08-20T14:38:34.820] start make ssh mutual trust for omm
INFO[2022-08-20T14:38:35.148] make ssh mutual trust successfully
INFO[2022-08-20T14:38:35.148] [stage=launch]: start host=192.168.56.13
INFO[2022-08-20T14:38:35.148] start om_monitor host=192.168.56.13
⣾ executing...INFO[2022-08-20T14:38:35.148] [stage=launch]: start host=192.168.56.12
INFO[2022-08-20T14:38:35.148] start om_monitor host=192.168.56.12
INFO[2022-08-20T14:38:35.148] [stage=launch]: start host=192.168.56.11
INFO[2022-08-20T14:38:35.148] start om_monitor host=192.168.56.11
INFO[2022-08-20T14:38:35.186] start 192.168.56.11 database by cm_ctl host=192.168.56.11
INFO[2022-08-20T14:38:35.236] waitting for primary startup... host=192.168.56.13
INFO[2022-08-20T14:38:35.237] waitting for primary startup... host=192.168.56.12
INFO[2022-08-20T14:39:18.144] [stage=launch]: successful host=192.168.56.11
INFO[2022-08-20T14:39:18.144] [stage=launch]: successful host=192.168.56.13
INFO[2022-08-20T14:39:18.145] [stage=launch]: successful host=192.168.56.12
INFO[2022-08-20T14:39:18.145] Time elapsed: 1m31s
cluste_name | host | user | port | stage | status | message
--------------+---------------+------+-------+--------+---------------+----------
mogdb | 192.168.56.11 | omm | 26000 | launch | start_success | success
| 192.168.56.13 | omm | 26000 | launch | start_success | success
| 192.168.56.12 | omm | 26000 | launch | start_success | success
安装成功。
用PTK查看集群状态
[root@node1 ~]# ptk cluster status -f config.yaml
[ Cluster State ]
database_version : MogDB-3.0.1
cluster_name : mogdb
cluster_state : Normal
current_az : AZ_ALL
[ Datanode State ]
id | ip | port | user | instance | db_role | state
-------+---------------+-------+------+----------+---------+---------
6001 | 192.168.56.11 | 26000 | omm | dn_6001 | primary | Normal
6002 | 192.168.56.12 | 26000 | omm | dn_6002 | standby | Normal
6003 | 192.168.56.13 | 26000 | omm | dn_6003 | standby | Normal
改用习惯的openGauss工具查看集群状态
su - omm
[omm@node1 ~]$ gs_om -t status --detail
[ CMServer State ]
node node_ip instance state
-------------------------------------------------------------
1 node1 192.168.56.11 1 /opt/mogdb/cm/cm_server Primary
2 node2 192.168.56.12 2 /opt/mogdb/cm/cm_server Standby
3 node3 192.168.56.13 3 /opt/mogdb/cm/cm_server Standby
此处CM server显示已与datanode格式一致,比openGauss显示在一行美观。
[ Cluster State ]
cluster_state : Normal
redistributing : No
balanced : Yes
current_az : AZ_ALL
[ Datanode State ]
node node_ip instance state
---------------------------------------------------------------
1 node1 192.168.56.11 6001 /opt/mogdb/data P Primary Normal
2 node2 192.168.56.12 6002 /opt/mogdb/data S Standby Normal
3 node3 192.168.56.13 6003 /opt/mogdb/data S Standby Normal
openGauss3.0的datanode是这样子的
[ Datanode State ]
node instance state | node instance state | node instance state
---------------------------------------------------------------------------------------------------------------
1 node1 6001 P Primary Normal | 2 node2 6002 S Standby Normal | 3 node3 6003 S Standby Normal
还是mogdb 好看
登录数据库
[omm@node1 ~]$ gsql
gsql ((MogDB 3.0.1 build 1a363ea9) compiled at 2022-08-05 17:31:04 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
MogDB-# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+-------+----------+---------+-------+-------------------
postgres | omm | UTF8 | C | C |
template0 | omm | UTF8 | C | C | =c/omm +
| | | | | omm=CTc/omm
template1 | omm | UTF8 | C | C | =c/omm +
| | | | | omm=CTc/omm
(3 rows)
ptk工具简化了安装过程,配置文件用yaml格式相比xml更简洁,与oceanbase、tidb一样能快速上手,降低了入门难度。
希望云和恩墨提供PTK类tiup一键单机多实例功能,对资源不足的同学学习集群带来方便。
最后修改时间:2022-12-21 06:08:15
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。