下载
官网地址 http://download.redis.io/releases/
1、环境:
127.0.0.1
127.0.0.2
127.0.0.3
2、创建目录,创建redis用户,解压Redis安装包
mkdir -p /u01/redisgroupadd redisuseradd -g redis redis
chown -R redis:redis /u01/redis/
su - redis
tar -zxvf redis-5.0.8.tar.gz
3、安装redis软件
/u01/redis/redis-5.0.8
make && make install
4、安装redis库,路径自定义
mkdir /u01/redis/6380mkdir /u01/redis/6380/{data,logs,conf,root} -p
touch /u01/redis/6380/conf/redis.conf
touch /u01/redis/6380/logs/redis.log
5、修改内核参数
echo "1" > /proc/sys/vm/overcommit_memory
cat /proc/sys/vm/overcommit_memory
echo "vm.overcommit_memory=1" >> /etc/sysctl.conf
sysctl vm.overcommit_memory=1
echo "1" > /proc/sys/vm/swappiness
echo "vm.swappiness=1" >> /etc/sysctl.conf
sysctl vm.swappiness=1sysctl -p
echo "511" > /proc/sys/net/core/somaxconn
cat /proc/sys/net/core/somaxconn
echo "never" > /sys/kernel/mm/transparent_hugepage/enabled
echo "never" > /sys/kernel/mm/transparent_hugepage/defrag
cat /sys/kernel/mm/transparent_hugepage/defrag
cat /sy