|PolarDB-O主备高可用部署及切换排雷指引( 九 )


''sync_status'': ''SYNC''
},
''standby'': [
{
''endpoint'': ''192.168.238.131:5432'',
''data_path'': ''/opt/polardb/data'',
''user'': ''polardb'',
''phase'': ''RUNNING'',
''start_at'': ''2020-11-03 13:58:21'',
''sync_status'': ''SYNC''
}
],
''vip'': [
{
''vip'': ''192.168.238.133'',
''interface'': ''ens33'',
''mask'': ''255.255.255.0'',
''endpoint'': ''192.168.238.130:5432''
}
]
}
验证vip自动切换 , vip自动切换到130上了:
ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.238.130 netmask 255.255.255.0 broadcast 192.168.238.255
inet6 fe80::9398:2419:9c94:b1b3 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:80:49:a0 txqueuelen 1000 (Ethernet)
RX packets 390201 bytes 106430712 (101.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2307269 bytes 5939759826 (5.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens33:5432: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.238.133 netmask 255.255.255.0 broadcast 192.168.238.255
ether 00:0c:29:80:49:a0 txqueuelen 1000 (Ethernet)
[polardb@dbnode1 polardb]$ psql -h 192.168.238.133 -p 5432 -Ureplicator -dpolardb -c ''select pg_is_in_recovery'';
Password for user replicator:
pg_is_in_recovery
-------------------
f
(1 row)
若显示此结果 , 表示vip切换成功 。
总结
PolarDB的安装包括集群部署相对还是比较便捷 , 在安装中暴露的一些问题一部分和初步上手不熟悉有关 , 也有一部分因素是目前PolarDB的相关工具文档资料都相对较少 , 大家也都是摸着石头过河 , 后续还会做更多测试将生产迁移上的经验分享给大家 , 最后祝所有国产数据库大展宏图!


推荐阅读