HDP2.1 Hadoop クラスターを HDP2.2.4 に移行しています。最初のステップは、ambari を 1.6.0 から 2.0.0 に移行することです。
この手順を完了した後、サービスを再起動しました。
Ambari 2.0 を介して "HiveServer2" を開始すると失敗しますがsudo service hive-server2 start
、後続のハイブ要求、および Ambari Hive サービス チェックは機能します。
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 }
)