Redis
安装版本Redis7
yum安装wget
yum -y install wget
下载redis源码包
wget https://download.redis.io/releases/redis-7.0.11.tar.gz
解压
tar -zxvf redis-7.0.11.tar.gz
编译安装
cd redis-7.0.11
make
make install PREFIX=/usr/local/redis
cp源配置文件
cp ./redis.conf /usr/local/redis
修改配置文件
bind 0.0.0.0 -::1
protected-mode no
添加redis.service
vim /etc/systemd/system/redis.service
添加如下内容
Description=redis-server
After=network.target
[Service]
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf
PrivateTmp=true
[Install]
WantedBy=multi-user.target
初始化
systemctl daemon-reload
启动
systemctl start redis
添加开机自启
systemctl enable redis.service