注意 gcc 版本
yum -y install gcc automake autoconf libtool make yum install gcc gcc-c++
# 用来指定安装目录
make PREFIX=/home/work/redis install
#安装完成后执行测试
make test
#如果提示缺少tcl, 安装即可,yum -y install tcl
# 快照 & 日志 注意 redis.conf 文件修改配置路径
mkdir /home/work/redis/data
mkdir /home/work/redis/logs
#修改 redis.conf 文件 具体看 实际需求配置
bind 0.0.0.0
logfile /home/work/redis/logs/redis.log
dir /home/work/redis/data
vim /lib/systemd/system/redis-63079.service
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
Type=forking
ExecStart=/home/work/redis/bin/redis-server /home/work/redis/conf/redis63079.conf
ExecStop=/home/work/redis/bin/redis-cli shutdown
ExecReload=/bin/kill -s HUP $MAINPID
Restart=always
[Install]
WantedBy=multi-user.target
// 启动
systemctl start redis-63079
// 停止
systemctl stop redis-63079
// 重启
systemctl restart redis-63079
// 查看状态
systemctl status redis-63079
// 使开机启动
systemctl enable redis-63079