vim /lib/systemd/system/nacos.service
在nacos.service中加入:
[Unit] Description=nacos After=network.target [Service] Type=forking ExecStart=/usr/nacos-server-1.1.3/nacos/bin/startup.sh -m standalone ExecReload=/usr/nacos-server-1.1.3/nacos/bin/shutdown.sh ExecStop=/usr/nacos-server-1.1.3/nacos/bin/shutdown.sh PrivateTmp=true [Install] WantedBy=multi-user.target
重新加载所有service服务
systemctl daemon-reload
开机启动nacos.service
systemctl enable nacos.service
查看该service是否开机启用
systemctl is-enabled nacos.service
启动该服务
systemctl start nacos.service
查看该服务状态
systemctl status nacos.service