银河麒麟V10-SP1设置redis开机自启
前言:
redis安装请看:银河麒麟V10-SP1离线安装redis5.0.1_银河麒麟v10 redis5.0-CSDN博客
一、编辑自启文件
vim /etc/systemd/system/redis.service
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/bin/redis-server /usr/local/redis/redis-5.0.1/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
[Install]
WantedBy=multi-user.target
二、设置自启
重载守护程序
sudo systemctl daemon-reload
设置开机自启
systemctl enable redis.service
启动
systemctl start redis.service
查看运行状态
systemctl status redis.service