https://www.cnblogs.com/yufeng218/p/13997177.html
java配置
vim /etc/profile.d/java.sh
export JAVA_HOME=/usr/local/jdk
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export CLASSPATH=.$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar
maven配置
vim /etc/profile.d/maven.sh
export MAVEN_HOME=/usr/local/maven
export PATH="$MAVEN_HOME/bin:$PATH"
maven仓库配置
vim /usr/local/maven/conf/settings.xml
...
<mirrors>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
...
nacos部署
git clone https://github.com/alibaba/nacos.git
cd nacos/
mvn -Prelease-nacos -Dmaven.test.skip=true clean install -U
...
[INFO] Building tar: /root/nacos/distribution/target/nacos-server-1.4.2.tar.gz
[WARNING] Encountered ModuleSet with no sources or binaries specified. Skipping.
[INFO] Building zip: /root/nacos/distribution/target/nacos-server-1.4.2.zip
...
ls -al distribution/target/
cd distribution/target/nacos-server-1.4.2/nacos/bin/
#启动
sh startup.sh -m standalone
http://192.168.8.77:8848/nacos
nacos
nacos
服务注册
curl -X POST 'http://127.0.0.1:8848/nacos/v1/ns/instance?serviceName=nacos.naming.serviceName&ip=20.18.7.10&port=8080'
服务发现
curl -X GET 'http://127.0.0.1:8848/nacos/v1/ns/instance/list?serviceName=nacos.naming.serviceName'
发布配置
curl -X POST "http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&group=test&content=HelloWorld"
获取配置
curl -X GET "http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&group=test"