You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ve...@apache.org on 2015/12/11 06:19:24 UTC

[6/8] incubator-ranger git commit: RANGER-728: Update Solr script to resolve issues with ZK and creating collection (cherry-picked commit 269617d5dbf13fcbf9600efca72bc5a803f49a92)

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/setup.sh
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/setup.sh b/security-admin/contrib/solr_for_audit_setup/setup.sh
index 11d5501..ddf28d6 100755
--- a/security-admin/contrib/solr_for_audit_setup/setup.sh
+++ b/security-admin/contrib/solr_for_audit_setup/setup.sh
@@ -16,7 +16,6 @@
 
 #This script downloads Solr (optional) and sets up Solr for Ranger Audit Server
 curr_dir=`pwd`
-
 . ./install.properties
 
 #Current timestamp
@@ -259,30 +258,36 @@ if [ "$SOLR_DEPLOYMENT" = "standalone" ]; then
     cp -r solr_standalone/* $SOLR_RANGER_HOME
     mkdir -p $SOLR_RANGER_HOME/${SOLR_RANGER_COLLECTION}/conf
     cp -r conf/* $SOLR_RANGER_HOME/${SOLR_RANGER_COLLECTION}/conf
-    sed  "s#__RANGER_AUDITS_DATA_FOLDER__#$SOLR_RANGER_DATA_FOLDER#g" $SOLR_RANGER_HOME/${SOLR_RANGER_COLLECTION}/core.properties.template > $SOLR_RANGER_HOME/${SOLR_RANGER_COLLECTION}/core.properties
-    sed -e "s#__JAVA_HOME__#$JAVA_HOME#g" -e "s#__SOLR_USER__#$SOLR_USER#g" -e "s#__SOLR_MAX_MEM__#$SOLR_MAX_MEM#g" -e "s#__SOLR_INSTALL_DIR__#$SOLR_INSTALL_FOLDER#g" -e "s#__SOLR_RANGER_HOME__#$SOLR_RANGER_HOME#g" -e "s#__SOLR_PORT__#$SOLR_RANGER_PORT#g" -e "s#__SOLR_LOG_FOLDER__#$SOLR_LOG_FOLDER#g" $SOLR_RANGER_HOME/scripts/start_solr.sh.template > $SOLR_RANGER_HOME/scripts/start_solr.sh
 
+    sed  -e "s#{{MAX_AUDIT_RETENTION_DAYS}}#$MAX_AUDIT_RETENTION_DAYS#g" $SOLR_RANGER_HOME/${SOLR_RANGER_COLLECTION}/conf/solrconfig.xml.j2 > $SOLR_RANGER_HOME/${SOLR_RANGER_COLLECTION}/conf/solrconfig.xml
+    sed  "s#{{RANGER_AUDITS_DATA_FOLDER}}#$SOLR_RANGER_DATA_FOLDER#g" $SOLR_RANGER_HOME/${SOLR_RANGER_COLLECTION}/core.properties.j2 > $SOLR_RANGER_HOME/${SOLR_RANGER_COLLECTION}/core.properties
+    sed  -e "s#{{JAVA_HOME}}#$JAVA_HOME#g" -e "s#{{SOLR_USER}}#$SOLR_USER#g"  -e "s#{{SOLR_MAX_MEM}}#$SOLR_MAX_MEM#g" -e "s#{{SOLR_INSTALL_DIR}}#$SOLR_INSTALL_FOLDER#g" -e "s#{{SOLR_RANGER_HOME}}#$SOLR_RANGER_HOME#g" -e "s#{{SOLR_PORT}}#$SOLR_RANGER_PORT#g" -e "s#{{SOLR_LOG_FOLDER}}#$SOLR_LOG_FOLDER#g" $SOLR_RANGER_HOME/scripts/solr.in.sh.j2 > $SOLR_RANGER_HOME/scripts/solr.in.sh
+    
 else
-
     echo "`date`|INFO|Configuring SolrCloud instance"
     cp -r solr_cloud/* $SOLR_RANGER_HOME
     mkdir -p $SOLR_RANGER_HOME/conf
     cp -r conf/* $SOLR_RANGER_HOME/conf
 
     #Get the first ZooKeeper host:port/path
-    FIRST_SOLR_ZK=$(IFS="," ; set -- $SOLR_ZK ; echo $1)
+    #FIRST_SOLR_ZK=$(IFS="," ; set -- $SOLR_ZK ; echo $1)
+    FIRST_SOLR_ZK=$SOLR_ZK
 
-    sed  -e "s#__JAVA_HOME__#$JAVA_HOME#g" -e "s#__SOLR_USER__#$SOLR_USER#g"  -e "s#__SOLR_MAX_MEM__#$SOLR_MAX_MEM#g" -e "s#__SOLR_INSTALL_DIR__#$SOLR_INSTALL_FOLDER#g" -e "s#__SOLR_RANGER_HOME__#$SOLR_RANGER_HOME#g" -e "s#__SOLR_PORT__#$SOLR_RANGER_PORT#g" -e "s#__SOLR_ZK__#$SOLR_ZK#g" -e "s#__SOLR_LOG_FOLDER__#$SOLR_LOG_FOLDER#g" $SOLR_RANGER_HOME/scripts/start_solr.sh.template > $SOLR_RANGER_HOME/scripts/start_solr.sh
+    sed  -e "s#{{MAX_AUDIT_RETENTION_DAYS}}#$MAX_AUDIT_RETENTION_DAYS#g" $SOLR_RANGER_HOME/conf/solrconfig.xml.j2 > $SOLR_RANGER_HOME/conf/solrconfig.xml
+
+    sed  -e "s#{{JAVA_HOME}}#$JAVA_HOME#g" -e "s#{{SOLR_USER}}#$SOLR_USER#g"  -e "s#{{SOLR_MAX_MEM}}#$SOLR_MAX_MEM#g" -e "s#{{SOLR_INSTALL_DIR}}#$SOLR_INSTALL_FOLDER#g" -e "s#{{SOLR_RANGER_HOME}}#$SOLR_RANGER_HOME#g" -e "s#{{SOLR_PORT}}#$SOLR_RANGER_PORT#g" -e "s#{{SOLR_ZK}}#$SOLR_ZK#g" -e "s#{{SOLR_LOG_FOLDER}}#$SOLR_LOG_FOLDER#g" $SOLR_RANGER_HOME/scripts/solr.in.sh.j2 > $SOLR_RANGER_HOME/scripts/solr.in.sh
+
+    sed -e "s#{{JAVA_HOME}}#$JAVA_HOME#g" -e "s#{{SOLR_USER}}#$SOLR_USER#g" -e "s#{{SOLR_INSTALL_DIR}}#$SOLR_INSTALL_FOLDER#g" -e "s#{{SOLR_RANGER_HOME}}#$SOLR_RANGER_HOME#g" -e "s#{{SOLR_ZK}}#$FIRST_SOLR_ZK#g" $SOLR_RANGER_HOME/scripts/add_ranger_audits_conf_to_zk.sh.j2 > $SOLR_RANGER_HOME/scripts/add_ranger_audits_conf_to_zk.sh
+    sed -e "s#{{JAVA_HOME}}#$JAVA_HOME#g" -e "s#{{SOLR_INSTALL_DIR}}#$SOLR_INSTALL_FOLDER#g" -e "s#{{SOLR_ZK}}#$SOLR_ZK#g" -e "s#{{SOLR_HOST_URL}}#$SOLR_HOST_URL#g"  -e "s#{{SOLR_SHARDS}}#$SOLR_SHARDS#g"  -e "s#{{SOLR_REPLICATION}}#$SOLR_REPLICATION#g"  $SOLR_RANGER_HOME/scripts/create_ranger_audits_collection.sh.j2 > $SOLR_RANGER_HOME/scripts/create_ranger_audits_collection.sh
+    sed -e "s#{{SOLR_PORT}}#$SOLR_RANGER_PORT#g" $SOLR_RANGER_HOME/solr.xml.j2 > $SOLR_RANGER_HOME/solr.xml
 
-    sed -e "s#__JAVA_HOME__#$JAVA_HOME#g" -e "s#__SOLR_USER__#$SOLR_USER#g" -e "s#__SOLR_INSTALL_DIR__#$SOLR_INSTALL_FOLDER#g" -e "s#__SOLR_RANGER_HOME__#$SOLR_RANGER_HOME#g" -e "s#__SOLR_ZK__#$FIRST_SOLR_ZK#g" $SOLR_RANGER_HOME/scripts/add_ranger_audits_conf_to_zk.sh.template > $SOLR_RANGER_HOME/scripts/add_ranger_audits_conf_to_zk.sh
-    sed -e "s#__JAVA_HOME__#$JAVA_HOME#g" -e "s#__SOLR_INSTALL_DIR__#$SOLR_INSTALL_FOLDER#g" -e "s#__SOLR_ZK__#$SOLR_ZK#g" -e "s#__SOLR_HOST_URL__#$SOLR_HOST_URL#g"  -e "s#__SOLR_SHARDS__#$SOLR_SHARDS#g"  -e "s#__SOLR_REPLICATION__#$SOLR_REPLICATION#g"  $SOLR_RANGER_HOME/scripts/create_ranger_audits_collection.sh.template > $SOLR_RANGER_HOME/scripts/create_ranger_audits_collection.sh
-    sed -e "s#__SOLR_PORT__#$SOLR_RANGER_PORT#g" $SOLR_RANGER_HOME/solr.xml.template > $SOLR_RANGER_HOME/solr.xml
 fi
 
 #Common overrides
-sed -e "s#__JAVA_HOME__#$JAVA_HOME#g" -e "s#__SOLR_USER__#$SOLR_USER#g" -e "s#__SOLR_INSTALL_DIR__#$SOLR_INSTALL_FOLDER#g" -e "s#__SOLR_PORT__#$SOLR_RANGER_PORT#g" -e "s#__SOLR_LOG_FOLDER__#$SOLR_LOG_FOLDER#g" $SOLR_RANGER_HOME/scripts/stop_solr.sh.template > $SOLR_RANGER_HOME/scripts/stop_solr.sh
-sed  -e "s#__SOLR_LOG_FOLDER__#$SOLR_LOG_FOLDER#g" $SOLR_RANGER_HOME/resources/log4j.properties.template > $SOLR_RANGER_HOME/resources/log4j.properties
-
+sed -e "s#{{JAVA_HOME}}#$JAVA_HOME#g" -e "s#{{SOLR_INSTALL_DIR}}#$SOLR_INSTALL_FOLDER#g" -e "s#{{SOLR_PORT}}#$SOLR_RANGER_PORT#g" -e "s#{{SOLR_USER}}#$SOLR_USER#g" -e "s#{{SOLR_LOG_FOLDER}}#$SOLR_LOG_FOLDER#g" -e "s#{{SOLR_RANGER_HOME}}#$SOLR_RANGER_HOME#g" $SOLR_RANGER_HOME/scripts/stop_solr.sh.j2 > $SOLR_RANGER_HOME/scripts/stop_solr.sh
+sed  -e "s#{{SOLR_LOG_FOLDER}}#$SOLR_LOG_FOLDER#g" $SOLR_RANGER_HOME/resources/log4j.properties.j2 > $SOLR_RANGER_HOME/resources/log4j.properties
+sed -e "s#{{JAVA_HOME}}#$JAVA_HOME#g" -e "s#{{SOLR_USER}}#$SOLR_USER#g" -e "s#{{SOLR_ZK}}#$SOLR_ZK#g" -e "s#{{SOLR_INSTALL_DIR}}#$SOLR_INSTALL_FOLDER#g" -e "s#{{SOLR_RANGER_HOME}}#$SOLR_RANGER_HOME#g" -e "s#{{SOLR_PORT}}#$SOLR_RANGER_PORT#g" $SOLR_RANGER_HOME/scripts/solr.sh.j2 > $SOLR_RANGER_HOME/scripts/solr.sh
+sed  -e "s#{{SOLR_USER}}#$SOLR_USER#g" -e "s#{{SOLR_INSTALL_DIR}}#$SOLR_INSTALL_FOLDER#g" -e "s#{{SOLR_RANGER_HOME}}#$SOLR_RANGER_HOME#g" $SOLR_RANGER_HOME/scripts/start_solr.sh.j2 > $SOLR_RANGER_HOME/scripts/start_solr.sh
 
 #Let's make all ownership is given to $SOLR_USER
 if [ $is_root -eq 1 ]; then
@@ -341,7 +346,7 @@ EOF
 
 if [ "$SOLR_REPLICATION" != "1" ]; then
     cat >> $SOLR_INSTALL_NOTES <<EOF
-1. Using $0 script install and configure Solr for Ranger Audits on all other nodes also (don't start it yet)
+1. Copy the same install.properties on all solr nodes and sing $0 script install and configure Solr for Ranger Audits on all other nodes also (don't start it yet)
 2. Execute $SOLR_RANGER_HOME/scripts/add_ranger_audits_conf_to_zk.sh (only once from any node)
 3. Start Solr on all nodes: $SOLR_RANGER_HOME/scripts/start_solr.sh
 4. Create Ranger Audit collection: $SOLR_RANGER_HOME/scripts/create_ranger_audits_collection.sh (only once from any node)

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/add_ranger_audits_conf_to_zk.sh.j2
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/add_ranger_audits_conf_to_zk.sh.j2 b/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/add_ranger_audits_conf_to_zk.sh.j2
new file mode 100755
index 0000000..346d2f2
--- /dev/null
+++ b/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/add_ranger_audits_conf_to_zk.sh.j2
@@ -0,0 +1,63 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#This scripts add the ranger_audit configuration with schema to zookeeper
+
+function usage {
+    echo "Error: The following properties need to be set in the script SOLR_ZK, SOLR_INSTALL_DIR and SOLR_RANGER_HOME"
+    exit 1
+}
+
+JAVA_HOME={{JAVA_HOME}}
+SOLR_USER={{SOLR_USER}}
+SOLR_ZK={{SOLR_ZK}}
+SOLR_INSTALL_DIR={{SOLR_INSTALL_DIR}}
+SOLR_RANGER_HOME={{SOLR_RANGER_HOME}}
+
+if [ "`whoami`" != "$SOLR_USER" ]; then
+    if [ -w /etc/passwd ]; then
+	echo "Running this script as $SOLR_USER..."
+	su $SOLR_USER $0
+    else
+	echo "ERROR: You need to run this script $0 as user $SOLR_USER. You are currently running it as `whoami`"
+    fi
+    
+    exit 1
+fi
+
+if [ "$SOLR_ZK" = "" ]; then
+    usage
+fi
+
+if [ "$SOLR_INSTALL_DIR" = "" ]; then
+    usage
+fi
+
+if [ "$SOLR_RANGER_HOME" = "" ]; then
+    usage
+fi
+
+SOLR_RANGER_CONFIG_NAME=ranger_audits
+SOLR_RANGER_CONFIG_LOCAL_PATH=${SOLR_RANGER_HOME}/conf
+ZK_CLI=$SOLR_INSTALL_DIR/server/scripts/cloud-scripts/zkcli.sh
+
+
+if [ ! -x $ZK_CLI ]; then
+    echo "Error: $ZK_CLI is not found or you don't have permission to execute it."
+    exit 1
+fi
+set -x
+$ZK_CLI -cmd upconfig -zkhost $SOLR_ZK -confname $SOLR_RANGER_CONFIG_NAME -confdir $SOLR_RANGER_CONFIG_LOCAL_PATH

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/add_ranger_audits_conf_to_zk.sh.template
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/add_ranger_audits_conf_to_zk.sh.template b/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/add_ranger_audits_conf_to_zk.sh.template
deleted file mode 100755
index 3d70106..0000000
--- a/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/add_ranger_audits_conf_to_zk.sh.template
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-#This scripts add the ranger_audit configuration with schema to zookeeper
-
-function usage {
-    echo "Error: The following properties need to be set in the script SOLR_ZK, SOLR_INSTALL_DIR and SOLR_RANGER_HOME"
-    exit 1
-}
-
-JAVA_HOME=__JAVA_HOME__
-SOLR_USER=__SOLR_USER__
-SOLR_ZK=__SOLR_ZK__
-SOLR_INSTALL_DIR=__SOLR_INSTALL_DIR__
-SOLR_RANGER_HOME=__SOLR_RANGER_HOME__
-
-if [ "`whoami`" != "$SOLR_USER" ]; then
-    if [ -w /etc/passwd ]; then
-	echo "Running this script as $SOLR_USER..."
-	su $SOLR_USER $0
-    else
-	echo "ERROR: You need to run this script $0 as user $SOLR_USER. You are currently running it as `whoami`"
-    fi
-    
-    exit 1
-fi
-
-if [ "$SOLR_ZK" = "" ]; then
-    usage
-fi
-
-if [ "$SOLR_INSTALL_DIR" = "" ]; then
-    usage
-fi
-
-if [ "$SOLR_RANGER_HOME" = "" ]; then
-    usage
-fi
-
-SOLR_RANGER_CONFIG_NAME=ranger_audits
-SOLR_RANGER_CONFIG_LOCAL_PATH=${SOLR_RANGER_HOME}/conf
-ZK_CLI=$SOLR_INSTALL_DIR/server/scripts/cloud-scripts/zkcli.sh
-
-
-if [ ! -x $ZK_CLI ]; then
-    echo "Error: $ZK_CLI is not found or you don't have permission to execute it."
-    exit 1
-fi
-set -x
-$ZK_CLI -cmd upconfig -zkhost $SOLR_ZK -confname $SOLR_RANGER_CONFIG_NAME -confdir $SOLR_RANGER_CONFIG_LOCAL_PATH

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/create_ranger_audits_collection.sh.j2
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/create_ranger_audits_collection.sh.j2 b/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/create_ranger_audits_collection.sh.j2
new file mode 100755
index 0000000..b0d13ec
--- /dev/null
+++ b/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/create_ranger_audits_collection.sh.j2
@@ -0,0 +1,33 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+SOLR_HOST_URL={{SOLR_HOST_URL}}
+SOLR_ZK={{SOLR_ZK}}
+SOLR_INSTALL_DIR={{SOLR_INSTALL_DIR}}
+SHARDS={{SOLR_SHARDS}}
+REPLICATION={{SOLR_REPLICATION}}
+
+CONF_NAME=ranger_audits
+COLLECTION_NAME=ranger_audits
+
+which curl 2>&1 > /dev/null
+if [ $? -ne 0 ]; then
+    echo "curl is not found. Please install it for creating the collection"
+    exit 1
+fi
+
+set -x
+curl --negotiate -u : "${SOLR_HOST_URL}/solr/admin/collections?action=CREATE&name=${COLLECTION_NAME}&numShards=${SHARDS}&replicationFactor=${REPLICATION}&collection.configName=$CONF_NAME&maxShardsPerNode=100"

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/create_ranger_audits_collection.sh.template
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/create_ranger_audits_collection.sh.template b/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/create_ranger_audits_collection.sh.template
deleted file mode 100755
index c44255c..0000000
--- a/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/create_ranger_audits_collection.sh.template
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-SOLR_HOST_URL=__SOLR_HOST_URL__
-SOLR_ZK=__SOLR_ZK__
-SOLR_INSTALL_DIR=__SOLR_INSTALL_DIR__
-SHARDS=__SOLR_SHARDS__
-REPLICATION=__SOLR_REPLICATION__
-
-CONF_NAME=ranger_audits
-COLLECTION_NAME=ranger_audits
-
-which curl 2>&1 > /dev/null
-if [ $? -ne 0 ]; then
-    echo "curl is not fould. Please install it for creating the collection"
-    exit 1
-fi
-
-set -x
-curl --negotiate -u : "${SOLR_HOST_URL}/solr/admin/collections?action=CREATE&name=${COLLECTION_NAME}&numShards=${SHARDS}&replicationFactor=${REPLICATION}&collection.configName=$CONF_NAME&maxShardsPerNode=100"

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/solr.in.sh.j2
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/solr.in.sh.j2 b/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/solr.in.sh.j2
new file mode 100755
index 0000000..3be0629
--- /dev/null
+++ b/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/solr.in.sh.j2
@@ -0,0 +1,116 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# By default the script will use JAVA_HOME to determine which java
+# to use, but you can set a specific path for Solr to use without
+# affecting other Java applications on your server/workstation.
+SOLR_JAVA_HOME="{{JAVA_HOME}}"
+
+# Increase Java Heap as needed to support your indexing / query needs
+#SOLR_HEAP="512m"
+
+# Expert: If you want finer control over memory options, specify them directly
+# Comment out SOLR_HEAP if you are using this though, that takes precedence
+SOLR_JAVA_MEM="-Xms{{SOLR_MAX_MEM}} -Xmx{{SOLR_MAX_MEM}}"
+
+# Enable verbose GC logging
+GC_LOG_OPTS="-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails \
+-XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime"
+
+# These GC settings have shown to work well for a number of common Solr workloads
+GC_TUNE="-XX:NewRatio=3 \
+-XX:SurvivorRatio=4 \
+-XX:TargetSurvivorRatio=90 \
+-XX:MaxTenuringThreshold=8 \
+-XX:+UseConcMarkSweepGC \
+-XX:+UseParNewGC \
+-XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 \
+-XX:+CMSScavengeBeforeRemark \
+-XX:PretenureSizeThreshold=64m \
+-XX:+UseCMSInitiatingOccupancyOnly \
+-XX:CMSInitiatingOccupancyFraction=50 \
+-XX:CMSMaxAbortablePrecleanTime=6000 \
+-XX:+CMSParallelRemarkEnabled \
+-XX:+ParallelRefProcEnabled"
+
+# Set the ZooKeeper connection string if using an external ZooKeeper ensemble
+# e.g. host1:2181,host2:2181/chroot
+# Leave empty if not using SolrCloud
+ZK_HOST="{{SOLR_ZK}}"
+
+# Set the ZooKeeper client timeout (for SolrCloud mode)
+#ZK_CLIENT_TIMEOUT="15000"
+
+# By default the start script uses "localhost"; override the hostname here
+# for production SolrCloud environments to control the hostname exposed to cluster state
+#SOLR_HOST="192.168.1.1"
+
+# By default the start script uses UTC; override the timezone if needed
+#SOLR_TIMEZONE="UTC"
+
+# 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="false"
+
+# The script will use SOLR_PORT+10000 for the RMI_PORT or you can set it here
+# RMI_PORT=18983
+
+# Anything you add to the SOLR_OPTS variable will be included in the java
+# start command line as-is, in ADDITION to other options. If you specify the
+# -a option on start script, those options will be appended as well. Examples:
+#SOLR_OPTS="$SOLR_OPTS -Dsolr.autoSoftCommit.maxTime=3000"
+#SOLR_OPTS="$SOLR_OPTS -Dsolr.autoCommit.maxTime=60000"
+#SOLR_OPTS="$SOLR_OPTS -Dsolr.clustering.enabled=true"
+
+# 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
+#SOLR_PID_DIR=
+
+# Path to a directory where Solr creates index files, the specified directory
+# must contain a solr.xml; by default, Solr will use server/solr
+SOLR_HOME={{SOLR_RANGER_HOME}}
+
+# Solr provides a default Log4J configuration properties file in server/resources
+# however, you may want to customize the log settings and file appender location
+# so you can point the script to use a different log4j.properties file
+LOG4J_PROPS=$SOLR_HOME/resources/log4j.properties
+
+# Location where Solr should write logs to; should agree with the file appender
+# settings in server/resources/log4j.properties
+SOLR_LOGS_DIR={{SOLR_LOG_FOLDER}}
+
+# Sets the port Solr binds to, default is 8983
+SOLR_PORT={{SOLR_PORT}}
+
+# Uncomment to set SSL-related system properties
+# Be sure to update the paths to the correct keystore for your environment
+#SOLR_SSL_KEY_STORE=etc/solr-ssl.keystore.jks
+#SOLR_SSL_KEY_STORE_PASSWORD=secret
+#SOLR_SSL_TRUST_STORE=etc/solr-ssl.keystore.jks
+#SOLR_SSL_TRUST_STORE_PASSWORD=secret
+#SOLR_SSL_NEED_CLIENT_AUTH=false
+#SOLR_SSL_WANT_CLIENT_AUTH=false
+
+# Uncomment if you want to override previously defined SSL values for HTTP client
+# otherwise keep them commented and the above values will automatically be set for HTTP clients
+#SOLR_SSL_CLIENT_KEY_STORE=
+#SOLR_SSL_CLIENT_KEY_STORE_PASSWORD=
+#SOLR_SSL_CLIENT_TRUST_STORE=
+#SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD=
+
+# Settings for authentication
+#SOLR_AUTHENTICATION_CLIENT_CONFIGURER=
+#SOLR_AUTHENTICATION_OPTS=

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/solr.sh.j2
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/solr.sh.j2 b/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/solr.sh.j2
new file mode 100755
index 0000000..7832570
--- /dev/null
+++ b/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/solr.sh.j2
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+JAVA_HOME={{JAVA_HOME}}
+SOLR_INSTALL_DIR={{SOLR_INSTALL_DIR}}
+SOLR_RANGER_HOME={{SOLR_RANGER_HOME}}
+
+SOLR_INCLUDE=${SOLR_RANGER_HOME}/scripts/solr.in.sh $SOLR_INSTALL_DIR/bin/solr $*

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/start_solr.sh.j2
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/start_solr.sh.j2 b/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/start_solr.sh.j2
new file mode 100755
index 0000000..0d19fe0
--- /dev/null
+++ b/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/start_solr.sh.j2
@@ -0,0 +1,32 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+SOLR_USER={{SOLR_USER}}
+SOLR_INSTALL_DIR={{SOLR_INSTALL_DIR}}
+SOLR_RANGER_HOME={{SOLR_RANGER_HOME}}
+
+if [ "`whoami`" != "$SOLR_USER" ]; then
+    if [ -w /etc/passwd ]; then
+	echo "Running this script as $SOLR_USER..."
+	su $SOLR_USER $0 $*
+    else
+	echo "ERROR: You need to run this script $0 as user $SOLR_USER. You are currently running it as `whoami`"
+    fi
+    
+    exit 1
+fi
+
+SOLR_INCLUDE=${SOLR_RANGER_HOME}/scripts/solr.in.sh $SOLR_INSTALL_DIR/bin/solr start -c $*

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/start_solr.sh.template
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/start_solr.sh.template b/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/start_solr.sh.template
deleted file mode 100755
index f5a327e..0000000
--- a/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/start_solr.sh.template
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-JAVA_HOME=__JAVA_HOME__
-SOLR_USER=__SOLR_USER__
-SOLR_ZK=__SOLR_ZK__
-SOLR_MEMORY=__SOLR_MAX_MEM__
-SOLR_INSTALL_DIR=__SOLR_INSTALL_DIR__
-SOLR_RANGER_HOME=__SOLR_RANGER_HOME__
-SOLR_PORT=__SOLR_PORT__
-SOLR_LOG4J_FILEPATH=$SOLR_RANGER_HOME/resources/log4j.properties
-
-export SOLR_LOGS_DIR=__SOLR_LOG_FOLDER__
-
-if [ "`whoami`" != "$SOLR_USER" ]; then
-    if [ -w /etc/passwd ]; then
-	echo "Running this script as $SOLR_USER..."
-	su $SOLR_USER $0
-    else
-	echo "ERROR: You need to run this script $0 as user $SOLR_USER. You are currently running it as `whoami`"
-    fi
-    
-    exit 1
-fi
-
-$SOLR_INSTALL_DIR/bin/solr start -p $SOLR_PORT -d $SOLR_INSTALL_DIR/server -m $SOLR_MEMORY -s $SOLR_RANGER_HOME -Dlog4j.configuration=file://$SOLR_LOG4J_FILEPATH -c -z $SOLR_ZK

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/stop_solr.sh.j2
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/stop_solr.sh.j2 b/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/stop_solr.sh.j2
new file mode 100755
index 0000000..81b97ea
--- /dev/null
+++ b/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/stop_solr.sh.j2
@@ -0,0 +1,33 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+JAVA_HOME={{JAVA_HOME}}
+SOLR_USER={{SOLR_USER}}
+SOLR_INSTALL_DIR={{SOLR_INSTALL_DIR}}
+SOLR_RANGER_HOME={{SOLR_RANGER_HOME}}
+
+if [ "`whoami`" != "$SOLR_USER" ]; then
+    if [ -w /etc/passwd ]; then
+	echo "Running this script as $SOLR_USER..."
+	su $SOLR_USER $0 $*
+    else
+	echo "ERROR: You need to run this script $0 as user $SOLR_USER. You are currently running it as `whoami`"
+    fi
+    
+    exit 1
+fi
+
+SOLR_INCLUDE=${SOLR_RANGER_HOME}/scripts/solr.in.sh  $SOLR_INSTALL_DIR/bin/solr stop $*

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/stop_solr.sh.template
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/stop_solr.sh.template b/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/stop_solr.sh.template
deleted file mode 100755
index 5b85c25..0000000
--- a/security-admin/contrib/solr_for_audit_setup/solr_cloud/scripts/stop_solr.sh.template
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-JAVA_HOME=__JAVA_HOME__
-SOLR_USER=__SOLR_USER__
-SOLR_INSTALL_DIR=__SOLR_INSTALL_DIR__
-SOLR_PORT=__SOLR_PORT__
-
-export SOLR_LOGS_DIR=__SOLR_LOG_FOLDER__
-
-if [ "`whoami`" != "$SOLR_USER" ]; then
-    if [ -w /etc/passwd ]; then
-	echo "Running this script as $SOLR_USER..."
-	su $SOLR_USER $0
-    else
-	echo "ERROR: You need to run this script $0 as user $SOLR_USER. You are currently running it as `whoami`"
-    fi
-    
-    exit 1
-fi
-
-$SOLR_INSTALL_DIR/bin/solr stop -p $SOLR_PORT

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_cloud/solr.xml.j2
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_cloud/solr.xml.j2 b/security-admin/contrib/solr_for_audit_setup/solr_cloud/solr.xml.j2
new file mode 100644
index 0000000..824560b
--- /dev/null
+++ b/security-admin/contrib/solr_for_audit_setup/solr_cloud/solr.xml.j2
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<solr>
+  <solrcloud>
+    <str name="host">${host:}</str>
+    <int name="hostPort">${jetty.port:{{SOLR_PORT}}}</int>
+    <str name="hostContext">${hostContext:solr}</str>
+    <int name="zkClientTimeout">${zkClientTimeout:15000}</int>
+    <bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool>
+  </solrcloud>
+</solr>

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_cloud/solr.xml.template
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_cloud/solr.xml.template b/security-admin/contrib/solr_for_audit_setup/solr_cloud/solr.xml.template
deleted file mode 100644
index 2fab751..0000000
--- a/security-admin/contrib/solr_for_audit_setup/solr_cloud/solr.xml.template
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<solr>
-  <solrcloud>
-    <str name="host">${host:}</str>
-    <int name="hostPort">${jetty.port:__SOLR_PORT__}</int>
-    <str name="hostContext">${hostContext:solr}</str>
-    <int name="zkClientTimeout">${zkClientTimeout:15000}</int>
-    <bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool>
-  </solrcloud>
-</solr>

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_standalone/ranger_audits/core.properties.j2
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_standalone/ranger_audits/core.properties.j2 b/security-admin/contrib/solr_for_audit_setup/solr_standalone/ranger_audits/core.properties.j2
new file mode 100644
index 0000000..380b2eb
--- /dev/null
+++ b/security-admin/contrib/solr_for_audit_setup/solr_standalone/ranger_audits/core.properties.j2
@@ -0,0 +1,20 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name=ranger_audits
+config=solrconfig.xml
+schema=schema.xml
+dataDir={{RANGER_AUDITS_DATA_FOLDER}}

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_standalone/ranger_audits/core.properties.template
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_standalone/ranger_audits/core.properties.template b/security-admin/contrib/solr_for_audit_setup/solr_standalone/ranger_audits/core.properties.template
deleted file mode 100644
index f2d3205..0000000
--- a/security-admin/contrib/solr_for_audit_setup/solr_standalone/ranger_audits/core.properties.template
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-name=ranger_audits
-config=solrconfig.xml
-schema=schema.xml
-dataDir=__RANGER_AUDITS_DATA_FOLDER__

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/solr.in.sh.j2
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/solr.in.sh.j2 b/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/solr.in.sh.j2
new file mode 100755
index 0000000..9f98601
--- /dev/null
+++ b/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/solr.in.sh.j2
@@ -0,0 +1,116 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# By default the script will use JAVA_HOME to determine which java
+# to use, but you can set a specific path for Solr to use without
+# affecting other Java applications on your server/workstation.
+SOLR_JAVA_HOME="{{JAVA_HOME}}"
+
+# Increase Java Heap as needed to support your indexing / query needs
+#SOLR_HEAP="512m"
+
+# Expert: If you want finer control over memory options, specify them directly
+# Comment out SOLR_HEAP if you are using this though, that takes precedence
+SOLR_JAVA_MEM="-Xms{{SOLR_MAX_MEM}} -Xmx{{SOLR_MAX_MEM}}"
+
+# Enable verbose GC logging
+GC_LOG_OPTS="-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails \
+-XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime"
+
+# These GC settings have shown to work well for a number of common Solr workloads
+GC_TUNE="-XX:NewRatio=3 \
+-XX:SurvivorRatio=4 \
+-XX:TargetSurvivorRatio=90 \
+-XX:MaxTenuringThreshold=8 \
+-XX:+UseConcMarkSweepGC \
+-XX:+UseParNewGC \
+-XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 \
+-XX:+CMSScavengeBeforeRemark \
+-XX:PretenureSizeThreshold=64m \
+-XX:+UseCMSInitiatingOccupancyOnly \
+-XX:CMSInitiatingOccupancyFraction=50 \
+-XX:CMSMaxAbortablePrecleanTime=6000 \
+-XX:+CMSParallelRemarkEnabled \
+-XX:+ParallelRefProcEnabled"
+
+# Set the ZooKeeper connection string if using an external ZooKeeper ensemble
+# e.g. host1:2181,host2:2181/chroot
+# Leave empty if not using SolrCloud
+ZK_HOST=
+
+# Set the ZooKeeper client timeout (for SolrCloud mode)
+#ZK_CLIENT_TIMEOUT="15000"
+
+# By default the start script uses "localhost"; override the hostname here
+# for production SolrCloud environments to control the hostname exposed to cluster state
+#SOLR_HOST="192.168.1.1"
+
+# By default the start script uses UTC; override the timezone if needed
+#SOLR_TIMEZONE="UTC"
+
+# 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="false"
+
+# The script will use SOLR_PORT+10000 for the RMI_PORT or you can set it here
+# RMI_PORT=18983
+
+# Anything you add to the SOLR_OPTS variable will be included in the java
+# start command line as-is, in ADDITION to other options. If you specify the
+# -a option on start script, those options will be appended as well. Examples:
+#SOLR_OPTS="$SOLR_OPTS -Dsolr.autoSoftCommit.maxTime=3000"
+#SOLR_OPTS="$SOLR_OPTS -Dsolr.autoCommit.maxTime=60000"
+#SOLR_OPTS="$SOLR_OPTS -Dsolr.clustering.enabled=true"
+
+# 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
+#SOLR_PID_DIR=
+
+# Path to a directory where Solr creates index files, the specified directory
+# must contain a solr.xml; by default, Solr will use server/solr
+SOLR_HOME={{SOLR_RANGER_HOME}}
+
+# Solr provides a default Log4J configuration properties file in server/resources
+# however, you may want to customize the log settings and file appender location
+# so you can point the script to use a different log4j.properties file
+LOG4J_PROPS=$SOLR_HOME/resources/log4j.properties
+
+# Location where Solr should write logs to; should agree with the file appender
+# settings in server/resources/log4j.properties
+SOLR_LOGS_DIR={{SOLR_LOG_FOLDER}}
+
+# Sets the port Solr binds to, default is 8983
+SOLR_PORT={{SOLR_PORT}}
+
+# Uncomment to set SSL-related system properties
+# Be sure to update the paths to the correct keystore for your environment
+#SOLR_SSL_KEY_STORE=etc/solr-ssl.keystore.jks
+#SOLR_SSL_KEY_STORE_PASSWORD=secret
+#SOLR_SSL_TRUST_STORE=etc/solr-ssl.keystore.jks
+#SOLR_SSL_TRUST_STORE_PASSWORD=secret
+#SOLR_SSL_NEED_CLIENT_AUTH=false
+#SOLR_SSL_WANT_CLIENT_AUTH=false
+
+# Uncomment if you want to override previously defined SSL values for HTTP client
+# otherwise keep them commented and the above values will automatically be set for HTTP clients
+#SOLR_SSL_CLIENT_KEY_STORE=
+#SOLR_SSL_CLIENT_KEY_STORE_PASSWORD=
+#SOLR_SSL_CLIENT_TRUST_STORE=
+#SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD=
+
+# Settings for authentication
+#SOLR_AUTHENTICATION_CLIENT_CONFIGURER=
+#SOLR_AUTHENTICATION_OPTS=

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/solr.sh.j2
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/solr.sh.j2 b/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/solr.sh.j2
new file mode 100755
index 0000000..7832570
--- /dev/null
+++ b/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/solr.sh.j2
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+JAVA_HOME={{JAVA_HOME}}
+SOLR_INSTALL_DIR={{SOLR_INSTALL_DIR}}
+SOLR_RANGER_HOME={{SOLR_RANGER_HOME}}
+
+SOLR_INCLUDE=${SOLR_RANGER_HOME}/scripts/solr.in.sh $SOLR_INSTALL_DIR/bin/solr $*

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/start_solr.sh.j2
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/start_solr.sh.j2 b/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/start_solr.sh.j2
new file mode 100755
index 0000000..5b1ff92
--- /dev/null
+++ b/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/start_solr.sh.j2
@@ -0,0 +1,33 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+SOLR_USER={{SOLR_USER}}
+SOLR_INSTALL_DIR={{SOLR_INSTALL_DIR}}
+SOLR_RANGER_HOME={{SOLR_RANGER_HOME}}
+
+if [ "`whoami`" != "$SOLR_USER" ]; then
+    if [ -w /etc/passwd ]; then
+	echo "Running this script as $SOLR_USER..."
+	su $SOLR_USER $0
+    else
+	echo "ERROR: You need to run this script $0 as user $SOLR_USER. You are currently running it as `whoami`"
+    fi
+    
+    exit 1
+fi
+
+SOLR_INCLUDE=${SOLR_RANGER_HOME}/scripts/solr.in.sh $SOLR_INSTALL_DIR/bin/solr start $*
+

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/start_solr.sh.template
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/start_solr.sh.template b/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/start_solr.sh.template
deleted file mode 100755
index 2a4bb38..0000000
--- a/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/start_solr.sh.template
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-JAVA_HOME=__JAVA_HOME__
-SOLR_USER=__SOLR_USER__
-SOLR_MEMORY=__SOLR_MAX_MEM__
-SOLR_INSTALL_DIR=__SOLR_INSTALL_DIR__
-SOLR_RANGER_HOME=__SOLR_RANGER_HOME__
-SOLR_PORT=__SOLR_PORT__
-SOLR_LOG4J_FILEPATH=$SOLR_RANGER_HOME/resources/log4j.properties
-
-export SOLR_LOGS_DIR=__SOLR_LOG_FOLDER__
-
-if [ "`whoami`" != "$SOLR_USER" ]; then
-    if [ -w /etc/passwd ]; then
-	echo "Running this script as $SOLR_USER..."
-	su $SOLR_USER $0
-    else
-	echo "ERROR: You need to run this script $0 as user $SOLR_USER. You are currently running it as `whoami`"
-    fi
-    
-    exit 1
-fi
-
-$SOLR_INSTALL_DIR/bin/solr start -p $SOLR_PORT -d $SOLR_INSTALL_DIR/server -m $SOLR_MEMORY -s $SOLR_RANGER_HOME -Dlog4j.configuration=file://$SOLR_LOG4J_FILEPATH

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/stop_solr.sh.j2
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/stop_solr.sh.j2 b/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/stop_solr.sh.j2
new file mode 100755
index 0000000..81b97ea
--- /dev/null
+++ b/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/stop_solr.sh.j2
@@ -0,0 +1,33 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+JAVA_HOME={{JAVA_HOME}}
+SOLR_USER={{SOLR_USER}}
+SOLR_INSTALL_DIR={{SOLR_INSTALL_DIR}}
+SOLR_RANGER_HOME={{SOLR_RANGER_HOME}}
+
+if [ "`whoami`" != "$SOLR_USER" ]; then
+    if [ -w /etc/passwd ]; then
+	echo "Running this script as $SOLR_USER..."
+	su $SOLR_USER $0 $*
+    else
+	echo "ERROR: You need to run this script $0 as user $SOLR_USER. You are currently running it as `whoami`"
+    fi
+    
+    exit 1
+fi
+
+SOLR_INCLUDE=${SOLR_RANGER_HOME}/scripts/solr.in.sh  $SOLR_INSTALL_DIR/bin/solr stop $*

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/262da5a4/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/stop_solr.sh.template
----------------------------------------------------------------------
diff --git a/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/stop_solr.sh.template b/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/stop_solr.sh.template
deleted file mode 100755
index 5b85c25..0000000
--- a/security-admin/contrib/solr_for_audit_setup/solr_standalone/scripts/stop_solr.sh.template
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-JAVA_HOME=__JAVA_HOME__
-SOLR_USER=__SOLR_USER__
-SOLR_INSTALL_DIR=__SOLR_INSTALL_DIR__
-SOLR_PORT=__SOLR_PORT__
-
-export SOLR_LOGS_DIR=__SOLR_LOG_FOLDER__
-
-if [ "`whoami`" != "$SOLR_USER" ]; then
-    if [ -w /etc/passwd ]; then
-	echo "Running this script as $SOLR_USER..."
-	su $SOLR_USER $0
-    else
-	echo "ERROR: You need to run this script $0 as user $SOLR_USER. You are currently running it as `whoami`"
-    fi
-    
-    exit 1
-fi
-
-$SOLR_INSTALL_DIR/bin/solr stop -p $SOLR_PORT