在 slave 上执行 slaveof 192.168.75.11 6379 命令,可以看到空白的库有了数据
代码语言:javascript复制[root@m2 tmp]# telnet localhost 6379
Trying ::1...
Connected to localhost.
Escape character is '^]'.
keys *
*0
keys *
*0
slaveof 192.168.75.11 6379
OK
keys *
*6
$1
d
$1
c
$1
9
$1
b
$1
a
$1
8
master 上也多了一个 dump.rdb 文件
代码语言:javascript复制127.0.0.1:6379> keys *
1) "b"
2) "a"
3) "c"
4) "8"
5) "9"
6) "d"
127.0.0.1:6379>
127.0.0.1:6379>
127.0.0.1:6379> quit
[root@m1 ~]# ls
anaconda-ks.cfg Downloads install.log.syslog Pictures redis-3.0.0.tar.gz redis-new.conf tmp
Desktop dump.rdb log Public redis.conf redis_slave_on_m1.conf Videos
Documents install.log Music redis-3.0.0 redis.log Templates
[root@m1 ~]#