Detailed spring cloud Eureka multi network card configuration summary

When deploying Eureka high availability solution on the Linux host, it was found that the service IP registered in the service center was random. Since the host had multiple network cards, the random IP was not what you wanted. I checked some information on the Internet and summarized it as follows:

1. Ignore network card: spring cloud. inetutils. ignored-interfaces

2 specify IP: spring cloud. inetutils. preferred-networks

3. Modify the host file

When the network search traversal logic fails to find the appropriate IP, it will go to InetAddress of JDK getLocalHost()。 This method will return the hostname of the current host, and then resolve the corresponding IP according to the hostname. Therefore, the second scheme is to configure the host name and / etc / hosts files of the local machine, and directly map the host name of the local machine to a valid IP address.

4 specify instance IP

5 through jar command parameters

The above novices have been tossing about all afternoon. We have a good way to communicate together. We hope it will be helpful to your study and support more programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>