接上述安装文档(1)
添加slave节点
添加的slave节点配置在另一个服务器上,首先配置config文件
这里我们计算一下
本来是两重冗余,8个节点集群,也就是一共16个conf文件
现在是三重冗余,8个节点集群,也就是一共24个conf文件,现在要把他分配到4个主机上,也就是每个主机6个conf文件。也就是在原来的基础上增加两个conf文件
此时就是有顺序的填数独
主机1
[
root@T1 config]# vi redis-26381.conf
include /tmp/redis-3.2.0/config/redis-common.conf
port 26381
logfile "/tmp/redis-3.2.0/log/redis-26381.log"
maxmemory 100m
# volatile-lru -> remove the key with an expire set using an LRU algorithm
# allkeys-lru -> remove any key accordingly to the LRU algorithm
# volatile-random -> remove a random key with an expire set
# allkeys-random -> remove a random key, any key
# volatile-ttl -> remove the key with the nearest expire time (minor TTL)
# noeviction -> don't expire at all, just return an error on write operations
maxmemory-policy allkeys-lru
appendfilename "appendonly-26381.aof"
dbfilename dump-26381.rdb
dir /tmp/redis-3.2.0/data
cluster-config-file nodes-26381.conf
auto-aof-rewrite-percentage 80-100
[
root@T1 config]# vi redis-26384.conf
include /tmp/redis-3.2.0/config/redis-common.conf
port 26384
logfile "/tmp/redis-3.2.0/log/redis-26384.log"
maxmemory 100m
# volatile-lru -> remove the key with an expire set using an LRU algorithm
# allkeys-lru -> remove any key accordingly to the LRU algorithm
# volatile-random -> remove a random key with an expire set
# allkeys-random -> remove a random key, any key
# volatile-ttl -> remove the key with the nearest expire time (minor TTL)
# noeviction -> don't expire at all, just return an error on write operations
maxmemory-policy allkeys-lru
appendfilename "appendonly-26384.aof"
dbfilename dump-26384.rdb
dir /tmp/redis-3.2.0/data
cluster-config-file nodes-26384.conf
auto-aof-rewrite-percentage 80-100
~
主机2
[
root@T2 config]# vi redis-26382.conf
include /tmp/redis-3.2.0/config/redis-common.conf
port 26382
logfile "/tmp/redis-3.2.0/log/redis-26382.log"
maxmemory 100m
# volatile-lru -> remove the key with an expire set using an LRU algorithm
# allkeys-lru -> remove any key accordingly to the LRU algorithm
# volatile-random -> remove a random key with an expire set
# allkeys-random -> remove a random key, any key
# volatile-ttl -> remove the key with the nearest expire time (minor TTL)
# noeviction -> don't expire at all, just return an error on write operations
maxmemory-policy allkeys-lru
appendfilename "appendonly-26382.aof"
dbfilename dump-26382.rdb
dir /tmp/redis-3.2.0/data
cluste