您的位置:首页 > 博客中心 > 数据库 >

ssdb双主同步

时间:2022-03-10 17:44

配合lvs的ha模式,lvs的ha模式可以参考

 

ssdb主机:

192.168.1.104 192.168.1.108

 

修改ssdb.conf

104主机

# ssdb-server config # MUST indent by TAB! # relative to path of this file, directory must exists work_dir = ./var pidfile = ./var/ssdb.pid server: #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.168 replication: 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: 11111 logger: level: debug output: log.txt rotate: size: 1000000000 leveldb: # 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 exists work_dir = ./var pidfile = ./var/ssdb.pid server: #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.168 replication: 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: 11111 logger: level: debug output: log.txt rotate: size: 1000000000 leveldb: # 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按键

ssdb双主同步,布布扣,bubuko.com

热门排行

今日推荐

热门手游