nacos设置开机自启动

修改主机名

hostnamectl set-hostname nacos  

创建服务

[Unit]
Description=nacos
After=network.target
 
[Service]
Type=forking
ExecStart=/usr/local/nacos/nacos/bin/startup.sh -m standalone
ExecReload=/usr/local/nacos/nacos/bin/shutdown.sh
ExecStop=/usr/local/nacos/nacos/bin/shutdown.sh
PrivateTmp=true
 
[Install]  
WantedBy=multi-user.target

设置开启自启动

systemctl daemon-reload
systemctl enable nacos.service
systemctl start nacos.service

  

 

posted @ 2020-06-13 01:19  天宇轩-王  阅读(6611)  评论(2编辑  收藏  举报