ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From swa...@apache.org
Subject [30/50] [abbrv] ambari git commit: AMBARI-22045. Infra Solr client cleanup: make infra-solr-client script usable with symlinks (oleewere)
Date Tue, 26 Sep 2017 22:26:29 GMT
AMBARI-22045. Infra Solr client cleanup: make infra-solr-client script usable with symlinks
(oleewere)


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

Branch: refs/heads/branch-3.0-ams
Commit: 520d8fcce38e9c2edf8d972625d5a9aa4663c04b
Parents: 653d2f2
Author: Oliver Szabo <oleewere@gmail.com>
Authored: Sun Sep 24 01:08:11 2017 +0200
Committer: Oliver Szabo <oleewere@gmail.com>
Committed: Mon Sep 25 20:18:02 2017 +0200

----------------------------------------------------------------------
 .../apache/ambari/infra/solr/AmbariSolrCloudCLI.java  | 12 ++++++------
 .../src/main/resources/log4j.properties               |  6 +++++-
 .../src/main/resources/solrCloudCli.sh                |  8 +++++++-
 .../src/main/resources/solrIndexHelper.sh             | 14 ++++++++++----
 .../0.1.0/properties/solr-client-log4j.properties.j2  |  4 ++++
 5 files changed, 32 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/520d8fcc/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/AmbariSolrCloudCLI.java
