redis 主从配置 哨兵配置:
主从配置:
cong-6379.cong
#主表的配置文件
# Redis 使用后台模式
daemonize yes
# 关闭保护模式
protected-mode no
# 注释以下内容开启远程访问
# bind 127.0.0.1
# 修改启动端口为 6379
port 6379
# 修改 pidle 指向路径--Redis 以守护进程方式运行时把 pid 写入文件
pidle "/home/service/redis/etc/pid/redis_6379.pid"
#数据库的存放位置 自己定义
dir "/home/service/redis/db/master"
save 900 1
save 300 10
save 60 10000
#如果设置密码,主从密码都要设置,且必须一致
requirepass root
masterauth root
cong-6380.cong
# Redis 使用后台模式
daemonize yes
# 关闭保护模式
protected-mode no
# 注释以下内容开启远程访问
# bind 127.0.0.1
# 修改启动端口为 6379
port 6380
# 修改 pidle 指向路径
pidle "/home/service/redis/etc/pid/redis_6380.pid"
评论0