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