一主一备节点安装
操作步骤
- 创建用户组dbgroup。
1. groupadd dbgroup
2. 创建用户组dbgroup下的普通用户omm,并设置密码为Gauss_234 。
1. useradd -g dbgroup omm
2. passwd Gauss_234
3. 使用omm登录到包安装的主机,解压openGauss压缩包到安装目录(假定安装目录为/opt/software/openGauss,请用实际值替换)。
1. tar -jxf openGauss-x.x.x-openEuler-64bit.tar.bz2 -C /opt/software/openGauss
4. 假定解压包的路径为/opt/software/openGauss,进入解压后目录下的simpleInstall。
1. cd /opt/software/openGauss/simpleInstall
5. 执行install.sh脚本安装openGauss。
1. sh install.sh -w xxxx --multinode
上述命令中,-w是指初始化数据库密码(gs_initdb指定),安全需要必须设置。 6. 安装执行完成后,使用ps和gs_ctl查看进程是否正常。
1. ps ux | grep gaussdb
2. gs_ctl query -D /opt/software/openGauss/data/master
执行ps命令,显示类似如下信息:
``` 1. omm 4879 11.8 1.1 2082452 373832 pts/0 Sl 14:26 8:29 /opt/software/openGauss/bin/gaussdb -D /opt/software/openGauss/data/master -M primary
-
omm 5083 1.1 0.9 1819988 327200 pts/0 Sl 14:26 0:49 /opt/software/openGauss/bin/gaussdb -D /opt/software/openGauss/data/slave -M standby
-
omm 20377 0.0 0.0 119880 1216 pts/0 S+ 15:37 0:00 grep --color=auto gaussdb ```
执行gs_ctl命令,显示类似如下信息:
``` 1. gs_ctl query ,datadir is /opt/software/openGauss/data/master 2. HA state: 3. local_role : Primary 4. static_connections : 1 5. db_state : Normal 6. detail_information : Normal
- Senders info:
- sender_pid : 5165
- local_role : Primary
- peer_role : Standby
- peer_state : Normal
- state : Streaming
- sender_sent_location : 0/4005148
- sender_write_location : 0/4005148
- sender_flush_location : 0/4005148
- sender_replay_location : 0/4005148
- receiver_received_location : 0/4005148
- receiver_write_location : 0/4005148
- receiver_flush_location : 0/4005148
- receiver_replay_location : 0/4005148
- sync_percent : 100%
- sync_state : Sync
- sync_priority : 1
- sync_most_available : Off
-
channel : 10.244.44.52:27001-->10.244.44.52:35912
-
Receiver info:
- No information ```
