【CENTOS】Radisマスターコピープロセス(二)
Redis:Master 192.168.145.128 6379
Redis:Slave 192.168.145.129 6379
前章の構成に従ってslaveを構成します.
salveの
vim/etc/redis/6379.conf
ここを見つけてslabeofを編集すればいいです
サーバサービスradis restartの再起動
マスターコピー、マスター入力の検証
別の機械に行って調べる
Redis:Slave 192.168.145.129 6379
前章の構成に従ってslaveを構成します.
salveの
vim/etc/redis/6379.conf
ここを見つけてslabeofを編集すればいいです
################################# REPLICATION #################################
# Master-Slave replication. Use slaveof to make a Redis instance a copy of
# another Redis server. A few things to understand ASAP about Redis replication.
#
# 1) Redis replication is asynchronous, but you can configure a master to
# stop accepting writes if it appears to be not connected with at least
# a given number of slaves.
# 2) Redis slaves are able to perform a partial resynchronization with the
# master if the replication link is lost for a relatively small amount of
# time. You may want to configure the replication backlog size (see the next
# sections of this file) with a sensible value depending on your needs.
# 3) Replication is automatic and does not need user intervention. After a
# network partition slaves automatically try to reconnect to masters
# and resynchronize with them.
#
# slaveof <masterip> <masterport>
slaveof 192.168.145.128 6379
サーバサービスradis restartの再起動
マスターコピー、マスター入力の検証
[root@hadoop01 local]# redis-cli set test 1000
OK
[root@hadoop01 local]# redis-cli get test
"1000"
[root@hadoop01 local]#
別の機械に行って調べる
[root@hadoop02 redis-stable]# service redis restart
Stop Redis Server: [ OK ]
Starting Redis Server: [ OK ]
[root@hadoop02 redis-stable]# redis-cli get test
"1000"
[root@hadoop02 redis-stable]#