微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Yoke Postgres 高可用集群

程序名称:Yoke

授权协议: MPL

操作系统: 跨平台

开发语言: Google Go

Yoke 介绍

Yoke 是 Postgres
的高可用集群,具有自动切换和自动集群恢复。Postgres冗余/自动故障转移解决方案,提供一个高可用Postgresql集群的简单管理。

Yoke 依赖:

  • 包含 ‘primary’, ‘secondary’ 和 ‘monitor’ 三个节点的 3-server 集群

  • ‘primary’ & ‘secondary’ 节点需要互相之间进行 ssh 连接 (w/o 密码)

  • ‘primary’ & ‘secondary’ 节点需要远程同步安装 (或者一些替代 sync_command)

  • ‘primary’ & ‘secondary’ 节点应该有安装 postgres,Yoke 会尝试调用 ‘postgres’ 和 ‘pg_ctl’

  • ‘primary’ & ‘secondary’ 节点作为一个子进程运行 postgres

配置示例:

[config]
# the IP which this node will broadcast to other nodes
advertise_ip=
# the port which this node will broadcast to other nodes
advertise_port=4400
# the directory where postgresql was installed
data_dir=/data
# delay before node decides what to do with postgresql instance
decision_timeout=30
# log verbosity (trace, debug, info, warn error, fatal)
log_level=warn
# required - the IP:port combination of all nodes that are to be in the cluster (e.g. 'role=m.y.i.p:4400')
primary=
secondary=
monitor=
# SmartOS required - either 'primary', 'secondary', or 'monitor' (the cluster needs exactly one of each)
role=
# the postgresql port
pg_port=5432
# the directory where node status @R_459_4045@ion is stored
status_dir=./status
# the command you would like to use to sync the data from this node to the other when this node is master
sync_command=rsync -ae "ssh -o StrictHostKeyChecking=no" --delete {{local_dir}} {{slave_ip}}:{{slave_dir}}
[vip]
# Virtual Ip you would like to use
ip=
# Command to use when adding the vip. This will be called as {{add_command}} {{vip}}
add_command=
# Command to use when removing the vip. This will be called as {{remove_command}} {{vip}}
remove_command=
[role_change]
# When this nodes role changes we will call the command with the new role as its arguement '{{command}} {{(master|slave|single}))'
command=

Yoke 官网

https://github.com/nanopack/yoke

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