HAC集群修改为单机
瀚高數(shù)據(jù)庫(kù)
目錄
環(huán)境
文檔用途
詳細(xì)信息
環(huán)境
系統(tǒng)平臺(tái):Linux x86 Red Hat Enterprise Linux 6
版本:4.5.7
文檔用途
本文檔用于指導(dǎo)HAC集群修改為單機(jī)
詳細(xì)信息
1、檢查集群狀態(tài),使用A、B兩種方法進(jìn)行判斷
方法A:使用集群命令,確保TL時(shí)間線一致,Lag in MB數(shù)據(jù)同步延遲不能過(guò)高,最好延遲為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:各個(gè)節(jié)點(diǎn)查詢進(jìn)程,有sender節(jié)點(diǎn)的是主庫(kù),有receiver節(jié)點(diǎn)的是備庫(kù)
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、不作為單機(jī)節(jié)點(diǎn)的集群其他各個(gè)節(jié)點(diǎn)停止、禁用hghac服務(wù)
[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 請(qǐng)使用systemctl status hghac.service/hghac-vip.service確定運(yùn)行的服務(wù)3、修改為單機(jī)節(jié)點(diǎn)的數(shù)據(jù)庫(kù)停止、禁用hghac服務(wù),并設(shè)置數(shù)據(jù)庫(kù)服務(wù)開(kāi)機(jī)自啟動(dòng)
[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、修改為單機(jī)節(jié)點(diǎn)的數(shù)據(jù)庫(kù)檢查數(shù)據(jù)庫(kù)服務(wù)是否開(kāi)機(jī)自啟動(dòng),并啟動(dòng)數(shù)據(jù)庫(kù)
[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等待服務(wù)器進(jìn)程啟動(dòng) ....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 日志: 正在啟動(dòng) 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 日志: 正在監(jiān)聽(tīng)I(yíng)Pv4地址"0.0.0.0",端口 58662022-04-19 14:33:53 CST [21906]: [5-1] 625e57d1.5592 0 日志: 正在監(jiān)聽(tīng)I(yíng)Pv6地址"::",端口 58662022-04-19 14:33:53 CST [21906]: [6-1] 625e57d1.5592 0 日志: 在Unix套接字 "/tmp/.s.PGSQL.5866"上偵聽(tīng)2022-04-19 14:33:53 CST [21906]: [7-1] 625e57d1.5592 0 日志: 日志輸出重定向到日志收集進(jìn)程2022-04-19 14:33:53 CST [21906]: [8-1] 625e57d1.5592 0 提示: 后續(xù)的日志輸出將出現(xiàn)在目錄 "hgdb_log"中.完成服務(wù)器進(jìn)程已經(jīng)啟動(dòng)5、所有節(jié)點(diǎn)停掉并禁用etcd服務(wù)
systemctl stop etcd.servicesystemctl disable etcd.service6、其他
執(zhí)行hghactl等集群命令提示“未找到命令”,請(qǐng)配置環(huán)境變量,參考如下:
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、需要根據(jù)實(shí)際情況修改環(huán)境變量實(shí)際路徑,可以使用find命令查找文件路徑例:查找hghac find / -iname hghac -print2、ETCDCTL_ENDPOINTS三個(gè)ip需要修改為配置etcd三節(jié)點(diǎn)的ip,可以參考/opt/HighGo/tools/hghac/hghac-see.yaml文件中的etcd:hosts總結(jié)
以上是生活随笔為你收集整理的HAC集群修改为单机的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: #记录 配对交易学习
- 下一篇: 数学图形之莫比乌斯带(mobius)