centos redis 编译安装及配置

2021/4/14 19:31:09

本文主要是介绍centos redis 编译安装及配置,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

安装

# wget https://download.redis.io/releases/redis-6.2.2.tar.gz
# tar xzf redis-6.2.2.tar.gz
# cd redis-6.2.2
# make install PREFIX=/usr/local/redis
# make test

配置

新增/etc/systemd/system/redis.service

[Unit]
Description=redis-server
After=network.target

[Service]
PIDFile=/var/run/redis_6379.pid
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/bin/redis.conf --daemonize no
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

将src下的redis.conf复制到/usr/local/redis/bin

配置RDB、AOF、requirepass......

启动

#systemctl daemon-reload
#systemctl enable redis.service
#systemctl start redis.service

 



这篇关于centos redis 编译安装及配置的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程