Master “Version H & Alibaba & Link Tracking & Logging & Transaction & Lock”

The default file is 1610014380163

Tutorial full directory contains “video” : https://gitee.com/bingqilinpeishenme/Java-Wiki

image-20210107185205249

Nacos service registration and discovery

SpringCloud Alibaba

https://github.com/alibaba/spring-cloud-alibaba/blob/master/README-zh.md

Spring Cloud Alibaba is committed to providing a one-stop solution for microservice development. This project contains the necessary components for developing distributed application microservices that developers can easily use to develop distributed application services through the Spring Cloud programming model.

Relying on Spring Cloud Alibaba, you only need to add some annotations and a little configuration, you can plug Spring Cloud application into Ali Micro service solution, and quickly build distributed application system through Ali middleware.

Nacos basic use

Introduction and Installation

A dynamic service discovery, configuration management and service management platform that makes it easier to build cloud native applications. Nacos= Registry + Configuration center

Official document: https://nacos.io/zh-cn/docs/quick-start-spring-cloud.html

The installation

  1. Download https://github.com/alibaba/Nacos

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

  2. Unpack the

  3. Start by command

    image-20200704220347231
  4. Visit http://localhost:8848/nacos/#/login account password is: nacos

The basic use

The order service was transformed to the Nacos client

  1. Import dependence

    <! --> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> </dependency>Copy the code
  2. configuration

    server.port=8803



    spring.application.name=nacos-order



    Registry address

    spring.cloud.nacos.discovery.server-addr=localhost:8848

    Copy the code
  3. The start class annotates @enableDiscoveryClient

  4. The startup project is visible in the registry

    image-20210106184114396

Difference between Nacos and Eureka

image-20210106184123413

Note: See a follow-up article on configuration management and cluster deployment

If you find this article helpful:

  1. Click “like” to support it, so that more people can see this content.

  2. Share your thoughts with me in the comments section, and record your thought process in the comments section.

  3. If you feel good, you can also follow the personal public account of programming deer to see more articles and explanation videos (thank you for your encouragement and support 🌹🌹🌹)