1、添加nacos.service文件
vi /lib/systemd/system/nacos.service
2、将以下内容写到nacos.service文件中
ps:我的nacos路径是/usr/local/nacos
[Unit] Description=nacos After=network.target [Service] Type=forking ExecStart=/usr/local/nacos/bin/startup.sh -m standalone ExecReload=/usrlocal/nacos/bin/shutdown.sh ExecStop=/usrlocal/nacos/bin/shutdown.sh PrivateTmp=true [Install] WantedBy=multi-user.target
3、重新加载服务配置
systemctl daemon-reload
4、设置开机自启
systemctl enable nacos.service
6、启动nacos
systemctl start nacos.service
7、查看启动状态
systemctl status nacos.service