安装 Ambari 时遇到的异常记录


  • 由于最近公司机房断电,导致几台测试环境 Ambari 服务器损坏, 所以对 Ambari服务进行了重装, 下面对此次安装过程中遇见的问题与解决办法进行记录

1. 安装 unzip

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stack-hooks/before-INSTALL/scripts/hook.py", line 37, in <module>
    BeforeInstallHook().execute()
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 352, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/stack-hooks/before-INSTALL/scripts/hook.py", line 33, in hook
    install_packages()
  File "/var/lib/ambari-agent/cache/stack-hooks/before-INSTALL/scripts/shared_initialization.py", line 37, in install_packages
    retry_count=params.agent_stack_retry_count)
  File "/usr/lib/ambari-agent/lib/resource_management/core/base.py", line 125, in __new__
    cls(names_list.pop(0), env, provider, **kwargs)
  File "/usr/lib/ambari-agent/lib/resource_management/core/base.py", line 166, in __init__
    self.env.run()
  File "/usr/lib/ambari-agent/lib/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/ambari-agent/lib/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/ambari-agent/lib/resource_management/core/providers/packaging.py", line 30, in action_install
    self._pkg_manager.install_package(package_name, self.__create_context())
  File "/usr/lib/ambari-agent/lib/ambari_commons/repo_manager/yum_manager.py", line 219, in install_package
    shell.repository_manager_executor(cmd, self.properties, context)
  File "/usr/lib/ambari-agent/lib/ambari_commons/shell.py", line 753, in repository_manager_executor
    raise RuntimeError(message)
RuntimeError: Failed to execute command '/usr/bin/yum -y install unzip', exited with code '1', message: '

 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. 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: HDP-3.1-repo-2
  • 下载
# 下载地址
http://www.rpmfind.net/linux/rpm2html/search.php?query=unzip&submit=Search+...&system=centos&arch=
# 下载文件
unzip-6.0-46.el8.x86_64.rpm

# 或者 
wget http://www.rpmfind.net/linux/centos/8-stream/BaseOS/x86_64/os/Packages/unzip-6.0-46.el8.x86_64.rpm
  • 安装
#1.查看 unzip 是否被安装
rpm -qa | grep zip

# 2.先安装unzip:
rpm -ivh unzip-6.0-46.el8.x86_64.rpm

2. missing libmysqlclient.so.18()(64bit)

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package ambari-metrics-monitor.x86_64 0:2.7.3.0-139 will be installed
--> Processing Dependency: python-devel for package: ambari-metrics-monitor-2.7.3.0-139.x86_64
--> Processing Dependency: gcc for package: ambari-metrics-monitor-2.7.3.0-139.x86_64
--> Finished Dependency Resolution
Error: Package: ambari-metrics-monitor-2.7.3.0-139.x86_64 (ambari-2.7.3.0)
           Requires: gcc
Error: Package: ambari-metrics-monitor-2.7.3.0-139.x86_64 (ambari-2.7.3.0)
           Requires: python-devel
 You could try using --skip-broken to work around the problem
** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
2:postfix-2.10.1-9.el7.x86_64 has missing requires of libmysqlclient.so.18()(64bit)
2:postfix-2.10.1-9.el7.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit)
  • 原因

缺少包

  • 解决 安装 RPM 包

重点关注:libmysqlclient.so.18()(64bit)

# 下载
wget http://www.percona.com/redir/downloads/Percona-XtraDB-Cluster/5.5.37-25.10/RPM/rhel6/x86_64/Percona-XtraDB-Cluster-shared-55-5.5.37-25.10.756.el6.x86_64.rpm

# 安装
rpm -ivh Percona-XtraDB-Cluster-shared-55-5.5.37-25.10.756.el6.x86_64.rpm

3. Cannot find a valid baseurl for repo: HDP-UTILS-1.1.0.22-repo-2

  • 报错日志
2023-03-08 11:48:20,944 - The 'hadoop-hdfs-datanode' component did not advertise a version. This may indicate a problem with the component packaging.
Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/HDFS/package/scripts/datanode.py", line 126, in <module>
    DataNode().execute()
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 352, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/HDFS/package/scripts/datanode.py", line 45, in install
    self.install_packages(env)
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 839, in install_packages
    name = self.format_package_name(package['name'])
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 562, in format_package_name
    return self.get_package_from_available(name)
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 529, in get_package_from_available
    raise Fail("No package found for {0}(expected name: {1})".format(name, name_with_version))
