ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oleew...@apache.org
Subject [14/16] ambari git commit: AMBARI-20022. Log Search allow installation without portal (Miklos Gergely via oleewere)
Date Fri, 10 Mar 2017 13:50:10 GMT
AMBARI-20022. Log Search allow installation without portal (Miklos Gergely via oleewere)


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

Branch: refs/heads/branch-dev-logsearch
Commit: f9341745bc3f0fc7c95e3766eaaaf20b4ba95fba
Parents: 565ae98
Author: Miklos Gergely <mgergely@hortonworks.com>
Authored: Fri Mar 10 14:43:00 2017 +0100
Committer: oleewere <oleewere@gmail.com>
Committed: Fri Mar 10 14:43:00 2017 +0100

----------------------------------------------------------------------
 .../LOGSEARCH/0.5.0/metainfo.xml                |  2 +-
 .../LOGSEARCH/0.5.0/package/scripts/params.py   |  2 +-
 .../stacks/HDP/2.2/services/stack_advisor.py    | 70 ++++++++++++--------
 3 files changed, 46 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f9341745/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml
index fa9548b..acf829b 100644
--- a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml
@@ -38,7 +38,7 @@
           <timelineAppid>logsearch</timelineAppid>
           <displayName>Log Search Server</displayName>
           <category>MASTER</category>
-          <cardinality>1</cardinality>
+          <cardinality>0-1</cardinality>
           <versionAdvertised>false</versionAdvertised>
           <commandScript>
             <script>scripts/logsearch.py</script>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f9341745/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
index 8dac69a..d00be4e 100644
--- a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
@@ -391,7 +391,7 @@ logfeeder_use_ssl = logsearch_solr_ssl_enabled or metrics_collector_protocol
==
 # Smoke command
 #####################################
 
-logsearch_server_hosts = config['clusterHostInfo']['logsearch_server_hosts']
+logsearch_server_hosts = default('/configurations/clusterHostInfo/logsearch_server_hosts',
None)
 logsearch_server_host = ""
 if logsearch_server_hosts is not None and len(logsearch_server_hosts) > 0:
   logsearch_server_host = logsearch_server_hosts[0]

http://git-wip-us.apache.org/repos/asf/ambari/blob/f9341745/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
index d45cf96..9f371ca 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
@@ -1011,36 +1011,54 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
     putLogsearchEnvAttribute = self.putPropertyAttribute(configurations, "logsearch-env")
     putLogfeederEnvAttribute = self.putPropertyAttribute(configurations, "logfeeder-env")
 
-    infraSolrHosts = self.getComponentHostNames(services, "AMBARI_INFRA", "INFRA_SOLR")
-
-    if infraSolrHosts is not None and len(infraSolrHosts) > 0 and "logsearch-properties"
in services["configurations"]:
-      replicationReccomendFloat = math.log(len(infraSolrHosts), 5)
-      recommendedReplicationFactor = int(1 + math.floor(replicationReccomendFloat))
+    logSearchServerHosts = self.getComponentHostNames(services, "LOGSEARCH", "LOGSEARCH_SERVER")
+    if logSearchServerHosts is None or len(logSearchServerHosts) == 0:
+      for key in services['configurations']['logsearch-env']['properties']:
+        putLogsearchEnvAttribute(key, 'visible', 'false')
+      for key in services['configurations']['logsearch-properties']['properties']:
+        if key not in ['logsearch.collection.service.logs.numshards', 'logsearch.collection.audit.logs.numshards',
+                       'logsearch.solr.collection.service.logs', 'logsearch.solr.collection.audit.logs',
+                       'logsearch.service.logs.split.interval.mins', 'logsearch.audit.logs.split.interval.mins']:
+          putLogsearchAttribute(key, 'visible', 'false')
+      for key in services['configurations']['logsearch-audit_logs-solrconfig']['properties']:
+        self.putPropertyAttribute(configurations, "logsearch-audit_logs-solrconfig")(key,
'visible', 'false')
+      for key in services['configurations']['logsearch-service_logs-solrconfig']['properties']:
+        self.putPropertyAttribute(configurations, "logsearch-service_logs-solrconfig")(key,
'visible', 'false')
+      for key in services['configurations']['logsearch-log4j']['properties']:
+        self.putPropertyAttribute(configurations, "logsearch-log4j")(key, 'visible', 'false')
       
