HAC叢集中,計劃重新初始化資料庫使用原叢集配置的操作方法
[root@db data]# systemctl stop hghac-vip[root@db data]# initdb -e sm4 -c "echo *******" -D /db/hgdbdata/data
[root@db data]# /opt/HighGo/tools/hghac/hghactl -c /opt/HighGo/tools/hghac/hghac.yaml list+ Cluster: ha (7072987311974756506) +-----------+| Member | Host | Role | State | TL | Lag in MB |+--------+------+------+-------+----+-----------++--------+------+------+-------+----+-----------+[root@db data]# systemctl status hghac-vip
Loaded: loaded (/etc/systemd/system/hghac-vip.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2022-03-18 12:16:07 CST; 3min 7s ago Process: 44961 ExecStart=/opt/HighGo/tools/hghac/hghac /opt/HighGo/tools/hghac/hghac.yaml (code=exited, status=1/FAILURE) Main PID: 44961 (code=exited, status=1/FAILURE)Mar 18 12:16:05 db systemd[1]: Started hghac.Mar 18 12:16:07 db systemd[1]: hghac-vip.service: main process exited, code=exited, status=1/FAILURE Mar 18 12:16:07 db systemd[1]: Unit hghac-vip.service entered failed state.Mar 18 12:16:07 db systemd[1]: hghac-vip.service failed.[root@db data]# systemctl start hghac-vip[root@db data]# systemctl status hghac-vip
Loaded: loaded (/etc/systemd/system/hghac-vip.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2022-03-18 12:19:26 CST; 2min 13s ago Process: 45581 ExecStart=/opt/HighGo/tools/hghac/hghac /opt/HighGo/tools/hghac/hghac.yaml (code=exited, status=1/FAILURE) Main PID: 45581 (code=exited, status=1/FAILURE)Mar 18 12:19:24 db systemd[1]: Started hghac.Mar 18 12:19:26 db systemd[1]: hghac-vip.service: main process exited, code=exited, status=1/FAILURE Mar 18 12:19:26 db systemd[1]: Unit hghac-vip.service entered failed state.Mar 18 12:19:26 db systemd[1]: hghac-vip.service failed.
[root@db hghalog]# pwd/db/hgdbdata/hghalog[root@db hghalog]# tail -f patroni.log 2022-03-18 12:16:06,807 INFO: Selected new etcd server http://192.168.80.111:23792022-03-18 12:16:06,828 INFO: No PostgreSQL configuration items changed, nothing to reload.2022-03-18 12:16:06,890 CRITICAL: system ID mismatch, node hghaca belongs to a different cluster: 7072987311974756506 != 70762866990207605662022-03-18 12:19:25,967 INFO: Selected new etcd server http://192.168.80.113:23792022-03-18 12:19:25,992 INFO: No PostgreSQL configuration items changed, nothing to reload.2022-03-18 12:19:26,063 CRITICAL: system ID mismatch, node hghaca belongs to a different cluster: 7072987311974756506 != 7076286699020760566
[root@db ~]# /opt/HighGo/tools/hghac/etcd/amd64/etcdctl endpoint status --write-out=table+----------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+| ENDPOINT | ID | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |+----------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+| http://192.168.80.111:2379 | ddbfd190d03ca278 | 3.4.15 | 20 kB | false | false | 218 | 1686066 | 1686066 | || http://192.168.80.112:2379 | 1c703f0b65f7bddb | 3.4.15 | 20 kB | false | false | 218 | 1686066 | 1686066 | || http://192.168.80.113:2379 | 92255e8f5c9ebfcd | 3.4.15 | 20 kB | true | false | 218 | 1686066 | 1686066 | |+----------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+[root@db ~]# systemctl start hghac-vip[root@db ~]# /opt/HighGo/tools/hghac/hghactl -c /opt/HighGo/tools/hghac/hghac.yaml list+ Cluster: ha (7072987311974756506) +-----------+| Member | Host | Role | State | TL | Lag in MB |+--------+------+------+-------+----+-----------++--------+------+------+-------+----+-----------+
[root@db etcd]# pwd/opt/HighGo/tools/etcd[root@db etcd]# ls hgdw1.etcd[root@db etcd]# pwd/opt/HighGo/tools/etcd[root@db etcd]# ls hgdw1.etcd[root@db etcd]# mv hgdw1.etcd hgdw1.etcd.bak <--所有節點都改名此目錄或刪除此目錄[root@db etcd]# systemctl stop etcd[root@db etcd]# systemctl start etcd[root@db etcd]# pwd/opt/HighGo/tools/etcd[root@db etcd]# ll total 0drwx------ 3 root root 20 Mar 18 12:34 hgdw1.etcd drwx------. 3 root root 20 Mar 18 12:27 hgdw1.etcd.bak <--重啟etcd會重新生成該目錄及其下的所有檔案,[root@db etcd]# /opt/HighGo/tools/hghac/etcd/amd64/etcdctl endpoint status --write-out=table+----------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+| ENDPOINT | ID | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |+----------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+| http://192.168.80.111:2379 | ddbfd190d03ca278 | 3.4.15 | 20 kB | true | false | 2 | 8 | 8 | || http://192.168.80.112:2379 | 1c703f0b65f7bddb | 3.4.15 | 20 kB | false | false | 2 | 8 | 8 | || http://192.168.80.113:2379 | 92255e8f5c9ebfcd | 3.4.15 | 20 kB | false | false | 2 | 8 | 8 | |+----------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+[root@db etcd]# [root@db etcd]# systemctl start hghac-vip <--此時啟動HAC,叢集資訊顯示正常[root@db etcd]# /opt/HighGo/tools/hghac/hghactl -c /opt/HighGo/tools/hghac/hghac.yaml list+ Cluster: ha (7076286699020760566) ----+---------+----+-----------+-----------------+| Member | Host | Role | State | TL | Lag in MB | Pending restart |+--------+---------------------+--------+---------+----+-----------+-----------------+| hghaca | 192.168.80.111:5866 | Leader | running | 2 | | * |+--------+---------------------+--------+---------+----+-----------+-----------------+[root@db etcd]#
[root@db etcd]# /opt/HighGo/tools/hghac/hghactl -c /opt/HighGo/tools/hghac/hghac.yaml list+ Cluster: ha (7076286699020760566) -----+---------+----+-----------+-----------------+| Member | Host | Role | State | TL | Lag in MB | Pending restart |+--------+---------------------+---------+---------+----+-----------+-----------------+| hghaca | 192.168.80.111:5866 | Leader | running | 2 | | * || hghacb | 192.168.80.112:5866 | Replica | running | 2 | 0 | * || hghacc | 192.168.80.113:5866 | Replica | running | 2 | 0 | * |+--------+---------------------+---------+---------+----+-----------+-----------------+
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69994931/viewspace-2886234/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 資料庫叢集資料庫
- MySQL資料庫叢集MySql資料庫
- CentOS下torque叢集配置(二)叢集中配置NFS實現檔案共享CentOSNFS
- Spring&Quartz使用資料庫叢集配置(MySQL/SQLServer/Oracle)Springquartz資料庫MySqlServerOracle
- 【資料庫】Redis叢集篇資料庫Redis
- RAC叢集資料庫搭建資料庫
- 核實 RAC 叢集/資料庫配置是否成功的方法資料庫
- 大資料Spark叢集模式配置大資料Spark模式
- Redis叢集 - cluster叢集、資料分片Redis
- 使用Ansible為叢集初始化並配置免密
- 時序資料庫的叢集方案?資料庫
- Moebius資料庫多活叢集資料庫
- redis偽叢集配置Cluster叢集模式Redis模式
- 【greenplum】greenplum叢集資料庫初始化輸出內容樣例資料庫
- 修改叢集資料庫的歸檔模式資料庫模式
- 使用青雲搭建大資料叢集大資料
- Elasticsearch 叢集規劃Elasticsearch
- [專業術語]資料庫叢集資料庫
- 叢集資料庫新增控制檔案資料庫
- 新增叢集資料庫服務service資料庫
- SequoiaDB資料庫之叢集管理資料庫
- redis資料庫叢集三種模式Redis資料庫模式
- 資料庫叢集技術漫談資料庫
- Kafka叢集配置Kafka
- mongo 叢集配置Go
- MySQL叢集配置MySql
- 通過memberlist庫實現gossip管理叢集以及叢集資料互動Go
- HAC叢集更改IP(單節點更改、全部節點更改)
- 4 管理資料庫例項和叢集資料庫資料庫
- 資料庫Mysql5.7 MGR叢集的搭建資料庫MySql
- 沃趣微講堂 | Oracle叢集技術(四):叢集初始化資源層Oracle
- 資料庫代理服務和叢集管理資料庫
- Redis資料型別, Redis主從哨兵和叢集(將資料匯入叢集) ubuntu使用Redis資料型別Ubuntu
- Docker Elasticsearch 叢集配置DockerElasticsearch
- MySQL叢集配置(轉)MySql
- 叢集資料庫重要檔案的檢視管理資料庫
- SequoiaDB資料庫之叢集模式的對比資料庫模式
- 崖山資料庫的共享叢集機制初探資料庫