首页 > 代码库 > ssdb双主同步
ssdb双主同步
配合lvs的ha模式,lvs的ha模式可以参考这里
ssdb主机:
192.168.1.104192.168.1.108
修改ssdb.conf
104主机
# ssdb-server config# MUST indent by TAB!# relative to path of this file, directory must existswork_dir = ./varpidfile = ./var/ssdb.pidserver: #ip: 127.0.0.1 port: 11111 # bind to public ip ip: 0.0.0.0 # format: allow|deny: all|ip_prefix # multiple allows or denys is supported #deny: all #allow: 127.0.0.1 #allow: 192.168replication: binlog: yes # Limit sync speed to *MB/s, -1: no limit sync_speed: -1 slaveof: # to identify a master even if it moved(ip, port changed) # if set to empty or not defined, ip:port will be used. id: svc_1 # sync|mirror, default is sync type: mirror ip: 192.168.1.108 port: 11111logger: level: debug output: log.txt rotate: size: 1000000000leveldb: # in MB cache_size: 500 # in KB block_size: 32 # in MB write_buffer_size: 64 # in MB compaction_speed: 1000 # yes|no compression: no
108同上
# ssdb-server config# MUST indent by TAB!# relative to path of this file, directory must existswork_dir = ./varpidfile = ./var/ssdb.pidserver: #ip: 127.0.0.1 port: 11111 # bind to public ip ip: 0.0.0.0 # format: allow|deny: all|ip_prefix # multiple allows or denys is supported #deny: all #allow: 127.0.0.1 #allow: 192.168replication: binlog: yes # Limit sync speed to *MB/s, -1: no limit sync_speed: -1 slaveof: # to identify a master even if it moved(ip, port changed) # if set to empty or not defined, ip:port will be used. id: svc_2 # sync|mirror, default is sync type: mirror ip: 192.168.1.104 port: 11111logger: level: debug output: log.txt rotate: size: 1000000000leveldb: # in MB cache_size: 500 # in KB block_size: 32 # in MB write_buffer_size: 64 # in MB compaction_speed: 1000 # yes|no compression: no
外面的客户端直接连接vip,端口11111,读写即可。
在rs主机上用ssdb-cli 11111进入管理shell,直接get查看数据即可。
------------------------------------------------------------------------------------------------------------
附ssdb关闭的命令
kill `cat ~/var/ssdb.pid`
注意,cat之前的不是单引号,是esc按键
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。