zl程序教程

您现在的位置是:首页 >  其他

当前栏目

如何禁止ambari-server.log中显示cloudera地址异常栈的解决方案分享

2023-03-07 09:11:00 时间
如何解决日志中 Could not load version definition for HDP-x.x identified by https://archive.cloudera.com 报错问题呢?

是的,今天就来说一下 ambari-server.log 日志中出现上述错误的原因及解决办法。

由于 cloudera 提供的镜像源不对外开放了,所以 ambari 源码中内置的 repo 源地址在 amabri-server 启动时就是加载异常,从而报了这个错误。

这个错误是 WARN 级别,倒不影响 ambari 功能使用,但有些初学者看到此异常还是会心头一紧;或者有基于 Ambari 二次开发的企业,也想把这个异常栈从日志中去除,毕竟很碍眼。

那么如何去除呢?很简单。

修改 hdp stack 下各版本的 repoinfo.xml 文件,将 baseurl 中的 public-repo-1.hortonworks.com 地址去掉即可,或修改为以下内容:

<?xml version="1.0"?>
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<reposinfo>
  <os family="redhat7">
    <repo>
      <baseurl></baseurl>
      <repoid>HDP-3.1</repoid>
      <reponame>HDP</reponame>
      <unique>true</unique>
    </repo>    
    <repo>
      <baseurl></baseurl>
      <repoid>HDP-3.1-GPL</repoid>
      <reponame>HDP-GPL</reponame>
      <unique>true</unique>
      <tags>
        <tag>GPL</tag>
      </tags>
    </repo>
    <repo>
      <baseurl></baseurl>
      <repoid>HDP-UTILS-1.1.0.22</repoid>
      <reponame>HDP-UTILS</reponame>
      <unique>false</unique>
    </repo>
  </os>
</reposinfo>

注意:我的系统是 centos7,所以只保留了 redhat7。请根据实际情况,保留对应系统的 reposinfo。

最后,重启 ambari-server,我们会发现图片中的报错消失了。

温馨提示: 与本篇内容相关的文章建议也看一看,地址:Ambari部署HDP时,Select Version时页面数据来源解析

好了,本篇分享就到此结束了,欢迎大家加我好友一起讨论交流Ambari。

作者介绍: Ambari 资深用户,输出很多技术干货,相关二次开发实战经验丰富,帮助很多人解决疑难问题,录有两门 Ambari 实战课程,学员人数 300+,在圈子里有一定的知名度。来加我好友(create17_)吧,可免费帮你制定 Ambari 学习计划!

---------- END ----------