----------------------------------------------------------------------
diff --git a/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/AmbariSolrCloudCLI.java
b/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/AmbariSolrCloudCLI.java
index 70bc232..95708d7 100644
--- a/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/AmbariSolrCloudCLI.java
+++ b/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/AmbariSolrCloudCLI.java
@@ -66,7 +66,7 @@ public class AmbariSolrCloudCLI {
       + "\n./solrCloudCli.sh --secure-znode -z host1:2181,host2:2181 -zn /ambari-solr -su
logsearch,atlas,ranger --jaas-file /etc/myconf/jaas_file"
       + "\n./solrCloudCli.sh --unsecure-znode -z host1:2181,host2:2181 -zn /ambari-solr --jaas-file
/etc/myconf/jaas_file"
       + "\n./solrCloudCli.sh --secure-solr-znode -z host1:2181,host2:2181 -zn /ambari-solr
-su logsearch,atlas,ranger --jaas-file /etc/myconf/jaas_file"
-      + "\n./solrCloudCli.sh --setup-kerberos-plugin -z host1:2181,host2:2181 -zn /ambari-solr
--security-json-location /etc/infra-solr/conf/security.json\n";
+      + "\n./solrCloudCli.sh --setup-kerberos-plugin -z host1:2181,host2:2181 -zn /ambari-solr
--security-json-location /etc/infra-solr/conf/security.json\n ";
 
   public static void main(String[] args) {
     Options options = new Options();
@@ -126,22 +126,22 @@ public class AmbariSolrCloudCLI {
 
     final Option secureSolrZnodeOption = Option.builder("ssz")
       .longOpt(SECURE_SOLR_ZNODE_COMMAND)
-      .desc("Set acls for solr znode")
+      .desc("Set acls for solr znode (command)")
       .build();
 
     final Option secureZnodeOption = Option.builder("sz")
       .longOpt(SECURE_ZNODE_COMMAND)
-      .desc("Set acls for znode")
+      .desc("Set acls for znode (command)")
       .build();
 
     final Option unsecureZnodeOption = Option.builder("uz")
       .longOpt(UNSECURE_ZNODE_COMMAND)
-      .desc("Disable security for znode")
+      .desc("Disable security for znode (command)")
       .build();
 
     final Option removeAdminHandlerOption = Option.builder("rah")
       .longOpt(REMOVE_ADMIN_HANDLERS)
-      .desc("Remove AdminHandlers request handler from solrconfig.xml")
+      .desc("Remove AdminHandlers request handler from solrconfig.xml (command)")
       .build();
 
     final Option shardNameOption = Option.builder("sn")
@@ -428,7 +428,7 @@ public class AmbariSolrCloudCLI {
       } else {
         List<String> commands = Arrays.asList(CREATE_COLLECTION_COMMAND, CREATE_SHARD_COMMAND,
UPLOAD_CONFIG_COMMAND,
           DOWNLOAD_CONFIG_COMMAND, CONFIG_CHECK_COMMAND, SET_CLUSTER_PROP, CREATE_ZNODE,
SECURE_ZNODE_COMMAND, UNSECURE_ZNODE_COMMAND,
-          SECURE_SOLR_ZNODE_COMMAND, CHECK_ZNODE, SETUP_KERBEROS_PLUGIN);
+          SECURE_SOLR_ZNODE_COMMAND, CHECK_ZNODE, SETUP_KERBEROS_PLUGIN, REMOVE_ADMIN_HANDLERS);
         helpFormatter.printHelp(CMD_LINE_SYNTAX, options);
         exit(1, String.format("One of the supported commands is required (%s)", StringUtils.join(commands,
"|")));
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/520d8fcc/ambari-infra/ambari-infra-solr-client/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/ambari-infra/ambari-infra-solr-client/src/main/resources/log4j.properties b/ambari-infra/ambari-infra-solr-client/src/main/resources/log4j.properties
index e8dca12..4779596 100644
--- a/ambari-infra/ambari-infra-solr-client/src/main/resources/log4j.properties
+++ b/ambari-infra/ambari-infra-solr-client/src/main/resources/log4j.properties
@@ -23,9 +23,13 @@ log4j.appender.stdout.Threshold=INFO
 log4j.appender.stdout.Target=System.out
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=%m%n
+log4j.appender.stdout.filter.lvlRangeFilter=org.apache.log4j.varia.LevelRangeFilter
+log4j.appender.stdout.filter.lvlRangeFilter.LevelMax=WARN
 
 log4j.appender.stderr=org.apache.log4j.ConsoleAppender
 log4j.appender.stderr.Threshold=ERROR
 log4j.appender.stderr.Target=System.err
 log4j.appender.stderr.layout=org.apache.log4j.PatternLayout
-log4j.appender.stderr.layout.ConversionPattern=%m%n
\ No newline at end of file
+log4j.appender.stderr.layout.ConversionPattern=%m%n
+log4j.appender.stderr.filter.lvlRangeFilter=org.apache.log4j.varia.LevelRangeFilter
+log4j.appender.stderr.filter.lvlRangeFilter.LevelMin=ERROR
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/520d8fcc/ambari-infra/ambari-infra-solr-client/src/main/resources/solrCloudCli.sh
----------------------------------------------------------------------
diff --git a/ambari-infra/ambari-infra-solr-client/src/main/resources/solrCloudCli.sh b/ambari-infra/ambari-infra-solr-client/src/main/resources/solrCloudCli.sh
index 7bfa864..ac7d59f 100644
--- a/ambari-infra/ambari-infra-solr-client/src/main/resources/solrCloudCli.sh
+++ b/ambari-infra/ambari-infra-solr-client/src/main/resources/solrCloudCli.sh
@@ -16,5 +16,11 @@
 
 JVM="java"
 sdir="`dirname \"$0\"`"
+ldir="`dirname "$(readlink -f "$0")"`"
 
-PATH=$JAVA_HOME/bin:$PATH $JVM -classpath "$sdir:$sdir/libs/*" org.apache.ambari.infra.solr.AmbariSolrCloudCLI
${1+"$@"}
\ No newline at end of file
+DIR="$sdir"
+if [ "$sdir" != "$ldir" ]; then
+  DIR="$ldir"
+fi
+
+PATH=$JAVA_HOME/bin:$PATH $JVM -classpath "$DIR:$DIR/libs/*" org.apache.ambari.infra.solr.AmbariSolrCloudCLI
${1+"$@"}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/520d8fcc/ambari-infra/ambari-infra-solr-client/src/main/resources/solrIndexHelper.sh
----------------------------------------------------------------------
diff --git a/ambari-infra/ambari-infra-solr-client/src/main/resources/solrIndexHelper.sh b/ambari-infra/ambari-infra-solr-client/src/main/resources/solrIndexHelper.sh
index 12e6a77..1d219d6 100755
--- a/ambari-infra/ambari-infra-solr-client/src/main/resources/solrIndexHelper.sh
+++ b/ambari-infra/ambari-infra-solr-client/src/main/resources/solrIndexHelper.sh
@@ -16,6 +16,12 @@
 
 JVM="java"
 sdir="`dirname \"$0\"`"
+ldir="`dirname "$(readlink -f "$0")"`"
+
+DIR="$sdir"
+if [ "$sdir" != "$ldir" ]; then
+  DIR="$ldir"
+fi
 : ${JAVA_HOME:?"Please set the JAVA_HOME for lucene index migration!"}
 
 function print_help() {
@@ -48,7 +54,7 @@ function upgrade_core() {
   for coll in $SOLR_CORE_FILTER_ARR; do
     if [[ "$1" == *"$coll"* ]]; then
       echo "Core '$1' dir name contains $coll (core filter)'";
-      version=$(PATH=$JAVA_HOME/bin:$PATH $JVM -classpath "$sdir/libs/lucene-core-6.6.0.jar:$sdir/libs/lucene-backward-codecs-6.6.0.jar"
org.apache.lucene.index.CheckIndex -fast $1|grep "   version="|sed -e 's/.*=//g'|head -1)
+      version=$(PATH=$JAVA_HOME/bin:$PATH $JVM -classpath "$DIR/libs/lucene-core-6.6.0.jar:$DIR/libs/lucene-backward-codecs-6.6.0.jar"
org.apache.lucene.index.CheckIndex -fast $1|grep "   version="|sed -e 's/.*=//g'|head -1)
       if [ -z $version ] ; then
         echo "Core '$1' - Empty index?"
         return
@@ -58,7 +64,7 @@ function upgrade_core() {
         echo "Core '$1' - Already on version $version, not upgrading. Use -f or --force option
to run upgrade anyway."
       else
         echo "Core '$1' - Index version is $version, upgrading ..."
-        PATH=$JAVA_HOME/bin:$PATH $JVM -classpath "$sdir/libs/lucene-core-6.6.0.jar:$sdir/libs/lucene-backward-codecs-6.6.0.jar"
org.apache.lucene.index.IndexUpgrader -delete-prior-commits $1
+        PATH=$JAVA_HOME/bin:$PATH $JVM -classpath "$DIR/libs/lucene-core-6.6.0.jar:$DIR/libs/lucene-backward-codecs-6.6.0.jar"
org.apache.lucene.index.IndexUpgrader -delete-prior-commits $1
         echo "Upgrading core '$1' has finished"
       fi
     fi
@@ -125,11 +131,11 @@ function upgrade_index() {
 
 function upgrade_index_tool() {
   # see: https://cwiki.apache.org/confluence/display/solr/IndexUpgrader+Tool
-  PATH=$JAVA_HOME/bin:$PATH $JVM -classpath "$sdir/libs/lucene-core-6.6.0.jar:$sdir/libs/lucene-backward-codecs-6.6.0.jar"
org.apache.lucene.index.IndexUpgrader ${@}
+  PATH=$JAVA_HOME/bin:$PATH $JVM -classpath "$DIR/libs/lucene-core-6.6.0.jar:$DIR/libs/lucene-backward-codecs-6.6.0.jar"
org.apache.lucene.index.IndexUpgrader ${@}
 }
 
 function check_index_tool() {
-  PATH=$JAVA_HOME/bin:$PATH $JVM -classpath "$sdir/libs/lucene-core-6.6.0.jar:$sdir/libs/lucene-backward-codecs-6.6.0.jar"
org.apache.lucene.index.CheckIndex ${@}
+  PATH=$JAVA_HOME/bin:$PATH $JVM -classpath "$DIR/libs/lucene-core-6.6.0.jar:$DIR/libs/lucene-backward-codecs-6.6.0.jar"
org.apache.lucene.index.CheckIndex ${@}
 }
 
 function main() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/520d8fcc/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 0d0adc3..df77961 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
@@ -30,9 +30,13 @@ log4j.appender.stdout.Threshold=INFO
 log4j.appender.stdout.Target=System.out
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=%m%n
+log4j.appender.stdout.filter.lvlRangeFilter=org.apache.log4j.varia.LevelRangeFilter
+log4j.appender.stdout.filter.lvlRangeFilter.LevelMax=WARN
 
 log4j.appender.stderr=org.apache.log4j.ConsoleAppender
 log4j.appender.stderr.Threshold=ERROR
 log4j.appender.stderr.Target=System.err
 log4j.appender.stderr.layout=org.apache.log4j.PatternLayout
 log4j.appender.stderr.layout.ConversionPattern=%m%n
+log4j.appender.stderr.filter.lvlRangeFilter=org.apache.log4j.varia.LevelRangeFilter
+log4j.appender.stderr.filter.lvlRangeFilter.LevelMin=ERROR


Mime
View raw message