2024-05-09    2024-05-09    97 字  1 分钟

下载安装包

https://github.com/alibaba/nacos/releases

解压并移动至安装目录

1
2
tar -zxvf nacos-server-2.2.3.tar.gz 
mv nacos /usr/local

需要配置Java环境

1
2
3
4
export JAVA_HOME=/usr/local/java/jdk17.0.4.1
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH={JAVA_HOME}/bin:$PATH

编辑application.properties

1
2
3
4
5
6
7
8
cd /usr/local/nacos/conf
vim application.properties

spring.datasource.platform=mysql
db.num=1
db.url.0=jdbc:mysql://10.114.12.177:3306/nacos-config?serverTimezone=GMT%2B8&characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
db.user=root
db.password=123456

启动

1
2
cd /usr/local/nacos/bin
sh startup.sh -m standalone