1.添加nacos.service文件:vim /lib/systemd/system/nacos.service
2.文件内容
[Unit]
Description=nacos
After=network.target
[Service]
Type=simple
User=root
ExecStart= nacos地址/bin/startup.sh -m standalone
Restart=on-failure
PrivateTmp=true
[Install]
WantedBy=multi-user.target
3.保存退出后
systemctl daemon-reload #重新加载所有service服务
systemctl enable nacos.service #设置开机启动
systemctl is-enabled nacos.service #查看该service是否开机启用
systemctl start nacos.service #启动nacos
systemctl status nacos.service #查看该服务状态