Postgres 自動故障轉移:Manatee
Manatee 是一個基于ZooKeeper的系統能夠管理Postgres的備份和自動故障轉移,Manatee和Moray共同提供高可用的鍵值服務。
特性:
-
Automated liveliness detection, failover, and recovery. Reads are always available, even during a failover. Writes are available as soon as the failover is complete.
-
Automated bootstrap. New peers will bootstrap and join the shard without human intervention.
-
Data integrity. Built atop ZFS andPostgreSQL synchronous replication for safe, reliable storage.
客戶端代碼:
var manatee = require('node-manatee');
var client = manatee.createClient({
"path": "/manatee/1",
"zk": {
"connectTimeout": 2000,
"servers": [{
"host": "172.27.10.97",
"port": 2181
}, {
"host": "172.27.10.90",
"port": 2181
}, {
"host": "172.27.10.101",
"port": 2181
}],
"timeout": 20000
}
});
client.once('ready', function () {
console.log('manatee client ready');
});
client.on('topology', function (urls) {
console.log({urls: urls}, 'topology changed');
});
client.on('error', function (err) {
console.error({err: err}, 'got client error');
});
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!