ssdb做主主同步



参考网址:http://ssdb.io/docs/zh_cn/replication.html

host1(192.168.10.1)的ssdb.conf配置文件
# 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
ip: 0.0.0.0
port: 8888
# 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
# auth password must be at least 32 characters
#auth: very-strong-password

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.10.2
#host: localhost
port: 8888

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/s
compaction_speed: 1000
# yes|no
compression: yes


host2(192.168.10.2)的ssdb.conf配置文件

# 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
ip: 0.0.0.0
port: 8888
# 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
# auth password must be at least 32 characters
#auth: very-strong-password

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.10.1
#host: localhost
port: 8888

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/s
compaction_speed: 1000
# yes|no
compression: yes

注意:两台机器的8888端口需要防火墙打开权限

标签: ssdb

如果您满意,请识别二维码打赏

添加新评论

captcha
请输入验证码