metron-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject incubator-metron git commit: METRON-604 Mpack installs do not work on clean machines due to missing Elastic Curator repo (justinleet) closes apache/incubator-metron#385
Date Mon, 05 Dec 2016 21:39:05 GMT
Repository: incubator-metron
Updated Branches:
  refs/heads/master e46539a98 -> 35ceddc04


METRON-604 Mpack installs do not work on clean machines due to missing Elastic Curator repo
(justinleet) closes apache/incubator-metron#385


Project: http://git-wip-us.apache.org/repos/asf/incubator-metron/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-metron/commit/35ceddc0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-metron/tree/35ceddc0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-metron/diff/35ceddc0

Branch: refs/heads/master
Commit: 35ceddc041bed09fb4abe6d1b81e0376073a65b0
Parents: e46539a
Author: justinleet <justinjleet@gmail.com>
Authored: Mon Dec 5 16:38:14 2016 -0500
Committer: leet <leet@apache.org>
Committed: Mon Dec 5 16:38:14 2016 -0500

----------------------------------------------------------------------
 .../4.5.1/package/scripts/kibana_master.py      | 24 +++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/35ceddc0/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/kibana_master.py
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/kibana_master.py
b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/kibana_master.py
index 10e3a95..f296272 100755
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/kibana_master.py
+++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/kibana_master.py
@@ -22,13 +22,14 @@ kibana_master
 import errno
 import os
 
+from ambari_commons.os_check import OSCheck
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
 from resource_management.core.logger import Logger
 from resource_management.core.resources.system import Directory
 from resource_management.core.resources.system import Execute
 from resource_management.core.resources.system import File
 from resource_management.core.source import InlineTemplate
-from resource_management.libraries.functions.format import format
+from resource_management.libraries.functions.format import format as ambari_format
 from resource_management.libraries.script import Script
 
 
@@ -41,6 +42,7 @@ class Kibana(Script):
 
         # TODO: Figure this out for all supported OSes
         Execute('rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch')
+        Logger.info("Installing Kibana CentOS/RHEL repo")
         Execute("echo \"[kibana-4.x]\n"
                 "name=Kibana repository for 4.5.x packages\n"
                 "baseurl=http://packages.elastic.co/kibana/4.5/centos\n"
@@ -48,6 +50,21 @@ class Kibana(Script):
                 "gpgkey=https://packages.elastic.co/GPG-KEY-elasticsearch\n"
                 "enabled=1\" > /etc/yum.repos.d/kibana.repo")
 
+        majorVersion = OSCheck.get_os_major_version()
+        Logger.info("CentOS/RHEL major version reported by Ambari: " + majorVersion)
+        if majorVersion == "6" or majorVersion == "7":
+            repoName = "name=CentOS/RHEL {} repository for Elasticsearch Curator 4.x packages\n".format(majorVersion)
+            baseUrl = "baseurl=http://packages.elastic.co/curator/4/centos/{}\n".format(majorVersion)
+            Logger.info("Installing Elasticsearch Curator CentOS/RHEL {} repo".format(majorVersion))
+            Execute("echo \"[curator-4]\n" +
+                    repoName +
+                    baseUrl +
+                    "gpgcheck=1\n"
+                    "gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch\n"
+                    "enabled=1\" > /etc/yum.repos.d/curator.repo")
+        else:
+            raise Exception("Unsupported CentOS/RHEL version: " + majorVersion)
+
         self.install_packages(env)
 
     def configure(self, env, upgrade_type=None, config_dir=None):
@@ -85,6 +102,7 @@ class Kibana(Script):
 
         Logger.info("Start the Master")
 
+
         Execute("service kibana start")
 
     def restart(self, env):
@@ -112,8 +130,8 @@ class Kibana(Script):
         import params
         env.set_params(params)
 
-        hostname = format("{es_host}")
-        port = int(format("{es_port}"))
+        hostname = ambari_format("{es_host}")
+        port = int(ambari_format("{es_port}"))
 
         Logger.info("Connecting to Elasticsearch on host: %s, port: %s" % (hostname, port))
         di = DashboardIndex(host=hostname, port=port)


Mime
View raw message