首页 > 数据库 > 国内数据库 > HAC集群添加新节点
[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 |+----------+---------------------+---------+---------+----+-----------+
ps -ef | grep sender root 26418 3233 0 6月11 ? 00:00:22 postgres: c: walsender sysdba 192.168.80.228(45186) streaming 0/16000000ps -ef | grep receiver root 3372 3348 0 6月11 ? 00:13:54 postgres: c: walreceiver streaming 0/16000000
rpm -ivh hgdb4.5.7-see-centos7-x86-64-20220307.rpm rpm -ivh hghac4.0.1-centos7-x86-64-20210604.rpm
vim ~/.bash_profile source ~/.bash_profile
scp /opt/HighGo/tools/hghac root@192.168.80.228:/opt/HighGo/tools/hghac/hghac-see.yaml
vim /opt/HighGo/tools/hghac/hghac-see.yaml connect_address: 192.168.80.228:8008 #将ip修改为本机ip,例:192.168.80.230:8008 name: hghac228 #修改为hghac+本机ip最后一位,例:hghac230 connect_address: 192.168.80.228:5866 #将ip修改为本机ip,例:192.168.80.230:5866 data_dir: /hgdata/highgo/data #查看/hgdata/highgo目录是否存在, #不存在mkdir -p /hgdata/highgo创建,/hgdata目录应该是挂载的磁盘目录 dir: /hgdata/hghalog #查看该目录是否存在,不存在mkdir -p /hgdata/hghalog 创建
[root@hgdw231 hgupload]# systemctl enable hghac.service Created symlink from /etc/systemd/system/multi-user.target.wants/hghac.service to /etc/systemd/system/hghac.service.[root@hgdw231 hgupload]# systemctl start hghac.service[root@hgdw231 hgupload]# systemctl disable hgdb-see-4.5.7.service Removed symlink /etc/systemd/system/multi-user.target.wants/hgdb-see-4.5.7.service.Removed symlink /etc/systemd/system/graphical.target.wants/hgdb-see-4.5.7.service.注意: 也有可能不是hghac.service,可能是hghac-vip.service 请使用systemctl status hghac.service/hghac-vip.service确定运行的服务
[root@localhost ~]# hghactl list
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= source ~/.bash_profile 注意:1、需要根据实际情况修改环境变量实际路径,可以使用find命令查找文件路径 例:查找hghac find / -iname hghac -print2、ETCDCTL_ENDPOINTS三个ip需要修改为配置etcd三节点的ip,可以参考/opt/HighGo/tools/hghac/hgha
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69994931/viewspace-2905693/ ,如需转载,请注明出处,否则将追究法律责任。