SSDB主从配置

1、配置:

master:

只需在replication中把binlog打开即可,其它不需要配置

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: sync
                #ip: 127.0.0.1
                #port: 8889
slave:
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: sync
                ip: 192.168.111.19
                port: 8886

1) slaveof.id任意配置即可,并且只需要在slave上配置,master上不 需要进行任何配置slaveof.ip和slaveof.port是master的ip和post
2) type必须是sync,mirror是主主配置

2、监控:控制台输入info可进行主从监控

master:
ssdb 127.0.0.1:8886> info
…
binlogs
            capacity : 20000000
            min_seq  : 1
            max_seq  : 1
replication
        client 192.168.111.20:55744
            type     : sync
            status   : SYNC
            last_seq : 1
slave:
ssdb 127.0.0.1:8886> info
…
binlogs
            capacity : 20000000
            min_seq  : 1
            max_seq  : 1
replication
        slaveof 192.168.111.19:8886
            id         : svc_1
            type       : sync
            status     : SYNC
            last_seq   : 1
            copy_count : 0
            sync_count : 0

每一项的含义详见官方文档:http://ssdb.io/docs/zh_cn/replication.html
注意:
1) master的replication中是client,slave的replication中是slaveof
2) 主从是否同步到位,可比较binlogs.max_seq 和 replication.client.last_seq 是否相等

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值