I first describe the use of the environment, and then the problem,
Using the environment description:
With low version rancher management docker, build springcloud micro service system, before the container mirror is using a docker bridge mode,
But due to low version rancher appeared a DNS problem, in some container on host cannot get rancher address is http://rancher-medata.
Internet a rancher upgrade can solve this problem, but because of the present platform management host is more, can't upgrade,
So, I'll try the container network model instead of the host, such making that the container directly using the current IP host machine, binding to use the service,
Problem description:
In the container before the mirror when using bridge mode, mirror services up to use the container allocation of IP, netstat listening port is in form,... : 9001 or * : 9001. So with the host IP landing site, directly forwarded to port 9001, walk docker0 can use,
But when using the host network model of time, I in the container using the host's IP to start springcloud service, but no matter how do I modify the micro service of IP, the hostname, netstat found listener port is, in the form of 127.0.0.1:9001. The service is always automatically bind to 127.0.0.1, so I use the host's IP login service, can't get to, only in the native 127.0.0.1,
That's the problem,
Hope god help to look at, how to make the vessel in host mode, start the micro service is bound to... : 9001, or directly tied to the current IP host machine, XXX, XXX, XXX, XXX: 9001.
Or by iptables configuration, forwarding the request of the hosting IP to 127.0.0.1 address, so that we can use it, because there is no tried and still bother the great god to help us see,
Problem is, if the description is not clear, please leave a message, thank you