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.