对此有什么解决方案?我尝试从头开始设置新的VPC。 我在孟买地区创建了一个CIDR 10.0.0.0/16的VPC。 并创建了Internet Gate方式并将其附加到这些VPC。 创建了两个子网 1)10.0.1.0/24,具有公共IP,在US-East-1a可用区中 2)10.0.2.0/24在可用区域US-East-1b中没有公共IP 两个子网位于不同的区域
创建两个路由表 1.使用公用子网(10.0.1.0/24)路由table1并添加Internet网关。 2.使用私有子网(10.0.2.0/24)在没有Internet网关的情况下路由Table2
修改了默认的网络ACL,仅允许HTTP,HTTPS,TELNET,SSH的入站流量 对于出站流量-全部允许
然后我使用PUBLIC SUBNET(10.0.1.0/24)启动了一个EC2实例 这些EC2实例具有公用IP和专用IP。 和EC2安全组 INBOUND- HTTP,HTTPS,SSH for 0.0.0.0/0 出站-ALL为0.0.0.0/0
我能够登录ec2控制台和sudo -i成为sudo用户
确认我能够正确连接到互联网
ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=56 time=1.27 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=56 time=1.39 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=56 time=1.43 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 1.270/1.366/1.438/0.082 ms
然后当我尝试执行yum update -y或尝试执行yum安装httpd时
我遇到了以下错误
“#yum更新-y
Loaded plugins: priorities, update-motd, upgrade-helper
Could not retrieve mirrorlist http://repo.ap-south-1.amazonaws.com/latest/main/mirror.list error was
12: Timeout on http://repo.ap-south-1.amazonaws.com/latest/main/mirror.list: (28,
'Resolving timed out after 5515 milliseconds')
One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Disable the repository, so yum won't use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage:
yum-config-manager --disable <repoid>
4. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
当我使用Public Ip启动实例并拥有Internet Gateway和 为ec2实例级别打开了HTTP,HTTPS,SSH端口 对于VPC级别-HTTP,HTTPS,SSH,TELENET已针对入站打开,仍然出现上述错误。?
答案 0 :(得分:0)
尝试执行yum repolist并查看存储库是否可用,还可以提供“ /etc/yum.repos.d/*”的配置文件以查看存储库文件中是否存在任何错误。
答案 1 :(得分:0)
我认为您必须为自定义VPC启用DNS解析,这可能会解决您的问题。