Spring Cloud Eureka 2 (Eureka Server build Service registration Center)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.