Tools: IntelliJ idea 2017.1.2 x64, maven3.3.9
Open IDE File===>new===>project
Next
Next
Select the appropriate dependency
Next
Finish
Check out the above two dependencies we selected in Pom.xml
Starting a service registry with @enableeurekaserver annotations
By default, the service registry tries to register itself as a client, so we need to disable its client behavior by simply configuring it in Application.properties:
# Specify the port number of the service
server.port=1111
# Registration Center Instance Name
Eureka.instance.hostname=localhost
# indicates that you do not register yourself with the registry
Eureka.client.register-with-eureka=false
# because the registry's responsibility is to maintain the service instance and not need to retrieve the instance so set to False
Eureka.client.fetch-registry=false
eureka.client.serviceurl.defaultzone=http://${eureka.instance.hostname}:${server.port}/eureka/
Start Project
Access the Service Registration Center page via http://localhost:1111
The service registry based on Eureka Server is built.
Spring Cloud Eureka 2 (Eureka Server build Service registration Center)