nacos build

nacos official website
http://nacos.io

nacos installation start

Linux/Unix/Mac

Startup command (standalone represents stand-alone mode operation, non-cluster mode):

sh startup.sh -m standalone

If you are using the ubuntu system, or if you run the script and report an error message [[The symbol cannot be found, you can try to run it as follows:

bash startup.sh -m standalone

Windows

Startup command (standalone represents stand-alone mode operation, non-cluster mode):

startup.cmd -m standalone

Integrate spring-cloud

main pom.xml


<!-- spring alibaba nacos 管理依赖 -->  
<dependency>  
    <groupId>com.alibaba.cloud</groupId>  
    <artifactId>spring-cloud-alibaba-dependencies</artifactId>  
    <version>2.2.5.RELEASE</version>  
    <type>pom</type>  
    <scope>import</scope>  
</dependency>

Submodule configuration access


<!-- nacos客户端依赖包 -->  
<dependency>  
    <groupId>com.alibaba.cloud</groupId>  
    <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>  
</dependency>

yml configuration


spring:  
  application:  
    # user服务的服务名称  
    name: userService  
  cloud:  
    nacos:  
      server-addr: localhost:8848 # nacos服务地址

Guess you like

Origin blog.csdn.net/Quiet_tomcat/article/details/124267545