You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jl...@apache.org on 2017/09/26 05:20:01 UTC

[10/50] [abbrv] ambari git commit: AMBARI-22013. Add JMX enable/disable option to Infra Solr (oleewere)

AMBARI-22013. Add JMX enable/disable option to Infra Solr (oleewere)


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

Branch: refs/heads/branch-feature-AMBARI-14714
Commit: 1a5b4943cbfa42d66d61e5cb29a09e1d3ad9acb7
Parents: 5c0a354
Author: Oliver Szabo <ol...@gmail.com>
Authored: Thu Sep 21 00:59:26 2017 +0200
Committer: Oliver Szabo <ol...@gmail.com>
Committed: Thu Sep 21 12:27:13 2017 +0200

----------------------------------------------------------------------
 .../docker/test-config/solr/solr-env-ssl.sh     |  1 +
 .../docker/test-config/solr/solr-env.sh         |  1 +
 .../0.1.0/configuration/infra-solr-env.xml      | 12 +++++++-
 .../0.1.0/package/scripts/params.py             |  4 +++
 .../0.1.0/properties/infra-solr-env.sh.j2       |  3 +-
 .../configs/services/ambari_infra_properties.js | 31 ++++++++++++--------
 6 files changed, 38 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1a5b4943/ambari-logsearch/docker/test-config/solr/solr-env-ssl.sh
----------------------------------------------------------------------
diff --git a/ambari-logsearch/docker/test-config/solr/solr-env-ssl.sh b/ambari-logsearch/docker/test-config/solr/solr-env-ssl.sh
index faaa6ff..6c78da0 100644
--- a/ambari-logsearch/docker/test-config/solr/solr-env-ssl.sh
+++ b/ambari-logsearch/docker/test-config/solr/solr-env-ssl.sh
@@ -71,6 +71,7 @@ RMI_PORT=18886
 #SOLR_OPTS="$SOLR_OPTS -Dsolr.autoSoftCommit.maxTime=3000"
 #SOLR_OPTS="$SOLR_OPTS -Dsolr.autoCommit.maxTime=60000"
 #SOLR_OPTS="$SOLR_OPTS -Dsolr.clustering.enabled=true"
+SOLR_OPTS="$SOLR_OPTS -Djava.rmi.server.hostname=localhost"
 
 # Location where the bin/solr script will save PID files for running instances
 # If not set, the script will create PID files in $SOLR_TIP/bin

http://git-wip-us.apache.org/repos/asf/ambari/blob/1a5b4943/ambari-logsearch/docker/test-config/solr/solr-env.sh
----------------------------------------------------------------------
diff --git a/ambari-logsearch/docker/test-config/solr/solr-env.sh b/ambari-logsearch/docker/test-config/solr/solr-env.sh
index 11b9fe0..89e3a4d 100644
--- a/ambari-logsearch/docker/test-config/solr/solr-env.sh
+++ b/ambari-logsearch/docker/test-config/solr/solr-env.sh
@@ -71,6 +71,7 @@ RMI_PORT=18886
 #SOLR_OPTS="$SOLR_OPTS -Dsolr.autoSoftCommit.maxTime=3000"
 #SOLR_OPTS="$SOLR_OPTS -Dsolr.autoCommit.maxTime=60000"
 #SOLR_OPTS="$SOLR_OPTS -Dsolr.clustering.enabled=true"
+SOLR_OPTS="$SOLR_OPTS -Djava.rmi.server.hostname=localhost"
 
 # Location where the bin/solr script will save PID files for running instances
 # If not set, the script will create PID files in $SOLR_TIP/bin

http://git-wip-us.apache.org/repos/asf/ambari/blob/1a5b4943/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/configuration/infra-solr-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/configuration/infra-solr-env.xml b/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/configuration/infra-solr-env.xml
index 52a5e6a..2a76334 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/configuration/infra-solr-env.xml
+++ b/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/configuration/infra-solr-env.xml
@@ -176,7 +176,17 @@
     </value-attributes>
     <on-ambari-upgrade add="false"/>
   </property>
