Integration of spring cloud cloud service architecture - HongHu commonservice-eureka project construction process

Now we build the following for the eureka project of HongHu cloud. The whole process of building is very simple. I will record every step of the process. I hope it can help you:

1. Create a maven project named particle-common-eureka and inherit particle-commonservice. The specific pom.xml configuration file is as follows:

<?xml version="1.0" encoding="UTF-8"?><project xmlns="" xmlns:xsi=""



	<description>particle-commonservice project for Spring Boot</description>




2. Refer to the configuration of eureka at the startup class entry. The code is as follows:


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import;@EnableEurekaServer@SpringBootApplicationpublic class ServiceApplication {	public static void main(String[] args) {, args);

3. Configure the application.yml file

 server (default port: 8761) server: port: 8761 spring: application: name: particle-commonservice-erueka eureka: client: 
    # Register to Eureka register-with-eureka: true
    123456@localhost:8761/eureka/ defaultZone: http://honghu:123456@localhost:8761/eureka/ defaultZone: http://honghu:123456@localhost:8761/eureka/ defaultZone: @localhost:8761/eureka/ preferred-address: hostname: true Zone: honghuZone; user: ${security. user. name} password: {security. user. password}      
   Designated environment: dev  Designated data center: Honghu  Closed self-protection mode server: enable-self-preservation: false
  # Set the time interval for cleaning up invalid nodes by default of 60000, that is 60s eviction-interval-timer-in-ms: 60000 service authentication security: basic: enabled: true user: name: Honghu password: 123456 management: security: enabled: false

4. Increase the project's log mechanism and package operation mechanism (we will write the package deployment mechanism for Linux Centos in detail later)

5. Since then, the whole project has been deployed and Run As - > Spring Boot App has been manually implemented. The results are as follows:

Console operation results:

Access the console and log in:

Console operation effect:

From now on, I will record the construction process and essence of the spring cloud micro-service Cloud Architecture recently developed, and help more friends who are interested in developing the spring cloud framework, hoping to help more good scholars. Let's discuss the process of building spring cloud architecture and how to apply it to industry projects. Source Source

Tags: Java Spring Maven xml Apache

Posted on Wed, 19 Dec 2018 22:18:05 -0800 by FarhanKhalaf