Should I use public IP or private IP for connecting servers within the same VPC?

by Hooman Bahreini   Last Updated May 16, 2019 00:00 AM

I have 2 Linux servers on AWS. Both servers are in the default vpc (aws default vpc). Both of these servers have their own Elastic IP. I also have a webServer which is inside the same vpc.

I want to run a replicated MySQL on these 2 servers, so one server would be master and the other slave.

I need to provide an ip address for each MySQL server, so in my.cnf, there is a setting: bind-address

Should I use the public or private IP for the bind-address or the private IP? (All the computers who need access to MySQL server are in the same vpc).

Note both servers are in the same Security Group and I have opened all the ports within the security group.



Related Questions


Updated June 13, 2019 16:00 PM

Updated December 04, 2015 22:00 PM

Updated December 18, 2017 23:00 PM

Updated January 03, 2018 19:00 PM

Updated May 08, 2019 16:00 PM