-      recommendedMinShards = len(infraSolrHosts)
-      recommendedShards = 2 * len(infraSolrHosts)
-      recommendedMaxShards = 3 * len(infraSolrHosts)
+      putLogsearchProperty("logsearch.collection.service.logs.numshards", 2)
+      putLogsearchProperty("logsearch.collection.audit.logs.numshards", 2)
     else:
-      recommendedReplicationFactor = 2
+      infraSolrHosts = self.getComponentHostNames(services, "AMBARI_INFRA", "INFRA_SOLR")
+      if infraSolrHosts is not None and len(infraSolrHosts) > 0 and "logsearch-properties"
in services["configurations"]:
+        replicationReccomendFloat = math.log(len(infraSolrHosts), 5)
+        recommendedReplicationFactor = int(1 + math.floor(replicationReccomendFloat))
+        
+        recommendedMinShards = len(infraSolrHosts)
+        recommendedShards = 2 * len(infraSolrHosts)
+        recommendedMaxShards = 3 * len(infraSolrHosts)
+      else:
+        recommendedReplicationFactor = 2
+        
+        recommendedMinShards = 1
+        recommendedShards = 1
+        recommendedMaxShards = 100
+        
+        putLogsearchCommonEnvProperty('logsearch_use_external_solr', 'true')
+        
+      # recommend number of shard
+      putLogsearchAttribute('logsearch.collection.service.logs.numshards', 'minimum', recommendedMinShards)
+      putLogsearchAttribute('logsearch.collection.service.logs.numshards', 'maximum', recommendedMaxShards)
+      putLogsearchProperty("logsearch.collection.service.logs.numshards", recommendedShards)
       
-      recommendedMinShards = 1
-      recommendedShards = 1
-      recommendedMaxShards = 100
+      putLogsearchAttribute('logsearch.collection.audit.logs.numshards', 'minimum', recommendedMinShards)
+      putLogsearchAttribute('logsearch.collection.audit.logs.numshards', 'maximum', recommendedMaxShards)
+      putLogsearchProperty("logsearch.collection.audit.logs.numshards", recommendedShards)
+      # recommend replication factor
+      putLogsearchProperty("logsearch.collection.service.logs.replication.factor", recommendedReplicationFactor)
+      putLogsearchProperty("logsearch.collection.audit.logs.replication.factor", recommendedReplicationFactor)
       
-      putLogsearchCommonEnvProperty('logsearch_use_external_solr', 'true')
-
-    # recommend number of shard
-    putLogsearchAttribute('logsearch.collection.service.logs.numshards', 'minimum', recommendedMinShards)
-    putLogsearchAttribute('logsearch.collection.service.logs.numshards', 'maximum', recommendedMaxShards)
-    putLogsearchProperty("logsearch.collection.service.logs.numshards", recommendedShards)
-
-    putLogsearchAttribute('logsearch.collection.audit.logs.numshards', 'minimum', recommendedMinShards)
-    putLogsearchAttribute('logsearch.collection.audit.logs.numshards', 'maximum', recommendedMaxShards)
-    putLogsearchProperty("logsearch.collection.audit.logs.numshards", recommendedShards)
-    # recommend replication factor
-    putLogsearchProperty("logsearch.collection.service.logs.replication.factor", recommendedReplicationFactor)
-    putLogsearchProperty("logsearch.collection.audit.logs.replication.factor", recommendedReplicationFactor)
-    
     kerberos_authentication_enabled = self.isSecurityEnabled(services)
     if not kerberos_authentication_enabled:
        putLogsearchCommonEnvProperty('logsearch_external_solr_kerberos_enabled', 'false')


Mime
View raw message