ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oleew...@apache.org
Subject ambari git commit: AMBARI-19340. Infra Solr Client logging is not working (oleewere)
Date Wed, 04 Jan 2017 11:46:55 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 4c12e5de8 -> ff222441e


AMBARI-19340. Infra Solr Client logging is not working (oleewere)

Change-Id: I404ffdaf5b95cd28b0f992dc859376dec9f1bd33


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

Branch: refs/heads/trunk
Commit: ff222441e75c2feff3b93aee12560f1e624d3189
Parents: 4c12e5d
Author: oleewere <oleewere@gmail.com>
Authored: Tue Jan 3 17:59:57 2017 +0100
Committer: oleewere <oleewere@gmail.com>
Committed: Wed Jan 4 12:46:35 2017 +0100

----------------------------------------------------------------------
 .../libraries/functions/solr_cloud_util.py           | 15 ++++++++++++++-
 .../AMBARI_INFRA/0.1.0/package/scripts/params.py     |  4 ----
 .../0.1.0/package/scripts/setup_infra_solr.py        |  2 +-
 .../0.1.0/properties/solr-client-log4j.properties.j2 |  6 +++---
 4 files changed, 18 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ff222441/ambari-common/src/main/python/resource_management/libraries/functions/solr_cloud_util.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/solr_cloud_util.py
b/ambari-common/src/main/python/resource_management/libraries/functions/solr_cloud_util.py
index ccf91ef..521c9c6 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/solr_cloud_util.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/solr_cloud_util.py
@@ -171,10 +171,23 @@ def create_sasl_users(zookeeper_quorum, solr_znode, jaas_file, java64_home,
sasl
   create_sasl_users_cmd = format('{solr_cli_prefix} --create-sasl-users --jaas-file {jaas_file}
--sasl-users {sasl_users_str}')
   Execute(create_sasl_users_cmd)
 
+def default_config(config, name, default_value):
+  subdicts = filter(None, name.split('/'))
+  if not config:
+    return default_value
+  for x in subdicts:
+    if x in config:
+      config = config[x]
+    else:
+      return default_value
+  return config
+
 def setup_solr_client(config, custom_log4j = True, custom_log_location = None, log4jcontent
= None):
     solr_client_dir = '/usr/lib/ambari-infra-solr-client'
-    solr_client_log_dir = default('/configurations/infra-solr-env/infra_solr_client_log_dir',
'/var/log/ambari-infra-solr-client') if custom_log_location is None else custom_log_location
+    solr_client_log_dir = default_config(config, '/configurations/infra-solr-client-log4j/infra_solr_client_log_dir',
'/var/log/ambari-infra-solr-client') if custom_log_location is None else custom_log_location
     solr_client_log = format("{solr_client_log_dir}/solr-client.log")
+    solr_client_log_maxfilesize =  default_config(config, 'configurations/infra-solr-client-log4j/infra_client_log_maxfilesize',
80)
+    solr_client_log_maxbackupindex =  default_config(config, 'configurations/infra-solr-client-log4j/infra_client_log_maxbackupindex',
60)
 
     Directory(solr_client_log_dir,
                 mode=0755,

http://git-wip-us.apache.org/repos/asf/ambari/blob/ff222441/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/package/scripts/params.py
b/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/package/scripts/params.py
index 337a9fb..946cf15 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/package/scripts/params.py
@@ -109,16 +109,12 @@ if security_enabled:
   infra_solr_kerberos_name_rules = config['configurations']['infra-solr-env']['infra_solr_kerberos_name_rules'].replace('$',
'\$')
 
 #Solr log4j
-infra_client_log_maxfilesize =  default('configurations/infra-solr-client-log4j/infra_client_log_maxfilesize',80)
-infra_client_log_maxbackupindex =  default('configurations/infra-solr-client-log4j/infra_client_log_maxbackupindex',60)
 infra_log_maxfilesize = default('configurations/infra-solr-log4j/infra_log_maxfilesize',10)
 infra_log_maxbackupindex = default('configurations/infra-solr-log4j/infra_log_maxbackupindex',9)
 
 solr_xml_content = default('configurations/infra-solr-xml/content', None)
 solr_log4j_content = default('configurations/infra-solr-log4j/content', None)
 
-solr_client_custom_log4j = "infra-solr-client-log4j" in config['configurations']
-
 smokeuser = config['configurations']['cluster-env']['smokeuser']
 smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab']
 smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name']

http://git-wip-us.apache.org/repos/asf/ambari/blob/ff222441/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/package/scripts/setup_infra_solr.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/package/scripts/setup_infra_solr.py
b/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/package/scripts/setup_infra_solr.py
index 5143cbb..740c560 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/package/scripts/setup_infra_solr.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/package/scripts/setup_infra_solr.py
@@ -101,7 +101,7 @@ def setup_infra_solr(name = None):
 
 
   elif name == 'client':
-    solr_cloud_util.setup_solr_client(params.config, custom_log4j=params.solr_client_custom_log4j)
+    solr_cloud_util.setup_solr_client(params.config)
 
   else :
     raise Fail('Nor client or server were selected to install.')

http://git-wip-us.apache.org/repos/asf/ambari/blob/ff222441/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/properties/solr-client-log4j.properties.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/properties/solr-client-log4j.properties.j2
b/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/properties/solr-client-log4j.properties.j2
index 64fc648..0d0adc3 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/properties/solr-client-log4j.properties.j2
+++ b/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/properties/solr-client-log4j.properties.j2
@@ -19,9 +19,9 @@
 log4j.rootLogger=INFO,file,stdout,stderr
 
 log4j.appender.file=org.apache.log4j.RollingFileAppender
-log4j.appender.file.File={{infra_client_log|default('/var/log/ambari-infra-solr-client/solr-client.log')}}
-log4j.appender.file.MaxFileSize={{infra_client_log_maxfilesize}}MB
-log4j.appender.file.MaxBackupIndex={{infra_client_log_maxbackupindex}}
+log4j.appender.file.File={{solr_client_log|default('/var/log/ambari-infra-solr-client/solr-client.log')}}
+log4j.appender.file.MaxFileSize={{solr_client_log_maxfilesize}}MB
+log4j.appender.file.MaxBackupIndex={{solr_client_log_maxbackupindex}}
 log4j.appender.file.layout=org.apache.log4j.PatternLayout
 log4j.appender.file.layout.ConversionPattern=%d{DATE} %5p [%t] %c{1}:%L - %m%n
 


Mime
View raw message