You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2015/04/24 19:04:37 UTC

[1/3] ambari git commit: AMBARI-10698 - HDFS and ZOOKEEPER deployment problems on Windows OS (Eugene Chekanskiy via abaranchuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk ae4118c96 -> 00ea69653


AMBARI-10698 - HDFS and ZOOKEEPER deployment problems on Windows OS (Eugene Chekanskiy via abaranchuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/eae822fa
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/eae822fa
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/eae822fa

Branch: refs/heads/trunk
Commit: eae822fa04452e9a6f4e9206473b02690525e5e3
Parents: ae4118c
Author: Artem Baranchuk <ab...@hortonworks.con>
Authored: Fri Apr 24 19:59:44 2015 +0300
Committer: Artem Baranchuk <ab...@hortonworks.con>
Committed: Fri Apr 24 19:59:44 2015 +0300

----------------------------------------------------------------------
 .../HDFS/2.1.0.2.0/package/scripts/params_windows.py    | 12 +++++++++---
 .../ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py    |  2 +-
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/eae822fa/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_windows.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_windows.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_windows.py
index fe7f456..c14e6ca 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_windows.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_windows.py
@@ -22,9 +22,15 @@ import os
 from status_params import *
 
 config = Script.get_config()
-hadoop_conf_dir = os.environ["HADOOP_CONF_DIR"]
-hbase_conf_dir = os.environ["HBASE_CONF_DIR"]
-hadoop_home = os.environ["HADOOP_HOME"]
+hadoop_conf_dir = None
+hbase_conf_dir = None
+hadoop_home = None
+try:
+  hadoop_conf_dir = os.environ["HADOOP_CONF_DIR"]
+  hbase_conf_dir = os.environ["HBASE_CONF_DIR"]
+  hadoop_home = os.environ["HADOOP_HOME"]
+except:
+  pass
 #directories & files
 dfs_name_dir = config['configurations']['hdfs-site']['dfs.namenode.name.dir']
 fs_checkpoint_dir = config['configurations']['hdfs-site']['dfs.namenode.checkpoint.dir']

http://git-wip-us.apache.org/repos/asf/ambari/blob/eae822fa/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py
index 8176e2e..d6c40ee 100644
--- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py
+++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py
@@ -102,7 +102,7 @@ def zookeeper(type = None, rolling_restart = False):
   )
 
 @OsFamilyFuncImpl(os_family=OSConst.WINSRV_FAMILY)
-def zookeeper(type = None):
+def zookeeper(type = None, rolling_restart = False):
   import params
   configFile("zoo.cfg", template_name="zoo.cfg.j2", mode="f")
   configFile("configuration.xsl", template_name="configuration.xsl.j2", mode="f")


[3/3] ambari git commit: AMBARI-10628 - HDPWIN deployment fails with cryptic message when hdp.msi is missing under resources folder (Eugene Chekanskiy via abaranchuk)

Posted by ab...@apache.org.
AMBARI-10628 - HDPWIN deployment fails with cryptic message when hdp.msi is missing under resources folder (Eugene Chekanskiy via abaranchuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/00ea6965
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/00ea6965
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/00ea6965

Branch: refs/heads/trunk
Commit: 00ea696531fe15435c81b05eae66e0de442c1c2b
Parents: 43c8cd4
Author: Artem Baranchuk <ab...@hortonworks.con>
Authored: Fri Apr 24 20:04:00 2015 +0300
Committer: Artem Baranchuk <ab...@hortonworks.con>
Committed: Fri Apr 24 20:04:00 2015 +0300

----------------------------------------------------------------------
 ambari-agent/src/main/python/ambari_agent/PythonExecutor.py   | 7 +++++--
 ambari-common/src/main/python/ambari_commons/shell.py         | 5 ++---
 .../libraries/functions/install_hdp_msi.py                    | 5 ++++-
 3 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/00ea6965/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py b/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
index 09be145..42e3861 100644
--- a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
+++ b/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
@@ -112,8 +112,11 @@ class PythonExecutor:
     Log some useful information after task failure.
     """
     logger.info("Command " + pprint.pformat(pythonCommand) + " failed with exitcode=" + str(result['exitcode']))
-    cmd_list = ["ps faux", "netstat -tulpn"]
-    
+    if OSCheck.is_windows_family():
+      cmd_list = ["WMIC path win32_process get Caption,Processid,Commandline", "netstat -an"]
+    else:
+      cmd_list = ["ps faux", "netstat -tulpn"]
+
     shell_runner = shellRunner()
     
     for cmd in cmd_list:

http://git-wip-us.apache.org/repos/asf/ambari/blob/00ea6965/ambari-common/src/main/python/ambari_commons/shell.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/ambari_commons/shell.py b/ambari-common/src/main/python/ambari_commons/shell.py
index 4531cf9..8d26599 100644
--- a/ambari-common/src/main/python/ambari_commons/shell.py
+++ b/ambari-common/src/main/python/ambari_commons/shell.py
@@ -76,9 +76,8 @@ class shellRunnerWindows(shellRunner):
   def run(self, script, user=None):
     logger.warn("user argument ignored on windows")
     code = 0
-    if not isinstance(script, list):
-      cmd = " "
-      cmd = cmd.join(script)
+    if isinstance(script, list):
+      cmd = " ".join(script)
     else:
       cmd = script
     p = subprocess.Popen(cmd, stdout=subprocess.PIPE,

http://git-wip-us.apache.org/repos/asf/ambari/blob/00ea6965/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py b/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
index 0fa72fe..ddb99e1 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
@@ -178,7 +178,10 @@ def install_windows_msi(msi_url, save_dir, save_file, hadoop_password, stack_ver
       hdp_22_specific_props = hdp_22.format(hdp_data_dir=hdp_data_dir)
 
     # install msi
-    download_file(msi_url, os.path.join(msi_save_dir, save_file))
+    try:
+      download_file(msi_url, os.path.join(msi_save_dir, save_file))
+    except:
+      raise Fail("Failed to download {url}".format(url=msi_url))
     File(os.path.join(msi_save_dir, "properties.txt"), content=cluster_properties.format(hdp_log_dir=hdp_log_dir,
                                                                                          hdp_data_dir=hdp_data_dir,
                                                                                          local_host=local_host,


[2/3] ambari git commit: AMBARI-10660 - Need to relocate stacks/HDPWIN/2.1/services/STORM/package/alerts/check_supervisor_process.py (Eugene Chekanskiy via abaranchuk)

Posted by ab...@apache.org.
AMBARI-10660 - Need to relocate stacks/HDPWIN/2.1/services/STORM/package/alerts/check_supervisor_process.py (Eugene Chekanskiy via abaranchuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/43c8cd49
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/43c8cd49
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/43c8cd49

Branch: refs/heads/trunk
Commit: 43c8cd496c8521f32f2bdebef296f54b37061ce7
Parents: eae822f
Author: Artem Baranchuk <ab...@hortonworks.con>
Authored: Fri Apr 24 20:01:42 2015 +0300
Committer: Artem Baranchuk <ab...@hortonworks.con>
Committed: Fri Apr 24 20:01:42 2015 +0300

----------------------------------------------------------------------
 .../alerts/check_supervisor_process_win.py      | 49 ++++++++++++++++++++
 .../STORM/0.9.1.2.1/package/scripts/nimbus.py   |  3 +-
 .../0.9.1.2.1/package/scripts/supervisor.py     |  2 +
 .../0.9.1.2.1/package/scripts/ui_server.py      |  2 +
 .../0.9.1.2.1/package/scripts/yaml_utils.py     |  4 +-
 .../HDPWIN/2.1/services/STORM/alerts.json       |  2 +-
 .../package/alerts/check_supervisor_process.py  | 49 --------------------
 7 files changed, 59 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/43c8cd49/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/alerts/check_supervisor_process_win.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/alerts/check_supervisor_process_win.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/alerts/check_supervisor_process_win.py
new file mode 100644
index 0000000..dcae64a
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/alerts/check_supervisor_process_win.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+
+"""
+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.
+"""
+
+from resource_management.libraries.functions import check_windows_service_status
+
+
+RESULT_CODE_OK = 'OK'
+RESULT_CODE_CRITICAL = 'CRITICAL'
+RESULT_CODE_UNKNOWN = 'UNKNOWN'
+
+
+def get_tokens():
+  """
+  Returns a tuple of tokens in the format {{site/property}} that will be used
+  to build the dictionary passed into execute
+  """
+  return ()
+
+def execute(parameters=None, host_name=None):
+  """
+  Returns a tuple containing the result code and a pre-formatted result label
+
+  Keyword arguments:
+  parameters (dictionary): a mapping of parameter key to value
+  host_name (string): the name of this host where the alert is running
+  """
+
+  try:
+    check_windows_service_status("supervisor")
+    return (RESULT_CODE_OK, ["Supervisor is running"])
+  except:
+    return (RESULT_CODE_CRITICAL, ["Supervisor is stopped"])

http://git-wip-us.apache.org/repos/asf/ambari/blob/43c8cd49/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus.py
index 98e9e9b..57db32d 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus.py
@@ -32,7 +32,7 @@ from resource_management.libraries.functions.security_commons import build_expec
 from setup_ranger_storm import setup_ranger_storm
 from ambari_commons import OSConst
 from ambari_commons.os_family_impl import OsFamilyImpl
-
+from resource_management.core.resources.service import Service
 
 class Nimbus(Script):
   def install(self, env):
@@ -132,6 +132,7 @@ class NimbusWindows(Nimbus):
 
   def status(self, env):
     import status_params
+    from resource_management.libraries.functions.windows_service_utils import check_windows_service_status
     env.set_params(status_params)
     check_windows_service_status(status_params.nimbus_win_service_name)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/43c8cd49/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor.py
index 0005efa..4acfd80 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor.py
@@ -28,6 +28,7 @@ from storm import storm
 from service import service
 from ambari_commons import OSConst
 from ambari_commons.os_family_impl import OsFamilyImpl
+from resource_management.core.resources.service import Service
 
 
 class Supervisor(Script):
@@ -56,6 +57,7 @@ class SupervisorWindows(Supervisor):
 
   def status(self, env):
     import status_params
+    from resource_management.libraries.functions.windows_service_utils import check_windows_service_status
     env.set_params(status_params)
     check_windows_service_status(status_params.supervisor_win_service_name)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/43c8cd49/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/ui_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/ui_server.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/ui_server.py
index bd09ffe..172a357 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/ui_server.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/ui_server.py
@@ -33,6 +33,7 @@ from resource_management.libraries.functions.security_commons import build_expec
 from setup_ranger_storm import setup_ranger_storm
 from ambari_commons import OSConst
 from ambari_commons.os_family_impl import OsFamilyImpl
+from resource_management.core.resources.service import Service
 
 
 class UiServer(Script):
@@ -61,6 +62,7 @@ class UiServerWindows(UiServer):
   def status(self, env):
     import status_params
     env.set_params(status_params)
+    from resource_management.libraries.functions.windows_service_utils import check_windows_service_status
     check_windows_service_status(status_params.ui_win_service_name)
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/43c8cd49/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/yaml_utils.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/yaml_utils.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/yaml_utils.py
index 51ad670..aeda3b3 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/yaml_utils.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/yaml_utils.py
@@ -19,8 +19,10 @@ limitations under the License.
 """
 
 import re
+import os
 import resource_management
 from resource_management.core.source import InlineTemplate
+from resource_management.core.resources.system import File
 
 def escape_yaml_propetry(value):
   unquouted = False
@@ -69,7 +71,7 @@ def yaml_config_template(configurations):
 
 def yaml_config(filename, configurations = None, conf_dir = None, owner = None, group = None):
   import params
-  config_content = source.InlineTemplate('''{% for key, value in configurations_dict.items() %}{{ key }}: {{ escape_yaml_propetry(value) }}
+  config_content = InlineTemplate('''{% for key, value in configurations_dict.items() %}{{ key }}: {{ escape_yaml_propetry(value) }}
 {% endfor %}''', configurations_dict=configurations, extra_imports=[escape_yaml_propetry])
 
   File (os.path.join(params.conf_dir, filename),

http://git-wip-us.apache.org/repos/asf/ambari/blob/43c8cd49/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/STORM/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/STORM/alerts.json b/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/STORM/alerts.json
index babf7cf..e5d4e47 100644
--- a/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/STORM/alerts.json
+++ b/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/STORM/alerts.json
@@ -166,7 +166,7 @@
         "scope": "HOST",
         "source": {
           "type": "SCRIPT",
-          "path": "HDPWIN/2.1/services/STORM/package/alerts/check_supervisor_process.py"
+          "path": "STORM/0.9.1.2.1/package/alerts/check_supervisor_process_win.py"
         }
       }
     ]

http://git-wip-us.apache.org/repos/asf/ambari/blob/43c8cd49/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/STORM/package/alerts/check_supervisor_process.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/STORM/package/alerts/check_supervisor_process.py b/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/STORM/package/alerts/check_supervisor_process.py
deleted file mode 100644
index dcae64a..0000000
--- a/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/STORM/package/alerts/check_supervisor_process.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env python
-
-"""
-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.
-"""
-
-from resource_management.libraries.functions import check_windows_service_status
-
-
-RESULT_CODE_OK = 'OK'
-RESULT_CODE_CRITICAL = 'CRITICAL'
-RESULT_CODE_UNKNOWN = 'UNKNOWN'
-
-
-def get_tokens():
-  """
-  Returns a tuple of tokens in the format {{site/property}} that will be used
-  to build the dictionary passed into execute
-  """
-  return ()
-
-def execute(parameters=None, host_name=None):
-  """
-  Returns a tuple containing the result code and a pre-formatted result label
-
-  Keyword arguments:
-  parameters (dictionary): a mapping of parameter key to value
-  host_name (string): the name of this host where the alert is running
-  """
-
-  try:
-    check_windows_service_status("supervisor")
-    return (RESULT_CODE_OK, ["Supervisor is running"])
-  except:
-    return (RESULT_CODE_CRITICAL, ["Supervisor is stopped"])