CentOS 的yum时出现问题且不能上网

这是一个求助帖!!!

在配置Hadoop的过程中,CentOS不能上网,不能yum。网线是连接的,
并且网卡也是开启状态。

情况如下:

执行:sudo yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel

我们信任您已经从系统管理员那里了解了日常注意事项。
总结起来无外乎这三点:

#1) 尊重别人的隐私。
#2) 输入前要先考虑(后果和风险)。
#3) 权力越大,责任越大。

[sudo] hadoop 的密码:
已加载插件:fastestmirror, langpacks
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"

One of the configured repositories failed (未知),
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. Run the command with the repository temporarily disabled
        yum --disablerepo=<repoid> ...

 4. Disable the repository permanently, 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>
    or
        subscription-manager repos --disable=<repoid>

 5. 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

Cannot find a valid baseurl for repo: base/7/x86_64
[hadoop@localhost ~]$

检查网络配置信息如下:
cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="dhcp"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
UUID="******和谐*****“
DEVICE="ens33"
ONBOOT="yes"

在连接网线后仍不能上网,情况如下:
[hadoop@localhost ~]$ ping 172.22.8.** -c 3
PING 172.22.8.** (172.22.8.**) 56(84) bytes of data.
64 bytes from 172.22.8.**: icmp_seq=1 ttl=64 time=0.036 ms
64 bytes from 172.22.8.**: icmp_seq=2 ttl=64 time=0.039 ms
64 bytes from 172.22.8.**: icmp_seq=3 ttl=64 time=0.037 msyang

--- 172.22.8.###ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.036/0.037/0.039/0.005 ms
[hadoop@localhost ~]$ ping www.baidu.com
ping: www.baidu.com: 未知的名称或服务

原来我是装好了Hadoop集群的,可是由于一些错误我把原来的centos给
卸载了,现在想重装却遇到了原来没遇到的问题。

希望能遇到大佬,帮偶这个小白解决问题,不要让这个问题来阻挡我学习的
步伐了!

1个回答

1、先ping 下 网关
2、看下服务器的dns是不是出现什么问题了
3、配置静态路由

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