为什么hive metatool updatelocation需要ambari从1.6.0迁移到2.0.0来将位置移动到不需要的地方?

6ioyuze2  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(237)

我正在将hdp2.1hadoop集群迁移到hdp2.2.4。第一步是将ambari从1.6.0迁移到2.0.0。
完成此步骤后,我重新启动了服务。
通过ambari 2.0启动“hiveserver2”失败 sudo service hive-server2 start ,随后的配置单元请求和ambari配置单元服务检查工作。
它失败是因为它试图将我的非默认数据库位置迁移到 apps/hive/warehouse 在python配置步骤中,使用如下命令: hive --config /etc/hive/conf.server --service metatool -updateLocation hdfs://cluster/apps/hive/warehouse hdfs://cluster/user/foo/DATABASE 这个命令失败的原因不明(见下文),但重点是,我不希望这种情况发生,因为hdfs文件没有移动,我看不到重新定位表的意义!
为什么ambari要这样做,我如何防止这种情况发生(除了编辑python ambari文件之外)?
更新位置记录行失败,例如: -bash: line 1: hdfs://cluster/apps/hive/warehouse : No such file or directory 但列出的目录确实存在。
此更新由ambari的 /var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py (无需解释目的):

def check_fs_root():
  import params
  fs_root_url = format("{fs_root}{hive_apps_whs_dir}")
  metatool_cmd = format("hive --config {hive_server_conf_dir} --service metatool")
  cmd = as_user(format("{metatool_cmd} -listFSRoot 2>/dev/null", env={'PATH' : params.execute_path }), params.hive_user) + " | grep hdfs:// | grep -v '.db$'"
  code, out = shell.call(cmd)
  if code == 0 and fs_root_url.strip() != out.strip():
    cmd = format("{metatool_cmd} -updateLocation {fs_root}{hive_apps_whs_dir} {out}")
    Execute(cmd,
            user=params.hive_user,
            environment= {'PATH' : params.execute_path }
    )
5vf7fwbs

5vf7fwbs1#

看看这个jira能不能帮你解决问题。。。
https://issues.apache.org/jira/browse/ambari-10360

相关问题