记录 Ambari 安装 Kafka 异常


安装日志

  • 标准错误: /var/lib/ambari-agent/data/errors-7361.txt
Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/KAFKA/package/scripts/kafka_broker.py", line 145, in <module>
    KafkaBroker().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/KAFKA/package/scripts/kafka_broker.py", line 40, in install
    self.install_packages(env)
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 849, in install_packages
    retry_count=agent_stack_retry_count)
  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 kafka_3_1_0_0_78', exited with code '1', message: 'Repository base is listed more than once in the configuration

Error unpacking rpm package kafka_3_1_0_0_78-2.0.0.3.1.0.0-78.noarch
  • 标准输出: /var/lib/ambari-agent/data/output-7361.txt
2021-05-12 17:21:33,997 - Stack Feature Version Info: Cluster Stack=3.1, Command Stack=None, Command Version=None -> 3.1
2021-05-12 17:21:34,007 - Using hadoop conf dir: /usr/hdp/3.1.0.0-78/hadoop/conf
2021-05-12 17:21:34,009 - Skipping creation of User and Group as host is sys prepped or ignore_groupsusers_create flag is on
2021-05-12 17:21:34,009 - Directory['/tmp/hbase-hbase'] {'owner': 'hbase', 'create_parents': True, 'mode': 0775, 'cd_access': 'a'}
2021-05-12 17:21:34,011 - File['/var/lib/ambari-agent/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2021-05-12 17:21:34,012 - File['/var/lib/ambari-agent/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2021-05-12 17:21:34,013 - call['/var/lib/ambari-agent/tmp/changeUid.sh hbase'] {}
2021-05-12 17:21:34,024 - call returned (0, '1015')
2021-05-12 17:21:34,025 - Execute['/var/lib/ambari-agent/tmp/changeUid.sh hbase /home/hbase,/tmp/hbase,/usr/bin/hbase,/var/log/hbase,/tmp/hbase-hbase 1015'] {'not_if': '(test $(id -u hbase) -gt 1000) || (true)'}
2021-05-12 17:21:34,031 - Skipping Execute['/var/lib/ambari-agent/tmp/changeUid.sh hbase /home/hbase,/tmp/hbase,/usr/bin/hbase,/var/log/hbase,/tmp/hbase-hbase 1015'] due to not_if
2021-05-12 17:21:34,031 - Skipping setting dfs cluster admin and tez view acls as host is sys prepped
2021-05-12 17:21:34,031 - FS Type: HDFS
2021-05-12 17:21:34,032 - Directory['/etc/hadoop'] {'mode': 0755}
2021-05-12 17:21:34,057 - File['/usr/hdp/3.1.0.0-78/hadoop/conf/hadoop-env.sh'] {'content': InlineTemplate(...), 'owner': 'hdfs', 'group': 'hadoop'}
2021-05-12 17:21:34,058 - Directory['/var/lib/ambari-agent/tmp/hadoop_java_io_tmpdir'] {'owner': 'hdfs', 'group': 'hadoop', 'mode': 01777}
2021-05-12 17:21:34,077 - Repository['HDP-3.1-repo-1'] {'base_url': 'http://192.168.71.100/hdp/HDP/centos7/3.1.0.0-78', '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-1', 'mirror_list': None}
2021-05-12 17:21:34,086 - Repository['HDP-UTILS-1.1.0.22-repo-1'] {'base_url': 'http://192.168.71.100/hdp/HDP-UTILS-1.1.0.22/HDP-UTILS/centos7/1.1.0.22/', '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-1', 'mirror_list': None}
2021-05-12 17:21:34,089 - Repository with url http://public-repo-1.hortonworks.com/HDP-GPL/centos7/3.x/updates/3.1.0.0 is not created due to its tags: set([u'GPL'])
2021-05-12 17:21:34,089 - Repository[None] {'action': ['create']}
2021-05-12 17:21:34,090 - File['/tmp/tmpvy4CIN'] {'content': '[HDP-3.1-repo-1]\nname=HDP-3.1-repo-1\nbaseurl=http://192.168.71.100/hdp/HDP/centos7/3.1.0.0-78\n\npath=/\nenabled=1\ngpgcheck=0\n[HDP-UTILS-1.1.0.22-repo-1]\nname=HDP-UTILS-1.1.0.22-repo-1\nbaseurl=http://192.168.71.100/hdp/HDP-UTILS-1.1.0.22/HDP-UTILS/centos7/1.1.0.22/\n\npath=/\nenabled=1\ngpgcheck=0'}
2021-05-12 17:21:34,091 - Writing File['/tmp/tmpvy4CIN'] because contents don't match
2021-05-12 17:21:34,091 - File['/tmp/tmp83Iiqx'] {'content': StaticFile('/etc/yum.repos.d/ambari-hdp-1.repo')}
2021-05-12 17:21:34,092 - Writing File['/tmp/tmp83Iiqx'] because contents don't match
2021-05-12 17:21:34,093 - Package['unzip'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2021-05-12 17:21:34,211 - Skipping installation of existing package unzip
2021-05-12 17:21:34,211 - Package['curl'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2021-05-12 17:21:34,224 - Skipping installation of existing package curl
2021-05-12 17:21:34,224 - Package['hdp-select'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2021-05-12 17:21:34,237 - Skipping installation of existing package hdp-select
2021-05-12 17:21:34,244 - The repository with version 3.1.0.0-78 for this command has been marked as resolved. It will be used to report the version of the component which was installed
2021-05-12 17:21:34,521 - Package['kafka_3_1_0_0_78'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2021-05-12 17:21:34,636 - Installing package kafka_3_1_0_0_78 ('/usr/bin/yum -y install kafka_3_1_0_0_78')
2021-05-12 17:21:37,687 - The repository with version 3.1.0.0-78 for this command has been marked as resolved. It will be used to report the version of the component which was installed

Command failed after 1 tries
  • 查看 kafka 文件夹

[root@node1 kafka]# cd /usr/hdp/3.1.0.0-78/kafka/
[root@node1 kafka]# ll
总用量 40
drwxr-xr-x 3 root  root    4096 5月  12 17:42 bin
lrwxrwxrwx 1 root  root      15 5月  12 17:42 conf -> /etc/kafka/conf
drwxr-xr-x 2 kafka hadoop   105 5月  12 17:04 config
lrwxrwxrwx 1 root  root      30 5月  12 16:45 config;627cc92a -> /usr/hdp/3.1.0.0-78/kafka/conf
lrwxrwxrwx 1 root  root      30 5月  12 17:11 config;627ccf2f -> /usr/hdp/3.1.0.0-78/kafka/conf
lrwxrwxrwx 1 root  root      30 5月  12 17:15 config;627cd03f -> /usr/hdp/3.1.0.0-78/kafka/conf
lrwxrwxrwx 1 root  root      30 5月  12 17:16 config;627cd05c -> /usr/hdp/3.1.0.0-78/kafka/conf
lrwxrwxrwx 1 root  root      30 5月  12 17:16 config;627cd067 -> /usr/hdp/3.1.0.0-78/kafka/conf
lrwxrwxrwx 1 root  root      30 5月  12 17:17 config;627cd0c1 -> /usr/hdp/3.1.0.0-78/kafka/conf
lrwxrwxrwx 1 root  root      30 5月  12 17:21 config;627cd1a1 -> /usr/hdp/3.1.0.0-78/kafka/conf
lrwxrwxrwx 1 root  root      30 5月  12 17:42 config;627cd66b -> /usr/hdp/3.1.0.0-78/kafka/conf
drwxr-xr-x 3 root  root     145 5月  12 15:48 libs
-rw-r--r-- 1 root  root   28824 12月  6 2018 LICENSE
-rw-r--r-- 1 root  root     336 12月  6 2018 NOTICE

问题原因

我们可以看到配置多了许多软连接,

解决问题

直接删除 kafka文件夹重新安装即可

# 查看当前路径
[root@node1 3.1.0.0-78]# pwd
/usr/hdp/3.1.0.0-78

# 删除kafka文件夹
rm -rf kafka

# 重新安装kafka后, 查看kafka文件夹下的内容
[root@node1 3.1.0.0-78]# ll kafka/
总用量 52
drwxr-xr-x 3 root root  4096 5月  12 17:48 bin
lrwxrwxrwx 1 root root    23 5月  12 17:48 conf -> /etc/kafka/3.1.0.0-78/0
lrwxrwxrwx 1 root root    30 5月  12 17:48 config -> /usr/hdp/3.1.0.0-78/kafka/conf
drwxr-xr-x 3 root root    21 5月  12 17:48 doc
drwxr-xr-x 2 root root  8192 5月  12 17:48 libs
-rw-r--r-- 1 root root 28824 12月  6 2018 LICENSE
lrwxrwxrwx 1 root root    14 5月  12 17:48 logs -> /var/log/kafka
-rw-r--r-- 1 root root   336 12月  6 2018 NOTICE
lrwxrwxrwx 1 root root    14 5月  12 17:48 pids -> /var/run/kafka

文章作者: hnbian
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 hnbian !
评论
 上一篇
ClickHouse 表引擎 2.MergeTree 索引与数据存储方式 ClickHouse 表引擎 2.MergeTree 索引与数据存储方式
1. 一级索引MergeTree 主键使用 primary key 定义,定义主键后,会将数据依据 index_granularity 参数设置的间隔(默认:8192)为表生成一级索引保存到 primary.idx 文件中,索引文件按照 p
2021-05-18
下一篇 
ClickHouse表引擎 1.MergeTree 建表方式与分区规则 ClickHouse表引擎 1.MergeTree 建表方式与分区规则
1. MergeTree 介绍 表引擎是 ClickHouse 设计实现中的一大特色。可以说,是表引擎决定了一张数据表最终的“性格”,比如数据表拥有何种特性、数据以何种形式被存储以及如何被加载。 ClickHouse拥有非常庞大的表引擎体
2021-05-12
  目录