Redis教程

centos7.6安装redis5.0.3

本文主要是介绍centos7.6安装redis5.0.3,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

yum install -y gcc
wget http://download.redis.io/releases/redis-5.0.3.tar.gz
tar -zxvf redis-5.0.3.tar.gz
cd redis-5.0.3
make
make install PREFIX=/usr/local/redis
cp /usr/local/redis-5.0.3/redis.conf /usr/local/redis/bin/
修改 redis.conf 文件,把 daemonize no 改为 daemonize yes
requirepass 改为 123
后台启动
./redis-server redis.conf
开机自启
vim /etc/systemd/system/redis.service
[Unit]
Description=redis-server
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/bin/redis.conf
PrivateTmp=true

[Install]
WantedBy=multi-user.target

加载配置:
systemctl daemon-reload
开机自启
systemctl enbale redis.service
启动
systemctl start redis.service

这篇关于centos7.6安装redis5.0.3的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!