REDIs安装
redis 下载 https://redis.io/download
wget http://download.redis.io/releases/redis-3.2.6.tar.gz
解压缩
tar xzf redis-3.2.6.tar.gz
进入解压后的文件目录
cd redis-3.2.6
redis安装相对简单 直接编译即可
make
创建存储redis文件目录
mkdir -p /usr/local/redis
复制redis-server redis-cli到新建立的文件夹
cp ./redis-server /usr/local/redis/ cp ./redis-cli /usr/local/redis/
复制redis的配置文件
cd .. cp redis.conf /usr/local/redis/
编辑配置文件
cd /usr/local/redis/ vim redis.conf
改为yes 后台运行
添加开机启动服务
vim /etc/systemd/system/redis-server.service
粘贴一下内容
按 Ctrl+C 复制代码
Unit]
Description=The redis-server Process Manager
After=syslog.target network.target
[Service]
Type=simple
PIDFile=/var/run/redis.pid
ExecStart=/usr/local/redis/redis-server
ExecReload=/bin/kill -USR2 $MAINPID
ExecStop=/bin/kill -SIGINT $MAINPID
[Install]
WantedBy=multi-user.target
按 Ctrl+C 复制代码
设置开机启动
systemctl daemon-reload systemctl start redis-server.service systemctl enable redis-server.service
检查是否安装成功
创建redis命令软连接
ln -s /usr/local/redis/redis-cli /usr/bin/redis
测试redis
相关推荐
王道革 2020-11-25
wangdonghello 2020-11-03
Langeldep 2020-11-16
chenhualong0 2020-11-16
聚合室 2020-11-16
koushr 2020-11-12
MRFENGG 2020-11-11
guoyanga 2020-11-10
fackyou00 2020-11-10
Orangesss 2020-11-03
dongCSDN 2020-10-31
rainandtear 2020-10-30
Quietboy 2020-10-30
liuyulong 2020-10-29
fansili 2020-10-29
温攀峰 2020-10-23
jackbon 2020-10-19
kaixinfelix 2020-10-04