redis6.0.5安装部署linux,linux redis-6.0.5 部署+哨兵部署

1、下载Redis redis-6.0.5.tar.gz

解压 tar xzf + Redis包

mv redis-6.0.5 /usr/local/redis

进入 Redis文件安装

cd  /usr/local/redis

安装依赖文件

yum install gcc-c++

yum -y install centos-release-scl

yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils

临时生效

scl enable devtoolset-9 bash

永久生效

echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile

make 安装

运行redis

./src/redis-server redis.conf

2、告警参数优化

1、WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

vi /etc/sysctl.conf

增加一行:net.core.somaxconn = 2048

运行命令生效:sysctl -p

查看 /proc/sys/net/core/somaxconn文件是否变成2048

cat  /proc/sys/net/core/somaxconn

2、WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

vim /etc/sysctl.conf

增加一行:vm.overcommit_memory = 1

运行命令生效:sysctl vm.overcommit_memory=1

3、WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.

vim /etc/rc.local

加入以下两行:

ulimit -SHn 65535

echo never > /sys/kernel/mm/transparent_hugepage/enabled

3、哨兵模式

修改sentinel.conf文件

vim sentinel.conf

port 26379

daemonize yes

pidfile /var/run/redis-sentinel.pid

logfile "/logs/redis/sentinel-6600.log"

dir /tmp

sentinel monitor mymaster 10.24.242.144 6600 2

sentinel down-after-milliseconds mymaster 30000

sentinel parallel-syncs mymaster 1

sentinel failover-timeout mymaster 180000

sentinel deny-scripts-reconfig yes

其余2台配置文件一直

启动哨兵即可

redis-sentinel sentinel.conf

来源:https://www.cnblogs.com/Nanaya/p/13191170.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值