vim /lib/systemd/system/redis1.service
[Unit]
Description=redis-server
After=network.target
[Service]
Type=forking
#启动命令及配置文件路径,伪集群这里更改
ExecStart=/usr/local/bin/redis-server /usr/local/redis/conf/redis.conf
PrivateTmp=true
[Install]
WantedBy=multi-user.target
#添加开机启动
systemctl enable redis1.service
学习redis(第三篇)——开机自启
最新推荐文章于 2024-08-13 22:26:21 发布