This version is based on Spring Cloud (finchley.release) Spring boot ( 2.0.4.RELEASE )
Step on the pit 1:spring cloud from 2.0. In a few starts, the dependency package that needs to be introduced will change. The biggest feature is spring-cloud-starter-Netflix, where many dependent components are provisioned with Maven with one more Netflix ( previously none )
Step 2: If the version of Spring Cloud does not match the dependent component version, a direct error occurs. Typically MAVEN relies on not finding the corresponding JAR package
PS: If you are unsure of the version number of the corresponding jar, go to (https://projects.spring.io/spring-cloud/#quick-start) Spring The cloud's official web will have a matching maven dependency.
Before the construction, oneself also looked a lot of raiders, in the mind has a probably after, started to open dry. Discover the many tips on the Web The spring boot version still stays in 1.5.* . Currently the newest is 2.0.4, the spring cloud version of the latest isFinchley.SR1(2018.8.31)。
The spirit of backwardness will be beaten principle, resolutely choose the latest version to start.
Spring Eureka It has two packages based on the Netfix Eureka, and is primarily responsible for the service governance functions in the microservices architecture. Spring Cloud adds spring boot-style automation to Eureka, and we just need to make spring boot build microservices apps easy to integrate with the Eureka Service governance system by simply introducing dependency and annotation configurations. In short, the registry, the micro-service so many always have a centralized management and review. Because it is easy to manage andlook , I've integrated all of my microservices into a maven project, Parent pom files for all microservices: the dependent files for the Spring Eureka Pom are posted below:
Application.properties's File contents
There is a pit: if it is a yml file, you need to pay attention to defaultzone This field, in many strategies on the Internet yml write is default-zone
If you want to customize the port number, the word must use defaultzone, otherwise he will default to use the 8671 port number (mainly refers to the service provider, business layer, etc.). You'll find that you're clearly configured with a different port but you're not connected .
Probably the error is this way, below upload two Micro service registration failed console error code:
The general configuration of the Eureka is still relatively simple, and tomorrow Update Spring Config How to implement local configuration parts read (most of the web is to read the Git repository).
Spring Cloud Initial build 1-1 (Eureka configuration)