Maison >base de données >tutoriel mysql >ssdb主从同步复制配置详细步骤
SSDB 的配置文件是一种层级 key-value 的静态配置文件, 通过一个 TAB 缩进来表示层级关系. 以 # 号开始的行是注释. ssdb的使用遵循redis协议,读写性能都特别快。 有时我们在使用数据库时,像mongodb,redis和一些关系行数据,为了使数据更加安全,作为备份
SSDB 的配置文件是一种层级 key-value 的静态配置文件, 通过一个 TAB 缩进来表示层级关系. 以 ‘#’ 号开始的行是注释.
ssdb的使用遵循redis协议,读写性能都特别快。
有时我们在使用数据库时,像mongodb,redis和一些关系行数据,为了使数据更加安全,作为备份使用我们经常习惯使用主从复制架构,当主机上的数据出现问题时,我们就可以连接到slave机器这是slave机器的配置,
# ssdb-server config # MUST indent by TAB! # relative to path of this file, directory must exists work_dir = ./2014_12_1 pidfile = ./2014_12_1/ssdb.pid server: 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 replication: 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: 10.100.300.1 port: 8888 logger: level: info output: log.txt rotate: size: 1000000000 leveldb: # in MB cache_size: 1024 # in KB block_size: 64 # in MB write_buffer_size: 256 # in MB compaction_speed: 100 # yes|no compression: no
# ssdb-server config # MUST indent by TAB! # relative to path of this file, directory must exists work_dir = ./var_update pidfile = ./var_update/ssdb.pid server: 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 replication: 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 logger: level: info output: log.txt rotate: size: 1000000000 leveldb: # in MB cache_size: 300 # in KB block_size: 64 # in MB write_buffer_size: 256 # in MB compaction_speed: 100 # yes|no compression: no