Eureka deployment in AWS Cloud does not Provide Private IP

625 views
Skip to first unread message

prasenjit majumder

unread,
Nov 11, 2015, 7:39:52 AM11/11/15
to eureka_netflix
Hi,

I have made a deployment like below in one AWS zone.

   1. There are 3 EC2 instances running in the same zone.
   2. EC2 instance 1 is hosting Eureka ( Eureka Server with Runtime Property as -Deureka.datacenter=cloud)
   3. EC2 instance 2 is hosting one Microservice (MS1)
   4. EC2 instance 3 is hosting another Microservice (MS2)

Microservice (MS1) needs to invoke microservice (MS2) and for that it uses Ribbon-Eureka client to discover the service URL of microservice (MS2) from Eureka server. Now when Ms1 and MS2 are getting registered in Eureka server, the "Status" Column in showing corresponding EC2 instances host name. However, while MS1 is trying to invoke MS2 using Ribbon-Eureka client, the service URL that it is getting from Eureka server is neither having private IP of the corresponding EC2 instance nor the host name that is showing up on the Eureka dashboard. Instead, the service URL is having some IP address which is same as what I am getting through the command "hostname -i" on that specific EC2 instance. As a result MS1 fails to invoke MS2.

I am not clear, if any configuration is needed so that Eureka server returns private IP of the EC2 instance in the service URL. Or anything else that can resolve the above issue.

If someone can provide some input on how to resolve the above issue, it will be very helpful.




dl...@netflix.com

unread,
Nov 11, 2015, 9:08:27 PM11/11/15
to eureka_netflix
Hi Prasenjit,

Can I get some more clarifying information from you regarding you set up? If possible, can you please let me know (feel free to obfuscate the real ips/hostnames) the following information for MS1 and MS2:
for the registered records within the eureka server, what the values for the labels fieldA ... fieldF are (again if you need to obfuscate, please just let me know which of the fields are equal) in their respective InstanceInfo records:

{
    "dataCenterInfo": {
        "@class": "com.netflix.appinfo.AmazonInfo",
        "metadata": {
            "local-hostname": "fieldA",
            "local-ipv4": "fieldB",
            "public-hostname": "fieldC",
            "public-ipv4": "fieldD"
        },
        "name": "Amazon"
    },
    "hostName": "fieldE",
    "ipAddr": "fieldF",
    ...
}

Thanks.

prasenjit majumder

unread,
Nov 12, 2015, 12:38:53 AM11/12/15
to eureka_netflix
Hi,

The details we have got by running our instance:

{
    "dataCenterInfo": {
        "@class": "com.netflix.appinfo.AmazonInfo",
        "metadata": {
            "local-hostname": "ip-10-232-50-110.us-west-2.compute.internal",
            "local-ipv4": "10.232.50.110",
            "public-hostname": "ec2-54-188-84-247.us-west-2.compute.amazonaws.com",
            "public-ipv4": "54.188.84.247"
        },
        "name": "Amazon"
    },
    "hostName": "ip-10-254-148-224",
    "ipAddr": "10.254.148.224",
    ...
}

dl...@netflix.com

unread,
Nov 12, 2015, 2:32:43 PM11/12/15
to eureka_netflix
Hi Prasenjit,

Thanks for providing the information. The information does not look synced, which could explain why your microservices are unable to communicate. Are you by any chance running in VPC with extra ENIs attached? From the data provided, the hostName and ipAddr fields are completely different from both of the local-* and public-* fields in the AmazonInfo struct. what ip does running a hostname -i on this instance return?

Thanks
Reply all
Reply to author
Forward
0 new messages