目录
环境
文档用途
详细信息
环境
系统平台:Linux x86 Red Hat Enterprise Linux 6
版本:4.5.7
文档用途
本文档用于指导HAC集群修改为单机
详细信息
1、检查集群状态,使用A、B两种方法进行判断
方法A:使用集群命令,确保TL时间线一致,Lag in MB数据同步延迟不能过高,最好延迟为0。
[root@localhost ~]# hghactl list+ Cluster: ha (7072256965608815760) -------+---------+----+-----------+| Member | Host | Role | State | TL | Lag in MB |+----------+---------------------+---------+---------+----+-----------+| hghac228 | 192.168.80.228:5866 | Leader | running | 6 | || hghac230 | 192.168.80.230:5866 | Replica | running | 6 | 0 |+----------+---------------------+---------+---------+----+-----------+
(左右滑动查看完整内容)
方法B:各个节点查询进程,有sender节点的是主库,有receiver节点的是备库
ps -ef | grep senderroot 26418 3233 0 6月11 ? 00:00:22 postgres: c: walsender sysdba 192.168.80.228(45186) streaming 0/16000000ps -ef | grep receiverroot 3372 3348 0 6月11 ? 00:13:54 postgres: c: walreceiver streaming 0/16000000
(左右滑动查看完整内容)
2、不作为单机节点的集群其他各个节点停止、禁用hghac服务
[root@hgdw231 hgupload]# systemctl stop hghac.service[root@hgdw231 hgupload]# systemctl disable hghac.serviceRemoved symlink etc/systemd/system/multi-user.target.wants/hghac.service.注意:也有可能不是hghac.service,可能是hghac-vip.service 请使用systemctl status hghac.service/hghac-vip.service确定运行的服务
(左右滑动查看完整内容)
3、修改为单机节点的数据库停止、禁用hghac服务,并设置数据库服务开机自启动
[root@hgdw231 hgupload]# systemctl stop hghac.service[root@hgdw231 hgupload]# systemctl disable hghac.serviceRemoved symlink etc/systemd/system/multi-user.target.wants/hghac.service.[root@hgdw231 etc]# systemctl enable hgdb-see-4.5.7.service
(左右滑动查看完整内容)
4、修改为单机节点的数据库检查数据库服务是否开机自启动,并启动数据库
[root@hgdw231 etc]# systemctl status hgdb-see-4.5.7.service● hgdb-see-4.5.7.service - highgodb-4.5.7Loaded: loaded (/usr/lib/systemd/system/hgdb-see-4.5.7.service; enabled; vendor preset: disabled)Active: inactive (dead)[root@hgdw231 etc]# pg_ctl start等待服务器进程启动 ....2022-04-19 14:33:53 CST [21906]: [1-1] 625e57d1.5592 0 日志: data encryption performed by sm42022-04-19 14:33:53 CST [21906]: [2-1] 625e57d1.5592 0 日志: Password detection module is disabled2022-04-19 14:33:53 CST [21906]: [3-1] 625e57d1.5592 0 日志: 正在启动 HighGo Security Enterprise Edition Database System 4.5.7 on CentOS7 x86_64,build on 202203022022-04-19 14:33:53 CST [21906]: [4-1] 625e57d1.5592 0 日志: 正在监听IPv4地址"0.0.0.0",端口 58662022-04-19 14:33:53 CST [21906]: [5-1] 625e57d1.5592 0 日志: 正在监听IPv6地址"::",端口 58662022-04-19 14:33:53 CST [21906]: [6-1] 625e57d1.5592 0 日志: 在Unix套接字 "/tmp/.s.PGSQL.5866"上侦听2022-04-19 14:33:53 CST [21906]: [7-1] 625e57d1.5592 0 日志: 日志输出重定向到日志收集进程2022-04-19 14:33:53 CST [21906]: [8-1] 625e57d1.5592 0 提示: 后续的日志输出将出现在目录 "hgdb_log"中.完成服务器进程已经启动
(左右滑动查看完整内容)
5、所有节点停掉并禁用etcd服务
systemctl stop etcd.servicesystemctl disable etcd.service
6、其他
执行hghactl等集群命令提示“未找到命令”,请配置环境变量,参考如下:
vim ~/.bash_profileexport PGPORT=5866export PGUSER=sysdbaexport PGDATABASE=highgoexport PGHOME=/opt/HighGo4.5.7-seeexport PGDATA=/opt/HighGo4.5.7-see/dataexport PATH=$PGHOME/bin:$PATH:$HOME/bin:/opt/HighGo/tools/hghac:/opt/HighGo/tools/hghac/etcdexport LD_LIBRARY_PATH=$PGHOME/lib:/usr/lib64:$LD_LIBRARY_PATHexport ETCDCTL_ENDPOINTS=http://10.1.194.182:2379,http://10.1.194.191:2379,http://10.1.194.192:2379export PATRONICTL_CONFIG_FILE=/opt/HighGo/tools/hghac/hghac-see.yamlsource ~/.bash_profile注意:1、需要根据实际情况修改环境变量实际路径,可以使用find命令查找文件路径例:查找hghac find / -iname hghac -print2、ETCDCTL_ENDPOINTS三个ip需要修改为配置etcd三节点的ip,可以参考/opt/HighGo/tools/hghac/hghac-see.yaml文件中的etcd:hosts
(左右滑动查看完整内容)

文章转载自瀚高PG实验室,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




