1 下载Redis包
下载地址:http://download.redis.io/releases/redis-3.2.4.tar.gz
2 上传服务器的/usr/local/下
3 安装gcc pcre-devel zlib-devel
yum -y install gcc pcre-devel zlib-devel
4 解压Redis包
cd /usr/loca/redis-3.2.4.tar.gz (将Redis改个名 mv redis-3.2.4.tar.gz redis)
tar -xzvf redis-3.2.4.tar.gz
mv redis-3.2.4.tar.gz redis
5 编译安装
cd /usr/local/redis/
make
cd /usr/local/redis/src/
make install
6 关闭transparent_hugepage
echo never > /sys/kernel/mm/transparent_hugepage/enabled
7 开启vm.overcommit_memory
echo "vm.overcommit_memory=1" >> /etc/sysctl.conf
8 修改somaxconn大小
echo 511 > /proc/sys/net/core/somaxconn
9 修改redis.conf文件 主要修改以下几项
vim /usr/local/redis/redis.conf
daemonize yes
requirepass (Redis连接密码)
protected-mode yes
wq (保存)
10 重启Redis服务
/usr/local/redis/redis-server /usr/local/redis/redis.conf
肯定有坑,自己排吧。
原文地址:https://www.cnblogs.com/MUQINGFENG123/p/11353882.html