文章目录
- 实验前提
- 实验
实验前提
- 已完成源码安装并能正常启动redis
/usr/local/bin/redis-server
能正常启动redis
实验
vim /etc/systemd/system/redis.service
内容如下:
[unit]
Description=redis-server
After=network.target[Service]
Type=forking
ExecStart=/usr/local/bin/redis-server
PrivateTmp=true[Install]
WantedBy=multi-user.target
尝试启动服务
systemctl start redis
设置开机启动
systemctl enable redis