ubuntu 18.04 redis installation

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
  • # bind 127.0.0.1
  • daemonize yes
  • logfile /var/log/redis/redis-server.log (log file)
  • dir /var/lib/redis (path of data files)
  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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容