-
+  <property>
+    <name>infra_solr_jmx_enabled</name>
+    <value>false</value>
+    <display-name>Enable JMX</display-name>
+    <description>Set to true to activate the JMX RMI connector to allow remote JMX client applications to monitor the JVM hosting Solr
+    </description>
+    <value-attributes>
+      <type>boolean</type>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
   <property>
     <name>infra_solr_kerberos_keytab</name>
     <value>/etc/security/keytabs/infra_solr.service.keytab</value>

http://git-wip-us.apache.org/repos/asf/ambari/blob/1a5b4943/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 e4ea885..eba1db9 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
@@ -49,6 +49,8 @@ stack_version = default("/commandParams/version", None)
 sudo = AMBARI_SUDO_BINARY
 security_enabled = status_params.security_enabled
 
+hostname = config['hostname'].lower()
+
 infra_solr_conf = "/etc/ambari-infra-solr/conf"
 
 infra_solr_port = status_params.infra_solr_port
@@ -145,6 +147,8 @@ if security_enabled:
 infra_solr_ranger_audit_service_users = format(config['configurations']['infra-solr-security-json']['infra_solr_ranger_audit_service_users']).split(',')
 infra_solr_security_json_content = config['configurations']['infra-solr-security-json']['content']
 
+infra_solr_jmx_enabled = str(default('/configurations/infra-solr-env/infra_solr_jmx_enabled', False)).lower()
+
 #Solr log4j
 infra_log_maxfilesize = default('configurations/infra-solr-log4j/infra_log_maxfilesize',10)
 infra_log_maxbackupindex = default('configurations/infra-solr-log4j/infra_log_maxbackupindex',9)

http://git-wip-us.apache.org/repos/asf/ambari/blob/1a5b4943/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/properties/infra-solr-env.sh.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/properties/infra-solr-env.sh.j2 b/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/properties/infra-solr-env.sh.j2
index 5cc344e..ea56561 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/properties/infra-solr-env.sh.j2
+++ b/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/properties/infra-solr-env.sh.j2
@@ -60,7 +60,7 @@ ZK_CLIENT_TIMEOUT="60000"
 # Set to true to activate the JMX RMI connector to allow remote JMX client applications
 # to monitor the JVM hosting Solr; set to "false" to disable that behavior
 # (false is recommended in production environments)
-ENABLE_REMOTE_JMX_OPTS="true"
+ENABLE_REMOTE_JMX_OPTS="{{infra_solr_jmx_enabled}}"
 
 # The script will use SOLR_PORT+10000 for the RMI_PORT or you can set it here
 RMI_PORT={{infra_solr_jmx_port}}
@@ -71,6 +71,7 @@ RMI_PORT={{infra_solr_jmx_port}}
 #SOLR_OPTS="$SOLR_OPTS -Dsolr.autoSoftCommit.maxTime=3000"
 #SOLR_OPTS="$SOLR_OPTS -Dsolr.autoCommit.maxTime=60000"
 #SOLR_OPTS="$SOLR_OPTS -Dsolr.clustering.enabled=true"
+SOLR_OPTS="$SOLR_OPTS -Djava.rmi.server.hostname={{hostname}}"
 
 # Location where the bin/solr script will save PID files for running instances
 # If not set, the script will create PID files in $SOLR_TIP/bin

