(Spring Cloud microservices in practice - the pit in the book) spring cloud eureka reports an error host name may not be null

1. Requirements, now general projects try to choose to configure in the form of domain names. For example, eureka can use IP to define defaultZone, but we choose the computer name of the intranet to specify to prevent IP changes.

2. In the book, the description is registered by the computer name by default, and I use the docker container to deploy eureka, the -h parameter of docker is defined as "maolujun_v5_eureka", then eureka, you need to define defaultZone through maolujun_v5_eureka. Such as:

3. As a result, each startup will report an error: host name may not be

4. Processing method:

General maolujun_v5_eureka Reform maolujun-v5-eureka

Because java.net.URI cannot distinguish underscores in eureka,

So remember, when using host as the defaultZone configuration, do not name underscores

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324456254&siteId=291194637