大网数据广告活动
服务器运维问答

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

· 52CE 我爱测

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 thes…

问题原文

原帖链接 · Hooman Bahreini · CC BY-SA 4.0

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? (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.

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 4.0

You should use internal IP addresses for your instances to talk to each other. If you use their public or elastic IP addresses, you are charged for in-region network data transfer. There is no charge for using the private IP addresses.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-05-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。