ubuntu 18.04 redis installation
1226 ワード
attention: contents in the brackets are comments, do not copy! install configuration # bind 127.0.0.1 daemonize yes logfile/var/log/redis/redis-server.log (log file) dir/var/lib/redis (path of data files) self-starting when booting
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 References
https://redis.io/downloa https://blog.csdn.net/weixin_41114593/article/details/82383716
# 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
# cp /usr/local/redis/redis.conf /etc/redis/
# vim /etc/redis/redis.conf
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
https://redis.io/downloa https://blog.csdn.net/weixin_41114593/article/details/82383716