http://git-wip-us.apache.org/repos/asf/ambari/blob/1a5b4943/ambari-web/app/data/configs/services/ambari_infra_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/configs/services/ambari_infra_properties.js b/ambari-web/app/data/configs/services/ambari_infra_properties.js
index aae7fa5..ab9471f 100644
--- a/ambari-web/app/data/configs/services/ambari_infra_properties.js
+++ b/ambari-web/app/data/configs/services/ambari_infra_properties.js
@@ -77,90 +77,97 @@ module.exports = [
     "category": "Advanced infra-solr-env",
     "filename": "infra-solr-env.xml",
     "index": 5,
-    "name": "infra_solr_ssl_enabled",
+    "name": "infra_solr_jmx_enabled",
     "serviceName": "AMBARI_INFRA"
   },
   {
     "category": "Advanced infra-solr-env",
     "filename": "infra-solr-env.xml",
     "index": 6,
-    "name": "infra_solr_truststore_location",
+    "name": "infra_solr_ssl_enabled",
     "serviceName": "AMBARI_INFRA"
   },
   {
     "category": "Advanced infra-solr-env",
     "filename": "infra-solr-env.xml",
     "index": 7,
-    "name": "infra_solr_truststore_type",
+    "name": "infra_solr_truststore_location",
     "serviceName": "AMBARI_INFRA"
   },
   {
     "category": "Advanced infra-solr-env",
     "filename": "infra-solr-env.xml",
     "index": 8,
-    "name": "infra_solr_truststore_password",
+    "name": "infra_solr_truststore_type",
     "serviceName": "AMBARI_INFRA"
   },
   {
     "category": "Advanced infra-solr-env",
     "filename": "infra-solr-env.xml",
     "index": 9,
-    "name": "infra_solr_keystore_location",
+    "name": "infra_solr_truststore_password",
     "serviceName": "AMBARI_INFRA"
   },
   {
     "category": "Advanced infra-solr-env",
     "filename": "infra-solr-env.xml",
     "index": 10,
-    "name": "infra_solr_keystore_type",
+    "name": "infra_solr_keystore_location",
     "serviceName": "AMBARI_INFRA"
   },
   {
     "category": "Advanced infra-solr-env",
     "filename": "infra-solr-env.xml",
     "index": 11,
-    "name": "infra_solr_keystore_password",
+    "name": "infra_solr_keystore_type",
     "serviceName": "AMBARI_INFRA"
   },
   {
     "category": "Advanced infra-solr-env",
     "filename": "infra-solr-env.xml",
     "index": 12,
-    "name": "infra_solr_kerberos_keytab",
+    "name": "infra_solr_keystore_password",
     "serviceName": "AMBARI_INFRA"
   },
   {
     "category": "Advanced infra-solr-env",
     "filename": "infra-solr-env.xml",
     "index": 13,
-    "name": "infra_solr_kerberos_principal",
+    "name": "infra_solr_kerberos_keytab",
     "serviceName": "AMBARI_INFRA"
   },
   {
     "category": "Advanced infra-solr-env",
     "filename": "infra-solr-env.xml",
     "index": 14,
-    "name": "infra_solr_web_kerberos_keytab",
+    "name": "infra_solr_kerberos_principal",
     "serviceName": "AMBARI_INFRA"
   },
   {
     "category": "Advanced infra-solr-env",
     "filename": "infra-solr-env.xml",
     "index": 15,
-    "name": "infra_solr_web_kerberos_principal",
+    "name": "infra_solr_web_kerberos_keytab",
     "serviceName": "AMBARI_INFRA"
   },
   {
     "category": "Advanced infra-solr-env",
     "filename": "infra-solr-env.xml",
     "index": 16,
-    "name": "infra_solr_kerberos_name_rules",
+    "name": "infra_solr_web_kerberos_principal",
     "serviceName": "AMBARI_INFRA"
   },
   {
     "category": "Advanced infra-solr-env",
     "filename": "infra-solr-env.xml",
     "index": 17,
+    "name": "infra_solr_kerberos_name_rules",
+    "serviceName": "AMBARI_INFRA"
+  },
+  {
+    "category": "Advanced infra-solr-env",
+    "filename": "infra-solr-env.xml",
+    "index": 18,
     "name": "content",
     "serviceName": "AMBARI_INFRA"
   },