ubuntu 18.04 redis installation

2018-11-25  本文已影响0人  尘梦忘归

attention: contents in the brackets are comments, do not copy!

  1. install
# wget http://download.redis.io/releases/redis-5.0.2.tar.gz 
# tar xzf redis-5.0.2.tar.gz 
# mv redis-5.0.2 /usr/local/redis/
# cd /usr/local/redis/
# make
# cd /usr/local/bin 
# ls -all
  1. configuration
 # cp /usr/local/redis/redis.conf /etc/redis/ 
 # vim /etc/redis/redis.conf
  1. self-starting when booting
vim /lib/systemd/system/redis.service

add contents bellow

[Unit]
Description=redis
After=network.target

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

[Install]
WantedBy=multi-user.target

# systemctl enable redis.service
# systemctl start redis
# ss -tnl
  1. References

https://redis.io/downloa https://blog.csdn.net/weixin_41114593/article/details/82383716

上一篇 下一篇

猜你喜欢

热点阅读