resource_management.core.exceptions.Fail: No package found for hadoop_${stack_version}(expected name: hadoop_3_1)
stdout:   /var/lib/ambari-agent/data/output-247.txt
2023-03-08 11:48:14,746 - Stack Feature Version Info: Cluster Stack=3.1, Command Stack=None, Command Version=None -> 3.1
2023-03-08 11:48:14,754 - Using hadoop conf dir: /usr/hdp/current/hadoop-client/conf
2023-03-08 11:48:14,756 - Group['hdfs'] {}
2023-03-08 11:48:14,757 - Group['hadoop'] {}
2023-03-08 11:48:14,758 - Group['users'] {}
2023-03-08 11:48:14,758 - User['zookeeper'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2023-03-08 11:48:14,759 - User['ams'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2023-03-08 11:48:14,760 - User['ambari-qa'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop', 'users'], 'uid': None}
2023-03-08 11:48:14,761 - User['hdfs'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hdfs', 'hadoop'], 'uid': None}
2023-03-08 11:48:14,762 - File['/var/lib/ambari-agent/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2023-03-08 11:48:14,763 - Execute['/var/lib/ambari-agent/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa 0'] {'not_if': '(test $(id -u ambari-qa) -gt 1000) || (false)'}
2023-03-08 11:48:14,773 - Skipping Execute['/var/lib/ambari-agent/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa 0'] due to not_if
2023-03-08 11:48:14,774 - Group['hdfs'] {}
2023-03-08 11:48:14,775 - User['hdfs'] {'fetch_nonlocal_groups': True, 'groups': ['hdfs', 'hadoop', u'hdfs']}
2023-03-08 11:48:14,775 - FS Type: HDFS
2023-03-08 11:48:14,776 - Directory['/etc/hadoop'] {'mode': 0755}
2023-03-08 11:48:14,776 - Directory['/var/lib/ambari-agent/tmp/hadoop_java_io_tmpdir'] {'owner': 'hdfs', 'group': 'hadoop', 'mode': 01777}
2023-03-08 11:48:14,797 - Repository['HDP-3.1-repo-2'] {'base_url': '', 'action': ['prepare'], 'components': [u'HDP', 'main'], 'repo_template': '[{{repo_id}}]\nname={{repo_id}}\n{% if mirror_list %}mirrorlist={{mirror_list}}{% else %}baseurl={{base_url}}{% endif %}\n\npath=/\nenabled=1\ngpgcheck=0', 'repo_file_name': 'ambari-hdp-2', 'mirror_list': None}
2023-03-08 11:48:14,810 - Repository['HDP-UTILS-1.1.0.22-repo-2'] {'base_url': '', 'action': ['prepare'], 'components': [u'HDP-UTILS', 'main'], 'repo_template': '[{{repo_id}}]\nname={{repo_id}}\n{% if mirror_list %}mirrorlist={{mirror_list}}{% else %}baseurl={{base_url}}{% endif %}\n\npath=/\nenabled=1\ngpgcheck=0', 'repo_file_name': 'ambari-hdp-2', 'mirror_list': None}
2023-03-08 11:48:14,815 - Repository['HDP-3.1-GPL-repo-2'] {'base_url': 'http://public-repo-1.hortonworks.com/HDP-GPL/centos7/3.x/updates/3.1.0.0', 'action': ['prepare'], 'components': [u'HDP-GPL', 'main'], 'repo_template': '[{{repo_id}}]\nname={{repo_id}}\n{% if mirror_list %}mirrorlist={{mirror_list}}{% else %}baseurl={{base_url}}{% endif %}\n\npath=/\nenabled=1\ngpgcheck=0', 'repo_file_name': 'ambari-hdp-2', 'mirror_list': None}
2023-03-08 11:48:14,819 - Repository[None] {'action': ['create']}
2023-03-08 11:48:14,820 - File['/tmp/tmp1hcs68'] {'content': '[HDP-3.1-repo-2]\nname=HDP-3.1-repo-2\nbaseurl=\n\npath=/\nenabled=1\ngpgcheck=0\n[HDP-UTILS-1.1.0.22-repo-2]\nname=HDP-UTILS-1.1.0.22-repo-2\nbaseurl=\n\npath=/\nenabled=1\ngpgcheck=0\n[HDP-3.1-GPL-repo-2]\nname=HDP-3.1-GPL-repo-2\nbaseurl=http://public-repo-1.hortonworks.com/HDP-GPL/centos7/3.x/updates/3.1.0.0\n\npath=/\nenabled=1\ngpgcheck=0'}
2023-03-08 11:48:14,821 - Writing File['/tmp/tmp1hcs68'] because contents don't match
2023-03-08 11:48:14,822 - File['/tmp/tmpEskDfZ'] {'content': StaticFile('/etc/yum.repos.d/ambari-hdp-2.repo')}
2023-03-08 11:48:14,823 - Writing File['/tmp/tmpEskDfZ'] because contents don't match
2023-03-08 11:48:14,823 - Rewriting /etc/yum.repos.d/ambari-hdp-2.repo since it has changed.
2023-03-08 11:48:14,824 - File['/etc/yum.repos.d/ambari-hdp-2.repo'] {'content': StaticFile('/tmp/tmp1hcs68')}
2023-03-08 11:48:14,825 - Writing File['/etc/yum.repos.d/ambari-hdp-2.repo'] because contents don't match
2023-03-08 11:48:14,826 - Package['unzip'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2023-03-08 11:48:14,963 - Skipping installation of existing package unzip
2023-03-08 11:48:14,964 - Package['curl'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2023-03-08 11:48:14,974 - Skipping installation of existing package curl
2023-03-08 11:48:14,974 - Package['hdp-select'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2023-03-08 11:48:14,983 - Skipping installation of existing package hdp-select
2023-03-08 11:48:15,086 - call[('ambari-python-wrap', u'/usr/bin/hdp-select', 'versions')] {}
2023-03-08 11:48:15,126 - call returned (0, '')
2023-03-08 11:48:15,380 - Using hadoop conf dir: /usr/hdp/current/hadoop-client/conf
2023-03-08 11:48:15,382 - Stack Feature Version Info: Cluster Stack=3.1, Command Stack=None, Command Version=None -> 3.1
2023-03-08 11:48:15,410 - Using hadoop conf dir: /usr/hdp/current/hadoop-client/conf
2023-03-08 11:48:15,434 - Command repositories: HDP-3.1-repo-2, HDP-UTILS-1.1.0.22-repo-2, HDP-3.1-GPL-repo-2
2023-03-08 11:48:15,434 - Applicable repositories: HDP-3.1-repo-2, HDP-UTILS-1.1.0.22-repo-2, HDP-3.1-GPL-repo-2
2023-03-08 11:48:15,435 - Looking for matching packages in the following repositories: HDP-3.1-repo-2, HDP-UTILS-1.1.0.22-repo-2, HDP-3.1-GPL-repo-2
2023-03-08 11:48:15,671 - Command execution error: command = "/usr/bin/yum list available --showduplicates --disablerepo=* --enablerepo=HDP-3.1-repo-2", exit code = 1, stderr = 
 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. 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: HDP-3.1-repo-2
2023-03-08 11:48:17,303 - Command execution error: command = "/usr/bin/yum list available --showduplicates --disablerepo=* --enablerepo=HDP-UTILS-1.1.0.22-repo-2", exit code = 1, stderr = 
 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. 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: HDP-UTILS-1.1.0.22-repo-2
2023-03-08 11:48:20,895 - call[('ambari-python-wrap', u'/usr/bin/hdp-select', 'versions')] {}
2023-03-08 11:48:20,943 - call returned (0, '')
2023-03-08 11:48:20,944 - The 'hadoop-hdfs-datanode' component did not advertise a version. This may indicate a problem with the component packaging.
Command failed after 1 tries
```

- 解决方式

检查 yum 源的配置



## 4. repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

https://repo1.maven.org/maven2/com/facebook/presto/presto-server/0.279/presto-server-0.279.tar.gz



```bash
One of the configured repositories failed (HDP-3.1-repo-51),
 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-3.1-repo-51 ...
     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-3.1-repo-51
        or
            subscription-manager repos --disable=HDP-3.1-repo-51
     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-3.1-repo-51.skip_if_unavailable=true
failure: repodata/repomd.xml from HDP-3.1-repo-51: [Errno 256] No more mirrors to try.
http://192.168.71.100/hdp/HDP/centos7/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Desired version (2.7.3.0) of ambari-agent package is not available.
Connection to node1 closed.
SSH command execution finished
host=node1, exitcode=1
Command end time 2023-03-08 12:19:45
```

- 解决方式

在 配置的 httpd 的文件夹中查找  HDP 下面的 repodata 文件夹  复制到  /hdp/HDP/centos7 下面

例如我这里是 

```bash
# 找到对应文件夹的路径
[root@node1 3.1.0.0-78]# cd /var/www/html/hdp/HDP/centos7/3.1.0.0-78
# 确认该文件夹的存在
[root@node1 3.1.0.0-78]# ll | grep repod
drwxr-xr-x  2 zookeeper users  4096 Dec 11  2018 repodata

# 拷贝到指定目录
[root@node1 3.1.0.0-78]# cp -R repodata /var/www/html/hdp/HDP/centos7
```



## 5. httpd 配置的地址无法访问

这个地址无法访问了

http://s3.amazonaws.com/dev.hortonworks.com?delimiter=/&prefix=HDP/centos7/3.x/BUILDS/3.1.0.0-78/ 

![](https://images.hnbian.cn/202303150005563.png?imageView2/0/interlace/1/q/70%7Cwatermark/2/text/d3d3LmhuYmlhbi5jbg==/font/5b6u6L2v6ZuF6buR/fontsize/600/fill/IzBDMjU2NA==/dissolve/100/gravity/SouthEast/dx/10/dy/10%7Cimageslim)



- 解决方式

可以去对应的文件夹删除 index.html 文件

- 重启 

```bash
systemctl restart httpd
```

![重启之后即可访问](https://images.hnbian.cn/202303150005072.png?imageView2/0/interlace/1/q/70%7Cwatermark/2/text/d3d3LmhuYmlhbi5jbg==/font/5b6u6L2v6ZuF6buR/fontsize/600/fill/IzBDMjU2NA==/dissolve/100/gravity/SouthEast/dx/10/dy/10%7Cimageslim)



## 6. HDP-2.5: [Errno 256] No more mirrors to try

```bash
Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/hook.py", line 37, in <module>
    BeforeInstallHook().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 280, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/hook.py", line 34, in hook
    install_packages()
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/shared_initialization.py", line 37, in install_packages
    retry_count=params.agent_stack_retry_count)
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 155, in __init__
    self.env.run()
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 54, in action_install
    self.install_package(package_name, self.resource.use_repos, self.resource.skip_repos)
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/yumrpm.py", line 49, in install_package
    self.checked_call_with_retries(cmd, sudo=True, logoutput=self.get_logoutput())
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 83, in checked_call_with_retries
    return self._call_with_retries(cmd, is_checked=True, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 91, in _call_with_retries
    code, out = func(cmd, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 71, in inner
    result = function(command, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 93, in checked_call
    tries=tries, try_sleep=try_sleep)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 141, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 294, in _call
    raise Fail(err_msg)
resource_management.core.exceptions.Fail: Execution of '/usr/bin/yum -d 0 -e 0 -y install hdp-select' returned 1.  One of the configured repositories failed (HDP-2.5),
 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 HDP-2.5

     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=HDP-2.5.skip_if_unavailable=true

failure: repodata/repomd.xml from HDP-2.5: [Errno 256] No more mirrors to try.
http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.5.0.0/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: public-repo-1.hortonworks.com; Name or service not known"

```



- 解决方法:
仔仔细细的检查yum源的配置。修改yum源之后执行下面命令

```bash
# 清除系统中缓存的所有仓库数据
yum clean all
# 更新系统中安装的所有软件包到最新版本
yum update
# 重建本地仓库缓存
yum makecache
```



- `yum clean all` 命令会清除系统中缓存的所有仓库数据,包括仓库元数据和软件包。这个命令可以用来解决仓库数据损坏或不一致的问题。
- `yum update` 命令用于更新系统中安装的所有软件包到最新版本。它会检查仓库中可用的新版本软件包,并下载并安装它们。这个命令可以用来升级系统并修复已知的软件包漏洞或问题。
- `yum makecache` 命令用于重建本地仓库缓存。它会重新下载并解析仓库中的元数据,并将其存储在本地缓存中。这个命令可以用来更新本地仓库数据,以便 yum 命令能够快速地访问和检索软件包信息。



## 7. mailcap-2.1.41-2.el7.noarch: [Errno 256] No more mirrors to try

```bash

Error downloading packages:
  hadoop_2_5_0_0_1245-2.7.3.2.5.0.0-1245.el6.x86_64: [Errno 256] No more mirrors to try.
  zookeeper_2_5_0_0_1245-3.4.6.2.5.0.0-1245.el6.noarch: [Errno 256] No more mirrors to try.
  spark_2_5_0_0_1245-yarn-shuffle-1.6.2.2.5.0.0-1245.el6.noarch: [Errno 256] No more mirrors to try.
  spark2_2_5_0_0_1245-yarn-shuffle-2.0.0.2.5.0.0-1245.el6.noarch: [Errno 256] No more mirrors to try.
  mailcap-2.1.41-2.el7.noarch: [Errno 256] No more mirrors to try.
```

- 解决方法

仔仔细细的检查yum源的配置。修改yum源之后执行下面命令

```bash
# 清除系统中缓存的所有仓库数据
yum clean all
# 更新系统中安装的所有软件包到最新版本
yum update
# 重建本地仓库缓存
yum makecache
```



## 8. repodata/repomd.xml: [Errno 14] HTTP Error 403 - Forbidden

```bash
Failed to execute command:  rpm -qa | grep smartsense- ||  yum -y install smartsense-hst ||  rpm -i /var/lib/ambari-agent/cache/stacks/HDP/2.1/services/SMARTSENSE/package/files/rpm/*.rpm; Exit code: 1; stdout: Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
No package smartsense-hst available.
; stderr: http://master/hdp/HDP/centos7/repodata/repomd.xml: [Errno 14] HTTP Error 403 - Forbidden
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/solutions/69319
If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/
http://master/hdp/HDP-UTILS-1.1.0.21/repos/centos7/repodata/repomd.xml: [Errno 14] HTTP Error 403 - Forbidden
Trying other mirror.
Error: Nothing to do
error: File not found by glob: /var/lib/ambari-agent/cache/stacks/HDP/2.1/services/SMARTSENSE/package/files/rpm/*.rpm
stdout:   /var/lib/ambari-agent/data/output-8245.txt
2023-03-08 14:20:22,975 - Using hadoop conf dir: /usr/hdp/current/hadoop-client/conf
2023-03-08 14:20:22,975 - Group['spark'] {}
2023-03-08 14:20:22,995 - Group['hadoop'] {}
2023-03-08 14:20:22,995 - Group['users'] {}
2023-03-08 14:20:22,995 - User['hive'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2023-03-08 14:20:22,995 - Adding user User['hive']
2023-03-08 14:20:23,631 - User['zookeeper'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2023-03-08 14:20:23,632 - Adding user User['zookeeper']
2023-03-08 14:20:24,248 - User['infra-solr'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2023-03-08 14:20:24,249 - User['ams'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2023-03-08 14:20:24,249 - Adding user User['ams']
2023-03-08 14:20:24,949 - User['tez'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'users']}
2023-03-08 14:20:24,949 - Adding user User['tez']
2023-03-08 14:20:25,566 - User['spark'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2023-03-08 14:20:25,566 - Adding user User['spark']
2023-03-08 14:20:26,200 - User['ambari-qa'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'users']}
2023-03-08 14:20:26,200 - Adding user User['ambari-qa']
2023-03-08 14:20:26,827 - User['flume'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2023-03-08 14:20:26,827 - Adding user User['flume']
2023-03-08 14:20:27,533 - User['hdfs'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2023-03-08 14:20:27,534 - Adding user User['hdfs']
2023-03-08 14:20:28,260 - User['yarn'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2023-03-08 14:20:28,260 - Adding user User['yarn']
2023-03-08 14:20:28,927 - User['mapred'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2023-03-08 14:20:28,927 - Adding user User['mapred']
2023-03-08 14:20:29,553 - User['hbase'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2023-03-08 14:20:29,554 - Adding user User['hbase']
2023-03-08 14:20:30,170 - User['hcat'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2023-03-08 14:20:30,170 - Adding user User['hcat']
2023-03-08 14:20:31,087 - File['/var/lib/ambari-agent/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2023-03-08 14:20:31,130 - Execute['/var/lib/ambari-agent/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa'] {'not_if': '(test $(id -u ambari-qa) -gt 1000) || (false)'}
2023-03-08 14:20:31,135 - Skipping Execute['/var/lib/ambari-agent/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa'] due to not_if
2023-03-08 14:20:31,135 - Directory['/tmp/hbase-hbase'] {'owner': 'hbase', 'create_parents': True, 'mode': 0775, 'cd_access': 'a'}
2023-03-08 14:20:31,136 - Changing owner for /tmp/hbase-hbase from 1013 to hbase
2023-03-08 14:20:31,136 - File['/var/lib/ambari-agent/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2023-03-08 14:20:31,137 - Execute['/var/lib/ambari-agent/tmp/changeUid.sh hbase /home/hbase,/tmp/hbase,/usr/bin/hbase,/var/log/hbase,/tmp/hbase-hbase'] {'not_if': '(test $(id -u hbase) -gt 1000) || (false)'}
2023-03-08 14:20:31,140 - Skipping Execute['/var/lib/ambari-agent/tmp/changeUid.sh hbase /home/hbase,/tmp/hbase,/usr/bin/hbase,/var/log/hbase,/tmp/hbase-hbase'] due to not_if
2023-03-08 14:20:31,140 - Group['hdfs'] {}
2023-03-08 14:20:31,141 - User['hdfs'] {'fetch_nonlocal_groups': True, 'groups': [u'hadoop', u'hdfs']}
2023-03-08 14:20:31,141 - Modifying user hdfs
2023-03-08 14:20:32,157 - FS Type: 
2023-03-08 14:20:32,158 - Directory['/etc/hadoop'] {'mode': 0755}
2023-03-08 14:20:32,158 - Creating directory Directory['/etc/hadoop'] since it doesn't exist.
2023-03-08 14:20:32,159 - Directory['/var/lib/ambari-agent/tmp/hadoop_java_io_tmpdir'] {'owner': 'hdfs', 'group': 'hadoop', 'mode': 01777}
2023-03-08 14:20:32,160 - Changing owner for /var/lib/ambari-agent/tmp/hadoop_java_io_tmpdir from 1013 to hdfs
2023-03-08 14:20:32,184 - Initializing 2 repositories
2023-03-08 14:20:32,185 - Repository['HDP-2.5'] {'base_url': 'http://master/hdp/HDP/centos7/', 'action': ['create'], 'components': [u'HDP', 'main'], 'repo_template': '[{{repo_id}}]\nname={{repo_id}}\n{% if mirror_list %}mirrorlist={{mirror_list}}{% else %}baseurl={{base_url}}{% endif %}\n\npath=/\nenabled=1\ngpgcheck=0', 'repo_file_name': 'HDP', 'mirror_list': None}
2023-03-08 14:20:32,250 - File['/etc/yum.repos.d/HDP.repo'] {'content': '[HDP-2.5]\nname=HDP-2.5\nbaseurl=http://master/hdp/HDP/centos7/\n\npath=/\nenabled=1\ngpgcheck=0'}
2023-03-08 14:20:32,251 - Writing File['/etc/yum.repos.d/HDP.repo'] because contents don't match
2023-03-08 14:20:32,251 - Repository['HDP-UTILS-1.1.0.21'] {'base_url': 'http://master/hdp/HDP-UTILS-1.1.0.21/repos/centos7/', 'action': ['create'], 'components': [u'HDP-UTILS', 'main'], 'repo_template': '[{{repo_id}}]\nname={{repo_id}}\n{% if mirror_list %}mirrorlist={{mirror_list}}{% else %}baseurl={{base_url}}{% endif %}\n\npath=/\nenabled=1\ngpgcheck=0', 'repo_file_name': 'HDP-UTILS', 'mirror_list': None}
2023-03-08 14:20:32,254 - File['/etc/yum.repos.d/HDP-UTILS.repo'] {'content': '[HDP-UTILS-1.1.0.21]\nname=HDP-UTILS-1.1.0.21\nbaseurl=http://master/hdp/HDP-UTILS-1.1.0.21/repos/centos7/\n\npath=/\nenabled=1\ngpgcheck=0'}
2023-03-08 14:20:32,254 - Writing File['/etc/yum.repos.d/HDP-UTILS.repo'] because contents don't match
2023-03-08 14:20:32,254 - Package['unzip'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2023-03-08 14:20:33,429 - Skipping installation of existing package unzip
2023-03-08 14:20:33,429 - Package['curl'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2023-03-08 14:20:33,438 - Skipping installation of existing package curl
2023-03-08 14:20:33,438 - Package['hdp-select'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2023-03-08 14:20:33,445 - Skipping installation of existing package hdp-select
installing using command: {sudo} rpm -qa | grep smartsense- || {sudo} yum -y install smartsense-hst || {sudo} rpm -i /var/lib/ambari-agent/cache/stacks/HDP/2.1/services/SMARTSENSE/package/files/rpm/*.rpm
Command:  rpm -qa | grep smartsense- ||  yum -y install smartsense-hst ||  rpm -i /var/lib/ambari-agent/cache/stacks/HDP/2.1/services/SMARTSENSE/package/files/rpm/*.rpm
Exit code: 1
Std Out: Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
No package smartsense-hst available.

Std Err: http://master/hdp/HDP/centos7/repodata/repomd.xml: [Errno 14] HTTP Error 403 - Forbidden
Trying other mirror.
To address this issue please refer to the below knowledge base article

https://access.redhat.com/solutions/69319

If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/

http://master/hdp/HDP-UTILS-1.1.0.21/repos/centos7/repodata/repomd.xml: [Errno 14] HTTP Error 403 - Forbidden
Trying other mirror.
Error: Nothing to do
error: File not found by glob: /var/lib/ambari-agent/cache/stacks/HDP/2.1/services/SMARTSENSE/package/files/rpm/*.rpm

Command failed after 1 tries</module></repoid></repoid></repoid></repoid></repoid></repoid></repoid></repoid>
  • 解决方法

在提供镜像服务的机器上执行以下命令:

setenforce 0

9. File not found by glob: /var/lib/ambari-agent/cache/stacks/HDP/2.1 …

Failed to execute command:  rpm -qa | grep smartsense- ||  yum -y install smartsense-hst ||  rpm -i /var/lib/ambari-agent/cache/stacks/HDP/2.1/services/SMARTSENSE/package/files/rpm/*.rpm; Exit code: 1; stdout: Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
No package smartsense-hst available.
; stderr: Error: Nothing to do
error: File not found by glob: /var/lib/ambari-agent/cache/stacks/HDP/2.1/services/SMARTSENSE/package/files/rpm/*.rpm
  • 问题原因

由于smartsense包是在ambari里面的,检查ambari repo是否正常。如果使用本地源,请查检base url。

10. /usr/hdp/current/hadoop-client/conf doesn’t exist

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_client.py", line 82, in <module>
    HbaseClient().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 280, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_client.py", line 37, in install
    self.configure(env)
  File "/var/lib/ambari-agent/cache/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_client.py", line 42, in configure
    hbase(name='client')
  File "/usr/lib/python2.6/site-packages/ambari_commons/os_family_impl.py", line 89, in thunk
    return fn(*args, **kwargs)
  File "/var/lib/ambari-agent/cache/common-services/HBASE/0.96.0.2.0/package/scripts/hbase.py", line 120, in hbase
    group=params.user_group
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 155, in __init__
    self.env.run()
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/providers/xml_config.py", line 66, in action_create
    encoding = self.resource.encoding
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 155, in __init__
    self.env.run()
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py", line 120, in action_create
    raise Fail("Applying %s failed, parent directory %s doesn't exist" % (self.resource, dirname))
resource_management.core.exceptions.Fail: Applying File['/usr/hdp/current/hadoop-client/conf/hdfs-site.xml'] failed, parent directory /usr/hdp/current/hadoop-client/conf doesn't exist
  • 问题原因

可能是由于之前安装过,但没有安装成功,导致在文件系统中存在一些文件,致使后续重试的安装出现问题。
解决方法:输入以下命令

yum -y erase hdp-select

11. Could not resolve host: repo.mysql.com; Name or service not known

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/mysql_server.py", line 64, in <module>
    MysqlServer().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 280, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/mysql_server.py", line 33, in install
    self.install_packages(env)
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 567, in install_packages
    retry_count=agent_stack_retry_count)
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 155, in __init__
    self.env.run()
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 54, in action_install
    self.install_package(package_name, self.resource.use_repos, self.resource.skip_repos)
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/yumrpm.py", line 49, in install_package
    self.checked_call_with_retries(cmd, sudo=True, logoutput=self.get_logoutput())
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 83, in checked_call_with_retries
    return self._call_with_retries(cmd, is_checked=True, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 91, in _call_with_retries
    code, out = func(cmd, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 71, in inner
    result = function(command, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 93, in checked_call
    tries=tries, try_sleep=try_sleep)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 141, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 294, in _call
    raise Fail(err_msg)
resource_management.core.exceptions.Fail: Execution of '/usr/bin/yum -d 0 -e 0 -y install mysql-community-server' returned 1.  One of the configured repositories failed (MySQL Connectors Community),
 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 mysql-connectors-community

     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=mysql-connectors-community.skip_if_unavailable=true

failure: repodata/repomd.xml from mysql-connectors-community: [Errno 256] No more mirrors to try.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: repo.mysql.com; Name or service not known"
  • 问题原因
    从以上最后两句可以看到,在repodata/下有个来自 mysql-connectors-community 的 repomd.xml 文件,而 repodata 这个目录是在ambari 源下的,因此,导致无法找到mysql安装源的原因应该是刚才刚刚加入的源没有完成识别出来,使用以下命令解决问题:
yum makecache

如果还是不能解决这个问题,可以尝试手动安装 mysql community server 和 client。先安装 client,再安装 server,下载地址如下:

http://repo.mysql.com/yum/mysql-5.6-community/el/7/x86_64/mysql-community-server-5.6.34-2.el7.x86_64.rpm

http://repo.mysql.com/yum/mysql-5.6-community/el/7/x86_64/mysql-community-client-5.6.34-2.el7.x86_64.rpm

12. mailcap-2.1.41-2.el7.noarch: [Errno 256] No more mirrors to try

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py", line 174, in <module>
    DataNode().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 280, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py", line 49, in install
    self.install_packages(env)
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 567, in install_packages
    retry_count=agent_stack_retry_count)
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 155, in __init__
    self.env.run()
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 54, in action_install
    self.install_package(package_name, self.resource.use_repos, self.resource.skip_repos)
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/yumrpm.py", line 49, in install_package
    self.checked_call_with_retries(cmd, sudo=True, logoutput=self.get_logoutput())
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 83, in checked_call_with_retries
    return self._call_with_retries(cmd, is_checked=True, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 91, in _call_with_retries
    code, out = func(cmd, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 71, in inner
    result = function(command, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 93, in checked_call
    tries=tries, try_sleep=try_sleep)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 141, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 294, in _call
    raise Fail(err_msg)
resource_management.core.exceptions.Fail: Execution of '/usr/bin/yum -d 0 -e 0 -y install hadoop_2_5_0_0_1245' returned 1. No Presto metadata available for base
Error downloading packages:
  mailcap-2.1.41-2.el7.noarch: [Errno 256] No more mirrors to try.
  • 问题原因

no more mirrors to try,这是源有问题,检查源的配置,并进行更新源:

  • 解决
# 清除系统中缓存的所有仓库数据
yum clean all
# 更新系统中安装的所有软件包到最新版本
yum update
# 重建本地仓库缓存
yum makecache

13. cpio: rename failed - Is a directory

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_client.py", line 82, in <module>
    HbaseClient().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 280, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_client.py", line 36, in install
    self.install_packages(env)
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 567, in install_packages
    retry_count=agent_stack_retry_count)
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 155, in __init__
    self.env.run()
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 54, in action_install
    self.install_package(package_name, self.resource.use_repos, self.resource.skip_repos)
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/yumrpm.py", line 49, in install_package
    self.checked_call_with_retries(cmd, sudo=True, logoutput=self.get_logoutput())
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 83, in checked_call_with_retries
    return self._call_with_retries(cmd, is_checked=True, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 91, in _call_with_retries
    code, out = func(cmd, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 71, in inner
    result = function(command, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 93, in checked_call
    tries=tries, try_sleep=try_sleep)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 141, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 294, in _call
    raise Fail(err_msg)
resource_management.core.exceptions.Fail: Execution of '/usr/bin/yum -d 0 -e 0 -y install hbase_2_5_0_0_1245' returned 1. Error unpacking rpm package hbase_2_5_0_0_1245-1.1.2.2.5.0.0-1245.el6.noarch
error: unpacking of archive failed on file /usr/hdp/2.5.0.0-1245/hbase/conf: cpio: rename failed - Is a directory
  • 解决方法

删除conf这个目录

[root@node2 hbase-client]# cd /usr/hdp/2.5.0.0-1245/hbase/
[root@node2 hbase]# rm -rf conf/

文章作者: hnbian
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 hnbian !
评论
 上一篇
Async Hbase 时频繁遇到 too many open file 异常 Async Hbase 时频繁遇到 too many open file 异常
在使用 Async Hbase 时频繁遇到 too many open file 异常,程序自动重启后会立即报错,具体报错日志如下: flink版本:1.16.0 asynchbase版本:1.8.2 2023-03-08 16:15:
2023-03-14
下一篇 
2.7.3 - Ambari 告警信息总结 2.7.3 - Ambari 告警信息总结
此文档真对 spark 2.7.3 版本的 ambari 告警信息进行总结: 1. 告警级别 告警级别 解释 说明 OK ok 集群运行良好 WARNING 警告 集群指标到了一定阈值,需关注 The cluster indi
2023-01-05
  目录