https://github.com/alibaba/nacos/releases
tar -zxvf nacos-server-1.3.2.tar.gz
mv nacos /usr/local/
cd /usr/local/nacos/bin
sh startup.sh -m standalone
firewall-cmd --zone=public --add-port=8848/tcp --permanent
firewall-cmd --zone=public --add-port=9848/tcp --permanent
systemctl restart firewalld.service
curl http://127.0.0.1:8848/nacos/index.html
vim /usr/local/nacos/conf/application.properties
原来里面就有注释掉的,可以修改后,把注释符去掉:
### If use MySQL as datasource:
spring.datasource.platform=mysql
### Count of DB:
db.num=1
### Connect URL of DB:
db.url.0=jdbc:mysql://127.0.0.1:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user.0=root
db.password.0=root
cd /usr/local/nacos/bin
./startup.sh -m standalone
vim /usr/local/nacos/logs/start.out
vim /usr/local/nacos/logs/nacos.log
firewall-cmd --zone=public --add-port=8848/tcp --permanent
systemctl restart firewalld.service
curl http://127.0.0.1:8848/nacos/index.html
vim /lib/systemd/system/nacos.service
#vim /usr/lib/systemd/system/srs.service
[Unit]
Description=nacos
After=network.target
[Service]
Type=forking
TimeoutSec=0 #防止启动超时
User=root
Group=root
ExecStart=/bin/bash /usr/local/nacos/bin/startup.sh -m standalone
ExecReload=/usr/local/nacos/bin/shutdown.sh
ExecStop=/usr/local/nacos/bin/shutdown.sh
Restart=on-failure
PrivateTmp=true
[Install]
WantedBy=multi-user.target
*这里要注意路径,我的是 /usr/local/nacos等等。*
systemctl daemon-reload
systemctl enable nacos.service
systemctl start nacos.service
systemctl status nacos.service
查看开机自启 项目
ll /etc/systemd/system/multi-user.target.wants