重装ambari的yum源自动修改的解决方法
作者:互联网
最近在重装ambari的适合,遇到yum清理的时候,无法清理,从报错看,是由于一个yum资源文件无法解析造成,然后顺着日志找
[root@xcyhdp03 ~]# yum clean all Loaded plugins: fastestmirror Cleaning repos: HDP-2.6-repo-1 HDP-2.6.4.0 HDP-GPL-2.6.4.0 HDP-UTILS-1.1.0.22 HDP-UTILS-1.1.0.22-repo-1 ambari-2.6.1.5 base extras updates Cleaning up list of fastest mirrors [root@xcyhdp03 ~] [root@xcyhdp03 ~] [root@xcyhdp03 ~]# yum makecache Loaded plugins: fastestmirror Determining fastest mirrors http://public-repo-1.hortonworks.com/HDP-GPL/centos7/2.x/updates/2.6.4.0/repodata/repomd.xml: [Errno 14] HTTP Error 403 - Forbidden Trying other mirror. To address this issue please refer to the below wiki article https://wiki.centos.org/yum-errors If above article doesn't help to resolve this issue please use https://bugs.centos.org/. One of the configured repositories failed (HDP-2.6-GPL-repo-1), 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=HDP-2.6-GPL-repo-1 ... 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 HDP-2.6-GPL-repo-1 or subscription-manager repos --disable=HDP-2.6-GPL-repo-1 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=HDP-2.6-GPL-repo-1.skip_if_unavailable=true
发现/etc/yum.repos.d/HDP-2.6-GPL-repo-1.yum中,有一个源是HDP-2.6-GPL-repo-1,它的baseurl,用的是国外的网站http://public-repo-1.hortonworks.com,无法访问,造成无法使用yum源
[HDP-2.6-repo-1] name=HDP-2.6-repo-1 baseurl=http://192.168.56.40/yum/HDP/centos7/2.6.4.0-91/ path=/ enabled=1 gpgcheck=0 [HDP-2.6-GPL-repo-1] name=HDP-2.6-GPL-repo-1 baseurl=http://public-repo-1.hortonworks.com/HDP-GPL/centos7/2.x/updates/2.6.4.0 path=/ enabled=1 gpgcheck=0 [HDP-UTILS-1.1.0.22-repo-1] name=HDP-UTILS-1.1.0.22-repo-1 baseurl=http://192.168.56.40/yum/HDP-UTILS/centos7/1.1.0.22/ path=/ enabled=1 gpgcheck=0
自然习惯性的就删除掉中间那段yum配置,但是重新安装的时候,发现这段被注释的yum源又重新恢复了,看来这段yum配置,应该是保存在ambari的数据库,或者是ambari-server节点的yum源上,经过查找,终于在ambari源数据库的repo_version表,找到yum源的配置 repositories字段中和version_xml都有三个repo配置,其原理是,如果yum源中已经配置,则不修改,如果没配置,就会添加进去 手动修改将其中不需要的地方删除,再次更新回数据库中
删掉红色中的内容,再保存回数据库
测试更新yum源,ok
[root@xcyhdp01 yum.repos.d]# yum clean all Loaded plugins: fastestmirror Cleaning repos: HDP-2.6-repo-1 HDP-2.6.4.0 HDP-GPL-2.6.4.0 HDP-UTILS-1.1.0.22 HDP-UTILS-1.1.0.22-repo-1 ambari-2.6.1.5 base extras updates Cleaning up list of fastest mirrors [root@xcyhdp01 yum.repos.d]# yum makecache Loaded plugins: fastestmirror Determining fastest mirrors HDP-2.6-repo-1 | 2.9 kB 00:00:00 HDP-2.6.4.0 | 2.9 kB 00:00:00 HDP-GPL-2.6.4.0 | 2.9 kB 00:00:00 HDP-UTILS-1.1.0.22 | 2.9 kB 00:00:00 HDP-UTILS-1.1.0.22-repo-1 | 2.9 kB 00:00:00 ambari-2.6.1.5 | 2.9 kB 00:00:00 base | 3.6 kB 00:00:00 extras | 2.9 kB 00:00:00 updates | 2.9 kB 00:00:00 (1/28): HDP-2.6-repo-1/filelists_db | 421 kB 00:00:00 (2/28): HDP-2.6-repo-1/other_db | 14 kB 00:00:00 (3/28): HDP-2.6.4.0/filelists_db | 421 kB 00:00:00 (4/28): HDP-2.6.4.0/primary_db | 99 kB 00:00:00 (5/28): HDP-2.6.4.0/other_db | 14 kB 00:00:00 (6/28): HDP-2.6-repo-1/primary_db | 99 kB 00:00:00 (7/28): HDP-GPL-2.6.4.0/filelists_db | 1.2 kB 00:00:00 (8/28): HDP-GPL-2.6.4.0/primary_db | 2.9 kB 00:00:00 (9/28): HDP-GPL-2.6.4.0/other_db | 867 B 00:00:00 (10/28): HDP-UTILS-1.1.0.22/primary_db | 8.5 kB 00:00:00 (11/28): HDP-UTILS-1.1.0.22/filelists_db | 2.9 kB 00:00:00 (12/28): HDP-UTILS-1.1.0.22/other_db | 5.5 kB 00:00:00 (13/28): HDP-UTILS-1.1.0.22-repo-1/filelists_db | 2.9 kB 00:00:00 (14/28): HDP-UTILS-1.1.0.22-repo-1/primary_db | 8.5 kB 00:00:00 (15/28): HDP-UTILS-1.1.0.22-repo-1/other_db | 5.5 kB 00:00:00 (16/28): ambari-2.6.1.5/filelists_db | 168 kB 00:00:00 (17/28): ambari-2.6.1.5/primary_db | 8.6 kB 00:00:00 (18/28): ambari-2.6.1.5/other_db | 1.3 kB 00:00:00 (19/28): base/7/x86_64/group_gz | 153 kB 00:00:00 (20/28): base/7/x86_64/filelists_db | 7.2 MB 00:00:19 (21/28): extras/7/x86_64/primary_db | 242 kB 00:00:07 (22/28): extras/7/x86_64/other_db | 143 kB 00:00:00 (23/28): extras/7/x86_64/filelists_db | 235 kB 00:00:07 (24/28): updates/7/x86_64/primary_db | 8.8 MB 00:00:01 (25/28): updates/7/x86_64/other_db | 681 kB 00:00:01 (26/28): updates/7/x86_64/filelists_db | 5.1 MB 00:00:07 base/7/x86_64/primary_db FAILED 86% [=================================================================================================================== ] 321 kB/s | 28 MB 00:00:13 ETA https://mirrors.tuna.tsinghua.edu.cn/centos/7/os/x86_64/repodata/6d0c3a488c282fe537794b5946b01e28c7f44db79097bb06826e1c0c88bad5ef-primary.sqlite.bz2: [Errno 12] Timeout on https://mirrors.tuna.tsinghua.edu.cn/centos/7/os/x86_64/repodata/6d0c3a488c282fe537794b5946b01e28c7f44db79097bb06826e1c0c88bad5ef-primary.sqlite.bz2: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds') Trying other mirror. base/7/x86_64/other_db FAILED 80% [==========================================================================================================- ] 28 B/s | 26 MB 66:45:31 ETA https://mirrors.tuna.tsinghua.edu.cn/centos/7/os/x86_64/repodata/ecaab5cc3b9c10fefe6be2ecbf6f9fcb437231dac3e82cab8d9d2cf70e99644d-other.sqlite.bz2: [Errno 12] Timeout on https://mirrors.tuna.tsinghua.edu.cn/centos/7/os/x86_64/repodata/ecaab5cc3b9c10fefe6be2ecbf6f9fcb437231dac3e82cab8d9d2cf70e99644d-other.sqlite.bz2: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds') Trying other mirror. (27/28): base/7/x86_64/primary_db | 6.1 MB 00:00:00 (28/28): base/7/x86_64/other_db | 2.6 MB 00:00:00 Metadata Cache Created
标签:重装,kB,00,ambari,HDP,28,repo,yum,2.6 来源: https://www.cnblogs.com/byzgss/p/15004017.html