HAC集群修改为单机
生活随笔
收集整理的這篇文章主要介紹了
HAC集群修改为单机
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
瀚高數據庫
目錄
環境
文檔用途
詳細信息
環境
系統平臺: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/160000002、不作為單機節點的集群其他各個節點停止、禁用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.service4、修改為單機節點的數據庫檢查數據庫服務是否開機自啟動,并啟動數據庫
[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.service6、其他
執行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總結
以上是生活随笔為你收集整理的HAC集群修改为单机的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: #记录 配对交易学习
- 下一篇: 数学图形之莫比乌斯带(mobius)