CentOS下nacos开机自启动

创建service文件

# vim /lib/systemd/system/nacos.service

设置启动脚本

[Unit]
Description=nacos service
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

加入开机自启动

# systemctl enable nacos

服务的启动/停止/查看状态

# systemctl start nacos 启动服务
# systemctl stop nacos 停止服务
# systemctl restart nacos 重新启动服务
# systemctl list-units --type=service 查看所有已启动的服务
# systemctl status nacos 查看服务当前状态
# systemctl enable nacos 设置开机自启动
# systemctl disable nacos 停止开机自启动

留下评论

电子邮件地址不会被公开。 必填项已用*标注