redis6.0.9 三台哨兵搭建

redis6.0.9 三台哨兵搭建

  • 环境准备
    • 服务器(CentOS Linux release 8.2.2004)
    • 安装包(redis-6.0.9.tar.gz)
  • 开干
    • 安装
    • 配置文件
      • reids1
        • redis开机自启动脚本
        • redis服务配置文件:redis.cnf
        • redis哨兵配置文件:sentinel.conf
        • redis访问权限列表配置文件:/etc/redis/users.acl
      • reids2
        • redis开机自启动脚本
        • redis服务配置文件:redis.cnf
        • redis哨兵配置文件:sentinel.conf
      • reids3
        • redis开机自启动脚本
        • redis服务配置文件:redis.cnf
        • redis哨兵配置文件:sentinel.conf

redis 6.0出ACL(Access Control List,访问权限列表)新特性了,用之

环境准备

服务器(CentOS Linux release 8.2.2004)

reids1:172.165.165.101
reids2:172.165.165.102
reids3:172.165.165.103

安装包(redis-6.0.9.tar.gz)

linux版本下载地址:http://download.redis.io/releases/
windows版本下载地址:https://github.com/tporadowski/redis/releases

redis-6.0.9.tar.gz

开干

由于,三台服务器的配置文件都大同小异,所以只上重要的地方,具体配置文件详情请下载配置文件自行查看

安装

这个太没有技术含量,自行百度,或者看官网说明:https://redis.io/download

配置文件

请以官方说明为准,用别人的软件,一定要看别人官方的说明。
官方文档地址:https://redis.io/documentation
个人redis.conf、sentinel.conf翻译:https://blog.csdn.net/qq_37809967/article/details/110508298
配置文件压缩包:

reids1

redis开机自启动脚本

从 /usr/local/redis-6.0.9/utils 复制 redis_init_script 获取,并进行部分自定义修改

REDISPORT=6379
# 根据自己的redis base地址配置
EXEC=/usr/local/src/redis-server
CLIEXEC=/usr/local/src/redis-cli

PIDFILE=/var/run/redis_${REDISPORT}.pid
CONF="/etc/redis/redis.conf"

case "$1" in
    start)
        if [ -f $PIDFILE ]
        then
                echo "$PIDFILE exists, process is already running or crashed"
        else
                echo "Starting Redis server..."
                $EXEC $CONF
        fi
        ;;
    stop)
        if [ ! -f $PIDFILE ]
        then
                echo "$PIDFILE does not exist, process is not running"
        else
                PID=$(cat

你可能感兴趣的:(redis)