ssdb双主同步

配合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双主同步,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。