拷贝Redis配置文件redis.conf到创建的第一个文件夹下
cp /usr/local/soft/redis-6.2.4/redis.conf /usr/local/soft/redis-6.2.4/redis-cluster/6319
修改配置文件
cd /usr/local/soft/redis-6.2.4/redis-cluster/6319
vim redis.conf
如下配置文件配置项如有不懂的,可以去我的单机版安装Redis实例中查看,这里搜索这些配置可以退出编辑模式 使用/xxx(斜杆+部分字符) 来搜索,或者直接从服务器拿下来修改
port 6319
protected-mode no
daemonize yes
dir “/usr/local/soft/redis-6.2.4/redis-cluster/6319/”
cluster-enabled yes
cluster-config-file nodes-6319.conf
cluster-node-timeout 15000
appendonly yes
pidfile “/var/run/redis_6319.pid”
外网集群需要增加如下配置
# 各节点网卡分配的IP(公网IP)
cluster-announce-ip xx.xx.xx.xx
# 节点映射端口
cluster-announce-port ${PORT}
# 节点总线端口
cluster-announce-bus-port ${PORT}
拷贝配置文件到其余5个创建的目录
cd