多节点redis集群搭建流程
环境:redis-5.0.3,suse linux 12
修改配置文件
bind 本地ip
port 监听端口(多节点搭建使用默认端口6379,单节点多实例需修改为不同端口)
daemonize yes #开启守护进程
pidfile /var/run/redis_6379.pid #pidfile路径,修改为拥有操作权限的路径
cluster-enabled yes #开启集群模式
cluster-config-file nodes_7000.conf #集群的配置,配置文件首次启动时自动生成
cluster-node-timeout 5000 #节点超时
appendonly yes #aof日志开启,记录写操作日志
logfile "/arrow/redis-cluster/redis/log/redis.log" #修改为拥有操作权限的路径
拷贝redis到各个节点,并启动redis实例
赋予执行权限
chmod -R 777 red