我设置了一个运行postgresql数据库的HA集群(冗余对)-该数据库位于NFS文件服务器上。如果与文件服务器的连接从主服务器断开(例如,电缆断开),则主服务器将尝试故障切换。但是,故障转移在运行"service postgres stop“时挂起,因为nfs挂载没有响应。
我的google-fu让我失望了(尽管我之前还以为其他人会这么做呢!)
我的ha.cf文件:
logfile /var/log/ha-log
logfacility local0
keepalive 2
warntime 15
deadtime 30
initdead 60
ucast eth0 <eth0 ip>
ucast eth1 <eth1 ip>
node node2
node node1
auto_failback off
respawn hacluster /usr/lib/heartbeat/ipfail
apiauth ipfail uid=hacluster
ping <filer IP>haresource:
node2 IPaddr::<VIP>/24/eth0 Filesystem::<filer export>::/var/lib/pgsql::nfs::rw,noatime,rsize=4096,wsize=4096,hard,intr,noac,nfsvers=3 postgresql发布于 2012-03-24 05:40:51
当服务器离开时,NFS挂载可能会挂起相当长的一段时间,甚至长达十分钟。
此延迟可能会使正确隔离这两个服务器变得非常困难。如果NFS服务器在出现故障的主服务器上的postgres进程终止之前恢复活动,则出现故障的主服务器的postgres进程和新的主postgres进程可能会尝试同时写入数据库文件,从而导致损坏。
https://stackoverflow.com/questions/9164533
复制相似问题