{"action":"created","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/573","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/573/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/573/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/573/events","html_url":"https://github.com/spring-cloud/spring-cloud-netflix/issues/573","id":109743590,"number":573,"title":"Eureka: ApplicationInfoManager overrides the ip-address set by config","user":{"login":"brenuart","id":3028601,"avatar_url":"https://avatars.githubusercontent.com/u/3028601?v=3","gravatar_id":"","url":"https://api.github.com/users/brenuart","html_url":"https://github.com/brenuart","followers_url":"https://api.github.com/users/brenuart/followers","following_url":"https://api.github.com/users/brenuart/following{/other_user}","gists_url":"https://api.github.com/users/brenuart/gists{/gist_id}","starred_url":"https://api.github.com/users/brenuart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brenuart/subscriptions","organizations_url":"https://api.github.com/users/brenuart/orgs","repos_url":"https://api.github.com/users/brenuart/repos","events_url":"https://api.github.com/users/brenuart/events{/privacy}","received_events_url":"https://api.github.com/users/brenuart/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-05T07:31:13Z","updated_at":"2016-01-20T09:05:03Z","closed_at":null,"body":"(Version: 1.1.0.M1)\r\n\r\nSuppose a container environment like Docker. In this case, you want you Eureka client to register with its public IP and not with its private IP. In this case you would use the following configuration:\r\n```\r\neureka.instance.prefer-ip-address= true\r\neureka.instance.ip-address= <publicIP>\r\n```\r\n\r\nUnfortunately, at some point the `ApplicationInfoManager` complains about the hostname having changed:\r\n```\r\ncom.netflix.appinfo.ApplicationInfoManager : The public hostname changed from : <publicIP> => <privateIP>\r\n```\r\nThe `ApplicationInfoManager` compares the hostname provided by `EurekaInstanceConfig` and `InstanceInfo`. However, one should remember that `EurekaInstanceConfig.getHostname()` returns the hostname OR the IP address depending on whether `eureka.instance.prefer-ip-address` is true or false. If you opt for \"prefer ip address\", then the `ApplicationInfoManager` is likely to always detect a change...\r\n\r\nNote: description of this scenario was originally posted in https://github.com/spring-cloud/spring-cloud-netflix/issues/565 but was not the root cause of user's problem."},"comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/comments/173135163","html_url":"https://github.com/spring-cloud/spring-cloud-netflix/issues/573#issuecomment-173135163","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/573","id":173135163,"user":{"login":"pcornelissen","id":1177440,"avatar_url":"https://avatars.githubusercontent.com/u/1177440?v=3","gravatar_id":"","url":"https://api.github.com/users/pcornelissen","html_url":"https://github.com/pcornelissen","followers_url":"https://api.github.com/users/pcornelissen/followers","following_url":"https://api.github.com/users/pcornelissen/following{/other_user}","gists_url":"https://api.github.com/users/pcornelissen/gists{/gist_id}","starred_url":"https://api.github.com/users/pcornelissen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcornelissen/subscriptions","organizations_url":"https://api.github.com/users/pcornelissen/orgs","repos_url":"https://api.github.com/users/pcornelissen/repos","events_url":"https://api.github.com/users/pcornelissen/events{/privacy}","received_events_url":"https://api.github.com/users/pcornelissen/received_events","type":"User","site_admin":false},"created_at":"2016-01-20T09:05:03Z","updated_at":"2016-01-20T09:05:03Z","body":"I am suffering from this bug too, I can't force a given hostname or IP, because the ApplicationInfoManager decides to act differently. In the log I get:\r\n\r\nApplicationInfoManager       : The public hostname changed from : 127.0.0.1 => aa.zz.yy.xx\r\n\r\nIn this try I tried to force the IP by: -Deureka.instance.ip-address=127.0.0.1 -Dserver.address=127.0.0.1"}}