CentOS7 设置 nacos 开机启动
1、新增服务文件
vim /lib/systemd/system/nacos.service
2、增加如下内容
[Unit]
Description=nacos
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/nacos/bin/startup.sh -m standalone
ExecReload=/usr/local/nacos/bin/shutdown.sh
ExecStop=/usr/local/nacos/bin/shutdown.sh
PrivateTmp=true
[Install]
WantedBy=multi-user.target
3、添加nacos服务
systemctl daemon-reload
4、添加开机自启
systemctl enable nacos
5、开启关闭nacos服务
开启
systemctl start nacos
关闭
systemctl stop nacos
重启
systemctl restart nacos