commit
This commit is contained in:
78
solr/bin/init.d/solr
Executable file
78
solr/bin/init.d/solr
Executable file
@@ -0,0 +1,78 @@
|
||||
#!/bin/sh
|
||||
# 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.
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: solr
|
||||
# Required-Start: $remote_fs $syslog
|
||||
# Required-Stop: $remote_fs $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Description: Controls Apache Solr as a Service
|
||||
### END INIT INFO
|
||||
|
||||
# Example of a very simple *nix init script that delegates commands to the bin/solr script
|
||||
# Typical usage is to do:
|
||||
#
|
||||
# cp bin/init.d/solr /etc/init.d/solr
|
||||
# chmod 755 /etc/init.d/solr
|
||||
# chown root:root /etc/init.d/solr
|
||||
# update-rc.d solr defaults
|
||||
# update-rc.d solr enable
|
||||
|
||||
# Where you extracted the Solr distribution bundle
|
||||
SOLR_INSTALL_DIR="/opt/solr"
|
||||
|
||||
if [ ! -d "$SOLR_INSTALL_DIR" ]; then
|
||||
echo "$SOLR_INSTALL_DIR not found! Please check the SOLR_INSTALL_DIR setting in your $0 script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Path to an include file that defines environment specific settings to override default
|
||||
# variables used by the bin/solr script. It's highly recommended to define this script so
|
||||
# that you can keep the Solr binary files separated from live files (pid, logs, index data, etc)
|
||||
# see bin/solr.in.sh for an example
|
||||
SOLR_ENV="/etc/default/solr.in.sh"
|
||||
|
||||
if [ ! -f "$SOLR_ENV" ]; then
|
||||
echo "$SOLR_ENV not found! Please check the SOLR_ENV setting in your $0 script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Specify the user to run Solr as; if not set, then Solr will run as root.
|
||||
# Running Solr as root is not recommended for production environments
|
||||
RUNAS="solr"
|
||||
|
||||
# verify the specified run as user exists
|
||||
runas_uid="`id -u "$RUNAS"`"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "User $RUNAS not found! Please create the $RUNAS user before running this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart|status)
|
||||
SOLR_CMD="$1"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|status}"
|
||||
exit
|
||||
esac
|
||||
|
||||
if [ -n "$RUNAS" ]; then
|
||||
su -c "SOLR_INCLUDE=\"$SOLR_ENV\" \"$SOLR_INSTALL_DIR/bin/solr\" $SOLR_CMD" - "$RUNAS"
|
||||
else
|
||||
SOLR_INCLUDE="$SOLR_ENV" "$SOLR_INSTALL_DIR/bin/solr" "$SOLR_CMD"
|
||||
fi
|
||||
354
solr/bin/install_solr_service.sh
Executable file
354
solr/bin/install_solr_service.sh
Executable file
@@ -0,0 +1,354 @@
|
||||
#!/usr/bin/env 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.
|
||||
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo -e "\nERROR: This script must be run as root\n" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
print_usage() {
|
||||
ERROR_MSG="$1"
|
||||
|
||||
if [ "$ERROR_MSG" != "" ]; then
|
||||
echo -e "\nERROR: $ERROR_MSG\n" 1>&2
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Usage: install_solr_service.sh <path_to_solr_distribution_archive> [OPTIONS]"
|
||||
echo ""
|
||||
echo " The first argument to the script must be a path to a Solr distribution archive, such as solr-5.0.0.tgz"
|
||||
echo " (only .tgz is supported format for the archive)"
|
||||
echo ""
|
||||
echo " Supported OPTIONS include:"
|
||||
echo ""
|
||||
echo " -d Directory for live / writable Solr files, such as logs, pid files, and index data; defaults to /var/solr"
|
||||
echo ""
|
||||
echo " -i Directory to extract the Solr installation archive; defaults to /opt/"
|
||||
echo " The specified path must exist prior to using this script."
|
||||
echo ""
|
||||
echo " -p Port Solr should bind to; default is 8983"
|
||||
echo ""
|
||||
echo " -s Service name; defaults to solr"
|
||||
echo ""
|
||||
echo " -u User to own the Solr files and run the Solr process as; defaults to solr"
|
||||
echo " This script will create the specified user account if it does not exist."
|
||||
echo ""
|
||||
echo " -f Upgrade Solr. Overwrite symlink and init script of previous installation."
|
||||
echo ""
|
||||
echo " -n Do not start Solr service after install, and do not abort on missing Java"
|
||||
echo ""
|
||||
echo " NOTE: Must be run as the root user"
|
||||
echo ""
|
||||
} # end print_usage
|
||||
|
||||
print_error() {
|
||||
echo $1
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Locate *NIX distribution by looking for match from various detection strategies
|
||||
# We start with /etc/os-release, as this will also work for Docker containers
|
||||
for command in "grep -E \"^NAME=\" /etc/os-release" \
|
||||
"lsb_release -i" \
|
||||
"cat /proc/version" \
|
||||
"uname -a" ; do
|
||||
distro_string=$(eval $command 2>/dev/null)
|
||||
unset distro
|
||||
if [[ ${distro_string,,} == *"debian"* ]]; then
|
||||
distro=Debian
|
||||
elif [[ ${distro_string,,} == *"red hat"* ]]; then
|
||||
distro=RedHat
|
||||
elif [[ ${distro_string,,} == *"centos"* ]]; then
|
||||
distro=CentOS
|
||||
elif [[ ${distro_string,,} == *"ubuntu"* ]]; then
|
||||
distro=Ubuntu
|
||||
elif [[ ${distro_string,,} == *"suse"* ]]; then
|
||||
distro=SUSE
|
||||
elif [[ ${distro_string,,} == *"darwin"* ]]; then
|
||||
echo "Sorry, this script does not support macOS. You'll need to setup Solr as a service manually using the documentation provided in the Solr Reference Guide."
|
||||
echo "You could also try installing via Homebrew (https://brew.sh/), e.g. brew install solr"
|
||||
exit 1
|
||||
fi
|
||||
if [[ $distro ]] ; then break ; fi
|
||||
done
|
||||
if [[ ! $distro ]] ; then
|
||||
echo -e "\nERROR: Unable to auto-detect your *NIX distribution!\nYou'll need to setup Solr as a service manually using the documentation provided in the Solr Reference Guide.\n" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
print_usage "Must specify the path to the Solr installation archive, such as solr-5.0.0.tgz"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SOLR_ARCHIVE=$1
|
||||
if [ ! -f "$SOLR_ARCHIVE" ]; then
|
||||
print_usage "Specified Solr installation archive $SOLR_ARCHIVE not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# strip off path info
|
||||
SOLR_INSTALL_FILE=${SOLR_ARCHIVE##*/}
|
||||
if [ ${SOLR_INSTALL_FILE: -4} == ".tgz" ]; then
|
||||
SOLR_DIR=${SOLR_INSTALL_FILE%.tgz}
|
||||
else
|
||||
print_usage "Solr installation archive $SOLR_ARCHIVE is invalid, expected a .tgz file!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SOLR_START=true
|
||||
if [ $# -gt 1 ]; then
|
||||
shift
|
||||
while true; do
|
||||
case $1 in
|
||||
-i)
|
||||
if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
|
||||
print_usage "Directory path is required when using the $1 option!"
|
||||
exit 1
|
||||
fi
|
||||
SOLR_EXTRACT_DIR=$2
|
||||
shift 2
|
||||
;;
|
||||
-d)
|
||||
if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
|
||||
print_usage "Directory path is required when using the $1 option!"
|
||||
exit 1
|
||||
fi
|
||||
SOLR_VAR_DIR="$2"
|
||||
shift 2
|
||||
;;
|
||||
-u)
|
||||
if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
|
||||
print_usage "Username is required when using the $1 option!"
|
||||
exit 1
|
||||
fi
|
||||
SOLR_USER="$2"
|
||||
shift 2
|
||||
;;
|
||||
-s)
|
||||
if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
|
||||
print_usage "Service name is required when using the $1 option!"
|
||||
exit 1
|
||||
fi
|
||||
SOLR_SERVICE="$2"
|
||||
shift 2
|
||||
;;
|
||||
-p)
|
||||
if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
|
||||
print_usage "Port is required when using the $1 option!"
|
||||
exit 1
|
||||
fi
|
||||
SOLR_PORT="$2"
|
||||
shift 2
|
||||
;;
|
||||
-f)
|
||||
SOLR_UPGRADE="YES"
|
||||
shift 1
|
||||
;;
|
||||
-n)
|
||||
SOLR_START=false
|
||||
shift 1
|
||||
;;
|
||||
-help|-usage)
|
||||
print_usage ""
|
||||
exit 0
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
*)
|
||||
if [ "$1" != "" ]; then
|
||||
print_usage "Unrecognized or misplaced argument: $1!"
|
||||
exit 1
|
||||
else
|
||||
break # out-of-args, stop looping
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
# Test for availability of needed tools
|
||||
tar --version &>/dev/null || print_error "Script requires the 'tar' command"
|
||||
if [[ $SOLR_START == "true" ]] ; then
|
||||
service --version &>/dev/null || service --help &>/dev/null || print_error "Script requires the 'service' command"
|
||||
java -version &>/dev/null || print_error "Solr requires java, please install or set JAVA_HOME properly"
|
||||
fi
|
||||
lsof -h &>/dev/null || echo "We recommend installing the 'lsof' command for more stable start/stop of Solr"
|
||||
|
||||
|
||||
if [ -z "$SOLR_EXTRACT_DIR" ]; then
|
||||
SOLR_EXTRACT_DIR=/opt
|
||||
fi
|
||||
|
||||
if [ ! -d "$SOLR_EXTRACT_DIR" ]; then
|
||||
print_usage "Installation directory $SOLR_EXTRACT_DIR not found! Please create it before running this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$SOLR_SERVICE" ]; then
|
||||
SOLR_SERVICE=solr
|
||||
fi
|
||||
|
||||
if [ -z "$SOLR_VAR_DIR" ]; then
|
||||
SOLR_VAR_DIR="/var/$SOLR_SERVICE"
|
||||
fi
|
||||
|
||||
if [ -z "$SOLR_USER" ]; then
|
||||
SOLR_USER=solr
|
||||
fi
|
||||
|
||||
if [ -z "$SOLR_PORT" ]; then
|
||||
SOLR_PORT=8983
|
||||
fi
|
||||
|
||||
if [ -z "$SOLR_UPGRADE" ]; then
|
||||
SOLR_UPGRADE=NO
|
||||
fi
|
||||
|
||||
if [ ! "$SOLR_UPGRADE" = "YES" ]; then
|
||||
if [ -f "/etc/init.d/$SOLR_SERVICE" ]; then
|
||||
print_usage "/etc/init.d/$SOLR_SERVICE already exists! Perhaps Solr is already setup as a service on this host? To upgrade Solr use the -f option."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -e "$SOLR_EXTRACT_DIR/$SOLR_SERVICE" ]; then
|
||||
print_usage "$SOLR_EXTRACT_DIR/$SOLR_SERVICE already exists! Please move this directory / link or choose a different service name using the -s option."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# stop running instance
|
||||
if [ -f "/etc/init.d/$SOLR_SERVICE" ]; then
|
||||
echo -e "\nStopping Solr instance if exists ...\n"
|
||||
service "$SOLR_SERVICE" stop
|
||||
fi
|
||||
|
||||
# create user if not exists
|
||||
solr_uid="`id -u "$SOLR_USER"`"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Creating new user: $SOLR_USER"
|
||||
if [ "$distro" == "RedHat" ] || [ "$distro" == "CentOS" ] ; then
|
||||
adduser --system -U -m --home-dir "$SOLR_VAR_DIR" "$SOLR_USER"
|
||||
elif [ "$distro" == "SUSE" ]; then
|
||||
useradd --system -U -m --home-dir "$SOLR_VAR_DIR" "$SOLR_USER"
|
||||
else
|
||||
adduser --system --shell /bin/bash --group --disabled-password --home "$SOLR_VAR_DIR" "$SOLR_USER"
|
||||
fi
|
||||
fi
|
||||
|
||||
# extract
|
||||
SOLR_INSTALL_DIR="$SOLR_EXTRACT_DIR/$SOLR_DIR"
|
||||
if [ ! -d "$SOLR_INSTALL_DIR" ]; then
|
||||
|
||||
echo -e "\nExtracting $SOLR_ARCHIVE to $SOLR_EXTRACT_DIR\n"
|
||||
|
||||
tar zxf "$SOLR_ARCHIVE" -C "$SOLR_EXTRACT_DIR"
|
||||
|
||||
if [ ! -d "$SOLR_INSTALL_DIR" ]; then
|
||||
echo -e "\nERROR: Expected directory $SOLR_INSTALL_DIR not found after extracting $SOLR_ARCHIVE ... script fails.\n" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
chown -R root: "$SOLR_INSTALL_DIR"
|
||||
find "$SOLR_INSTALL_DIR" -type d -print0 | xargs -0 chmod 0755
|
||||
find "$SOLR_INSTALL_DIR" -type f -print0 | xargs -0 chmod 0644
|
||||
chmod -R 0755 "$SOLR_INSTALL_DIR/bin"
|
||||
else
|
||||
echo -e "\nWARNING: $SOLR_INSTALL_DIR already exists! Skipping extract ...\n"
|
||||
fi
|
||||
|
||||
# create a symlink for easier scripting
|
||||
if [ -h "$SOLR_EXTRACT_DIR/$SOLR_SERVICE" ]; then
|
||||
echo -e "\nRemoving old symlink $SOLR_EXTRACT_DIR/$SOLR_SERVICE ...\n"
|
||||
rm "$SOLR_EXTRACT_DIR/$SOLR_SERVICE"
|
||||
fi
|
||||
if [ -e "$SOLR_EXTRACT_DIR/$SOLR_SERVICE" ]; then
|
||||
echo -e "\nWARNING: $SOLR_EXTRACT_DIR/$SOLR_SERVICE is not symlink! Skipping symlink update ...\n"
|
||||
else
|
||||
echo -e "\nInstalling symlink $SOLR_EXTRACT_DIR/$SOLR_SERVICE -> $SOLR_INSTALL_DIR ...\n"
|
||||
ln -s "$SOLR_INSTALL_DIR" "$SOLR_EXTRACT_DIR/$SOLR_SERVICE"
|
||||
fi
|
||||
|
||||
# install init.d script
|
||||
echo -e "\nInstalling /etc/init.d/$SOLR_SERVICE script ...\n"
|
||||
cp "$SOLR_INSTALL_DIR/bin/init.d/solr" "/etc/init.d/$SOLR_SERVICE"
|
||||
chmod 0744 "/etc/init.d/$SOLR_SERVICE"
|
||||
chown root: "/etc/init.d/$SOLR_SERVICE"
|
||||
# do some basic variable substitution on the init.d script
|
||||
sed_expr1="s#SOLR_INSTALL_DIR=.*#SOLR_INSTALL_DIR=\"$SOLR_EXTRACT_DIR/$SOLR_SERVICE\"#"
|
||||
sed_expr2="s#SOLR_ENV=.*#SOLR_ENV=\"/etc/default/$SOLR_SERVICE.in.sh\"#"
|
||||
sed_expr3="s#RUNAS=.*#RUNAS=\"$SOLR_USER\"#"
|
||||
sed_expr4="s#Provides:.*#Provides: $SOLR_SERVICE#"
|
||||
sed -i -e "$sed_expr1" -e "$sed_expr2" -e "$sed_expr3" -e "$sed_expr4" "/etc/init.d/$SOLR_SERVICE"
|
||||
|
||||
# install/move configuration
|
||||
if [ ! -d /etc/default ]; then
|
||||
mkdir /etc/default
|
||||
chown root: /etc/default
|
||||
chmod 0755 /etc/default
|
||||
fi
|
||||
if [ -f "$SOLR_VAR_DIR/solr.in.sh" ]; then
|
||||
echo -e "\nMoving existing $SOLR_VAR_DIR/solr.in.sh to /etc/default/$SOLR_SERVICE.in.sh ...\n"
|
||||
mv "$SOLR_VAR_DIR/solr.in.sh" "/etc/default/$SOLR_SERVICE.in.sh"
|
||||
elif [ -f "/etc/default/$SOLR_SERVICE.in.sh" ]; then
|
||||
echo -e "\n/etc/default/$SOLR_SERVICE.in.sh already exist. Skipping install ...\n"
|
||||
else
|
||||
echo -e "\nInstalling /etc/default/$SOLR_SERVICE.in.sh ...\n"
|
||||
cp "$SOLR_INSTALL_DIR/bin/solr.in.sh" "/etc/default/$SOLR_SERVICE.in.sh"
|
||||
mv "$SOLR_INSTALL_DIR/bin/solr.in.sh" "$SOLR_INSTALL_DIR/bin/solr.in.sh.orig"
|
||||
mv "$SOLR_INSTALL_DIR/bin/solr.in.cmd" "$SOLR_INSTALL_DIR/bin/solr.in.cmd.orig"
|
||||
echo "
|
||||
SOLR_PID_DIR=\"$SOLR_VAR_DIR\"
|
||||
SOLR_HOME=\"$SOLR_VAR_DIR/data\"
|
||||
LOG4J_PROPS=\"$SOLR_VAR_DIR/log4j2.xml\"
|
||||
SOLR_LOGS_DIR=\"$SOLR_VAR_DIR/logs\"
|
||||
SOLR_PORT=\"$SOLR_PORT\"
|
||||
" >> "/etc/default/$SOLR_SERVICE.in.sh"
|
||||
fi
|
||||
chown root:${SOLR_USER} "/etc/default/$SOLR_SERVICE.in.sh"
|
||||
chmod 0640 "/etc/default/$SOLR_SERVICE.in.sh"
|
||||
|
||||
# install data directories and files
|
||||
mkdir -p "$SOLR_VAR_DIR/data"
|
||||
mkdir -p "$SOLR_VAR_DIR/logs"
|
||||
if [ -f "$SOLR_VAR_DIR/log4j2.xml" ]; then
|
||||
echo -e "\n$SOLR_VAR_DIR/log4j2.xml already exists. Skipping install ...\n"
|
||||
else
|
||||
cp "$SOLR_INSTALL_DIR/server/resources/log4j2.xml" "$SOLR_VAR_DIR/log4j2.xml"
|
||||
fi
|
||||
chown -R "$SOLR_USER:" "$SOLR_VAR_DIR"
|
||||
find "$SOLR_VAR_DIR" -type d -print0 | xargs -0 chmod 0750
|
||||
find "$SOLR_VAR_DIR" -type f -print0 | xargs -0 chmod 0640
|
||||
|
||||
# configure autostart of service
|
||||
if [[ "$distro" == "RedHat" || "$distro" == "CentOS" || "$distro" == "SUSE" ]]; then
|
||||
chkconfig "$SOLR_SERVICE" on
|
||||
else
|
||||
update-rc.d "$SOLR_SERVICE" defaults
|
||||
fi
|
||||
echo "Service $SOLR_SERVICE installed."
|
||||
echo "Customize Solr startup configuration in /etc/default/$SOLR_SERVICE.in.sh"
|
||||
|
||||
# start service
|
||||
if [[ $SOLR_START == "true" ]] ; then
|
||||
service "$SOLR_SERVICE" start
|
||||
sleep 5
|
||||
service "$SOLR_SERVICE" status
|
||||
else
|
||||
echo "Not starting Solr service (option -n given). Start manually with 'service $SOLR_SERVICE start'"
|
||||
fi
|
||||
240
solr/bin/post
Executable file
240
solr/bin/post
Executable file
@@ -0,0 +1,240 @@
|
||||
#!/usr/bin/env 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.
|
||||
|
||||
# ====== Common code copied/adapted from bin/solr (TODO: centralize/share this kind of thing across bin/solr, etc)
|
||||
|
||||
THIS_SCRIPT="$0"
|
||||
|
||||
# Resolve symlinks to this script
|
||||
while [ -h "$THIS_SCRIPT" ] ; do
|
||||
ls=`ls -ld "$THIS_SCRIPT"`
|
||||
# Drop everything prior to ->
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
THIS_SCRIPT="$link"
|
||||
else
|
||||
THIS_SCRIPT=`dirname "$THIS_SCRIPT"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
SOLR_TIP=`dirname "$THIS_SCRIPT"`/..
|
||||
SOLR_TIP=`cd "$SOLR_TIP"; pwd`
|
||||
|
||||
if [ -n "$SOLR_JAVA_HOME" ]; then
|
||||
JAVA="$SOLR_JAVA_HOME/bin/java"
|
||||
elif [ -n "$JAVA_HOME" ]; then
|
||||
for java in "$JAVA_HOME"/bin/amd64/java "$JAVA_HOME"/bin/java; do
|
||||
if [ -x "$java" ]; then
|
||||
JAVA="$java"
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
JAVA=java
|
||||
fi
|
||||
|
||||
# test that Java exists and is executable on this server
|
||||
"$JAVA" -version >/dev/null 2>&1 || { echo >&2 "Java is required to run this tool! Please install Java 8 or greater before running this script."; exit 1; }
|
||||
|
||||
echo "The bin/post script is deprecated in favour of the bin/solr post command. Please update your scripts."
|
||||
|
||||
# ===== post specific code
|
||||
|
||||
TOOL_JAR=("$SOLR_TIP/server/solr-webapp/webapp/WEB-INF/lib"/solr-core-*.jar)
|
||||
|
||||
function print_usage() {
|
||||
echo ""
|
||||
echo 'Usage: post -c <collection> [OPTIONS] <files|directories|urls|-d ["...",...]>'
|
||||
echo " or post -help"
|
||||
echo ""
|
||||
echo " collection name defaults to DEFAULT_SOLR_COLLECTION if not specified"
|
||||
echo ""
|
||||
echo "OPTIONS"
|
||||
echo "======="
|
||||
echo " Solr options:"
|
||||
echo " -url <base Solr update URL> (overrides collection, host, and port)"
|
||||
echo " -host <host> (default: localhost)"
|
||||
echo " -p or -port <port> (default: 8983)"
|
||||
echo " -commit yes|no (default: yes)"
|
||||
echo " -u or -user <user:pass> (sets BasicAuth credentials)"
|
||||
# optimize intentionally omitted, but can be used as '-optimize yes' (default: no)
|
||||
echo ""
|
||||
echo " Web crawl options:"
|
||||
echo " -recursive <depth> (default: 1)"
|
||||
echo " -delay <seconds> (default: 10)"
|
||||
echo ""
|
||||
echo " Directory crawl options:"
|
||||
echo " -delay <seconds> (default: 0)"
|
||||
echo ""
|
||||
echo " stdin/args options:"
|
||||
echo " -type <content/type> (default: application/xml)"
|
||||
echo ""
|
||||
echo " Other options:"
|
||||
echo " -filetypes <type>[,<type>,...] (default: xml,json,jsonl,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log)"
|
||||
echo " -params \"<key>=<value>[&<key>=<value>...]\" (values must be URL-encoded; these pass through to Solr update request)"
|
||||
echo " -out yes|no (default: no; yes outputs Solr response to console)"
|
||||
echo " -format solr (sends application/json content as Solr commands to /update instead of /update/json/docs)"
|
||||
echo ""
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo ""
|
||||
echo "* JSON file: $THIS_SCRIPT -c wizbang events.json"
|
||||
echo "* XML files: $THIS_SCRIPT -c records article*.xml"
|
||||
echo "* CSV file: $THIS_SCRIPT -c signals LATEST-signals.csv"
|
||||
echo "* Directory of files: $THIS_SCRIPT -c myfiles ~/Documents"
|
||||
echo "* Web crawl: $THIS_SCRIPT -c gettingstarted https://solr.apache.org/ -recursive 1 -delay 1"
|
||||
echo "* Standard input (stdin): echo '{"commit": {}}' | $THIS_SCRIPT -c my_collection -type application/json -out yes -d"
|
||||
echo "* Data as string: $THIS_SCRIPT -c signals -type text/csv -out yes -d $'id,value\n1,0.47'"
|
||||
echo ""
|
||||
} # end print_usage
|
||||
|
||||
if [[ $# -eq 1 && ("$1" == "-help" || "$1" == "-h" || "$1" == "-usage") ]]; then
|
||||
print_usage
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
COLLECTION="$DEFAULT_SOLR_COLLECTION"
|
||||
PROPS=('-Dauto=yes')
|
||||
RECURSIVE=""
|
||||
FILES=()
|
||||
URLS=()
|
||||
ARGS=()
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
# TODO: natively handle the optional parameters to SPT
|
||||
# but for now they can be specified as bin/post -c collection-name delay=5 https://lucidworks.com
|
||||
|
||||
if [[ -d "$1" ]]; then
|
||||
# Directory
|
||||
# echo "$1: DIRECTORY"
|
||||
RECURSIVE=yes
|
||||
FILES+=("$1")
|
||||
elif [[ -f "$1" ]]; then
|
||||
# File
|
||||
# echo "$1: FILE"
|
||||
FILES+=("$1")
|
||||
elif [[ "$1" == http* ]]; then
|
||||
# URL
|
||||
# echo "$1: URL"
|
||||
URLS+=("$1")
|
||||
else
|
||||
if [[ "$1" == -* ]]; then
|
||||
if [[ "$1" == "-c" ]]; then
|
||||
# Special case, pull out collection name
|
||||
shift
|
||||
COLLECTION="$1"
|
||||
elif [[ "$1" == "-p" ]]; then
|
||||
# -p alias for -port for convenience and compatibility with `bin/solr start`
|
||||
shift
|
||||
PROPS+=("-Dport=$1")
|
||||
elif [[ ("$1" == "-d" || "$1" == "--data" || "$1" == "-") ]]; then
|
||||
if [[ ! -t 0 ]]; then
|
||||
MODE="stdin"
|
||||
else
|
||||
# when no stdin exists and -d specified, the rest of the arguments
|
||||
# are assumed to be strings to post as-is
|
||||
MODE="args"
|
||||
shift
|
||||
if [[ $# -gt 0 ]]; then
|
||||
ARGS=("$@")
|
||||
shift $#
|
||||
else
|
||||
# SPT needs a valid args string, useful for 'bin/post -c foo -d' to force a commit
|
||||
ARGS+=("<add/>")
|
||||
fi
|
||||
fi
|
||||
elif [[ ("$1" == "-u" || "$1" == "-user") ]]; then
|
||||
shift
|
||||
PROPS+=("-Dbasicauth=$1")
|
||||
else
|
||||
if [[ "$1" == -D* ]] ; then
|
||||
PROPS+=("$1")
|
||||
if [[ "${1:2:4}" == "url=" ]]; then
|
||||
SOLR_URL=${1:6}
|
||||
fi
|
||||
else
|
||||
key="${1:1}"
|
||||
shift
|
||||
# echo "$1: PROP"
|
||||
PROPS+=("-D$key=$1")
|
||||
if [[ "$key" == "url" ]]; then
|
||||
SOLR_URL=$1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo -e "\nUnrecognized argument: $1\n"
|
||||
echo -e "If this was intended to be a data file, it does not exist relative to $PWD\n"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
# Check for errors
|
||||
if [[ $COLLECTION == "" && $SOLR_URL == "" ]]; then
|
||||
echo -e "\nCollection or URL must be specified. Use -c <collection name> or set DEFAULT_SOLR_COLLECTION in your environment, or use -url instead.\n"
|
||||
echo -e "See '$THIS_SCRIPT -h' for usage instructions.\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Unsupported: bin/post -c foo
|
||||
if [[ ${#FILES[@]} == 0 && ${#URLS[@]} == 0 && $MODE != "stdin" && $MODE != "args" ]]; then
|
||||
echo -e "\nNo files, directories, URLs, -d strings, or stdin were specified.\n"
|
||||
echo -e "See '$THIS_SCRIPT -h' for usage instructions.\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# SPT does not support mixing different data mode types, just files, just URLs, just stdin, or just argument strings.
|
||||
# The following are unsupported constructs:
|
||||
# bin/post -c foo existing_file.csv http://example.com
|
||||
# echo '<xml.../>' | bin/post -c foo existing_file.csv
|
||||
# bin/post -c foo existing_file.csv -d 'anything'
|
||||
if [[ (${#FILES[@]} != 0 && ${#URLS[@]} != 0 && $MODE != "stdin" && $MODE != "args")
|
||||
|| ((${#FILES[@]} != 0 || ${#URLS[@]} != 0) && ($MODE == "stdin" || $MODE == "args")) ]]; then
|
||||
echo -e "\nCombining files/directories, URLs, stdin, or args is not supported. Post them separately.\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PARAMS=""
|
||||
|
||||
# TODO: let's simplify this
|
||||
if [[ $MODE != "stdin" && $MODE != "args" ]]; then
|
||||
if [[ $FILES != "" ]]; then
|
||||
MODE="files"
|
||||
PARAMS=("${FILES[@]}")
|
||||
fi
|
||||
|
||||
if [[ $URLS != "" ]]; then
|
||||
MODE="web"
|
||||
PARAMS=("${URLS[@]}")
|
||||
fi
|
||||
else
|
||||
PARAMS=("${ARGS[@]}")
|
||||
fi
|
||||
|
||||
PROPS+=("-Dc=$COLLECTION" "-Ddata=$MODE")
|
||||
if [[ -n "$RECURSIVE" ]]; then
|
||||
PROPS+=('-Drecursive=yes')
|
||||
fi
|
||||
|
||||
echo "$JAVA" -classpath "${TOOL_JAR[0]}" "${PROPS[@]}" org.apache.solr.cli.SimplePostTool "${PARAMS[@]}"
|
||||
"$JAVA" -classpath "${TOOL_JAR[0]}" "${PROPS[@]}" org.apache.solr.cli.SimplePostTool "${PARAMS[@]}"
|
||||
|
||||
# post smoker:
|
||||
# bin/post -c signals -out yes -type application/json -d '[{"id": 2, "val": 0.47}]'
|
||||
# bin/post -c signals -out yes -params "wt=json" -d '<add><doc><field name="id">1</field></doc></add>'
|
||||
37
solr/bin/postlogs
Executable file
37
solr/bin/postlogs
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env 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.
|
||||
|
||||
############################################################################################
|
||||
#
|
||||
# A command line tool for indexing Solr logs in the out-of-the-box log format.
|
||||
#
|
||||
# First build the Solr distribution. Then run postlogs from inside the Solr distribution
|
||||
# home directory as described below:
|
||||
#
|
||||
# parameters:
|
||||
#
|
||||
# -- baseUrl: Example http://localhost:8983/solr/collection1
|
||||
# -- rootDir: All files found at or below the root will be indexed
|
||||
#
|
||||
# Sample syntax: ./bin/postlogs http://localhost:8983/solr/collection1 /user/foo/logs");
|
||||
#
|
||||
#
|
||||
############################################################################################
|
||||
|
||||
echo "This script has been deprecated in favour of 'bin/solr postlogs' command."
|
||||
|
||||
SOLR_TIP="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"/..
|
||||
java -classpath "$SOLR_TIP/server/lib/ext/*:$SOLR_TIP/server/solr-webapp/webapp/WEB-INF/lib/*" org.apache.solr.cli.SolrLogPostTool $1 $2
|
||||
2468
solr/bin/solr
Executable file
2468
solr/bin/solr
Executable file
File diff suppressed because it is too large
Load Diff
2201
solr/bin/solr.cmd
Normal file
2201
solr/bin/solr.cmd
Normal file
File diff suppressed because it is too large
Load Diff
265
solr/bin/solr.in.cmd.orig
Normal file
265
solr/bin/solr.in.cmd.orig
Normal file
@@ -0,0 +1,265 @@
|
||||
@REM
|
||||
@REM Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@REM contributor license agreements. See the NOTICE file distributed with
|
||||
@REM this work for additional information regarding copyright ownership.
|
||||
@REM The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
@REM (the "License"); you may not use this file except in compliance with
|
||||
@REM the License. You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM http://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing, software
|
||||
@REM distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@REM See the License for the specific language governing permissions and
|
||||
@REM limitations under the License.
|
||||
|
||||
@echo off
|
||||
|
||||
REM Settings here will override settings in existing env vars or in bin/solr. The default shipped state
|
||||
|
||||
REM of this file is completely commented.
|
||||
|
||||
REM By default the script will use JAVA_HOME to determine which java
|
||||
REM to use, but you can set a specific path for Solr to use without
|
||||
REM affecting other Java applications on your server/workstation.
|
||||
REM set SOLR_JAVA_HOME=
|
||||
|
||||
REM This controls the number of seconds that the solr script will wait for
|
||||
REM Solr to stop gracefully. If the graceful stop fails, the script will
|
||||
REM forcibly stop Solr.
|
||||
REM set SOLR_STOP_WAIT=180
|
||||
|
||||
REM This controls the number of seconds that the solr script will wait for
|
||||
REM Solr to start. If the start fails you should inspect the Solr log files
|
||||
REM for more information.
|
||||
REM set SOLR_START_WAIT=30
|
||||
|
||||
REM Increase Java Min/Max Heap as needed to support your indexing / query needs
|
||||
REM set SOLR_JAVA_MEM=-Xms512m -Xmx512m
|
||||
|
||||
REM Configure verbose GC logging:
|
||||
REM For Java 8: if this is set, additional params will be added to specify the log file & rotation
|
||||
REM For Java 9 or higher: GC_LOG_OPTS is currently not supported unless you are using OpenJ9. Otherwise if you set it, the startup script will exit with failure.
|
||||
REM set GC_LOG_OPTS=-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime
|
||||
|
||||
REM Various GC settings have shown to work well for a number of common Solr workloads.
|
||||
REM See solr.cmd GC_TUNE for the default list.
|
||||
REM set GC_TUNE=-XX:+ExplicitGCInvokesConcurrent
|
||||
REM set GC_TUNE=-XX:SurvivorRatio=4
|
||||
REM set GC_TUNE=%GC_TUNE% -XX:TargetSurvivorRatio=90
|
||||
REM set GC_TUNE=%GC_TUNE% -XX:MaxTenuringThreshold=8
|
||||
REM set GC_TUNE=%GC_TUNE% -XX:+UseConcMarkSweepGC
|
||||
REM set GC_TUNE=%GC_TUNE% -XX:ConcGCThreads=4
|
||||
REM set GC_TUNE=%GC_TUNE% -XX:ParallelGCThreads=4
|
||||
REM set GC_TUNE=%GC_TUNE% -XX:+CMSScavengeBeforeRemark
|
||||
REM set GC_TUNE=%GC_TUNE% -XX:PretenureSizeThreshold=64m
|
||||
REM set GC_TUNE=%GC_TUNE% -XX:+UseCMSInitiatingOccupancyOnly
|
||||
REM set GC_TUNE=%GC_TUNE% -XX:CMSInitiatingOccupancyFraction=50
|
||||
REM set GC_TUNE=%GC_TUNE% -XX:CMSMaxAbortablePrecleanTime=6000
|
||||
REM set GC_TUNE=%GC_TUNE% -XX:+CMSParallelRemarkEnabled
|
||||
REM set GC_TUNE=%GC_TUNE% -XX:+ParallelRefProcEnabled etc.
|
||||
|
||||
REM Set the ZooKeeper connection string if using an external ZooKeeper ensemble
|
||||
REM e.g. host1:2181,host2:2181/chroot
|
||||
REM Leave empty if not using SolrCloud
|
||||
REM set ZK_HOST=
|
||||
|
||||
REM Set to true if your ZK host has a chroot path, and you want to create it automatically.
|
||||
REM set ZK_CREATE_CHROOT=true
|
||||
|
||||
REM Set the ZooKeeper client timeout (for SolrCloud mode)
|
||||
REM set ZK_CLIENT_TIMEOUT=30000
|
||||
|
||||
REM By default the start script uses "localhost"; override the hostname here
|
||||
REM for production SolrCloud environments to control the hostname exposed to cluster state
|
||||
REM set SOLR_HOST=192.168.1.1
|
||||
|
||||
REM By default Solr will try to connect to Zookeeper with 30 seconds in timeout; override the timeout if needed
|
||||
REM set SOLR_WAIT_FOR_ZK=30
|
||||
|
||||
REM By default Solr will log a warning for cores that are not registered in Zookeeper at startup
|
||||
REM but otherwise ignore them. This protects against misconfiguration (e.g. connecting to the
|
||||
REM wrong Zookeeper instance or chroot), however you need to manually delete the cores if
|
||||
REM they are no longer required. Set to "true" to have Solr automatically delete unknown cores.
|
||||
REM set SOLR_DELETE_UNKNOWN_CORES=false
|
||||
|
||||
REM By default the start script uses UTC; override the timezone if needed
|
||||
REM set SOLR_TIMEZONE=UTC
|
||||
|
||||
REM Set to true to activate the JMX RMI connector to allow remote JMX client applications
|
||||
REM to monitor the JVM hosting Solr; set to "false" to disable that behavior
|
||||
REM (false is recommended in production environments)
|
||||
REM set ENABLE_REMOTE_JMX_OPTS=false
|
||||
|
||||
REM The script will use SOLR_PORT+10000 for the RMI_PORT or you can set it here
|
||||
REM set RMI_PORT=18983
|
||||
|
||||
REM Anything you add to the SOLR_OPTS variable will be included in the java
|
||||
REM start command line as-is, in ADDITION to other options. If you specify the
|
||||
REM -a option on start script, those options will be appended as well. Examples:
|
||||
REM set SOLR_OPTS=%SOLR_OPTS% -Dsolr.autoSoftCommit.maxTime=3000
|
||||
REM set SOLR_OPTS=%SOLR_OPTS% -Dsolr.autoCommit.maxTime=60000
|
||||
|
||||
REM Most properties have an environment variable equivalent.
|
||||
REM A naming convention is that SOLR_FOO_BAR maps to solr.foo.bar
|
||||
REM SOLR_CLUSTERING_ENABLED=true
|
||||
|
||||
REM Path to a directory for Solr to store cores and their data. By default, Solr will use server\solr
|
||||
REM If solr.xml is not stored in ZooKeeper, this directory needs to contain solr.xml
|
||||
REM set SOLR_HOME=
|
||||
|
||||
REM Path to a directory that Solr will use as root for data folders for each core.
|
||||
REM If not set, defaults to <instance_dir>/data. Overridable per core through 'dataDir' core property
|
||||
REM set SOLR_DATA_HOME=
|
||||
|
||||
REM Changes the logging level. Valid values: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF. Default is INFO
|
||||
REM This is an alternative to changing the rootLogger in log4j2.xml
|
||||
REM set SOLR_LOG_LEVEL=INFO
|
||||
|
||||
REM Location where Solr should write logs to. Absolute or relative to solr start dir
|
||||
REM set SOLR_LOGS_DIR=logs
|
||||
|
||||
REM Enables jetty request log for all requests
|
||||
REM set SOLR_REQUESTLOG_ENABLED=true
|
||||
|
||||
REM Sets the port Solr binds to, default is 8983
|
||||
REM set SOLR_PORT=8983
|
||||
|
||||
REM Sets the network interface the Solr binds to. To prevent administrators from
|
||||
REM accidentally exposing Solr more widely than intended, this defaults to 127.0.0.1.
|
||||
REM Administrators should think carefully about their deployment environment and
|
||||
REM set this value as narrowly as required before going to production. In
|
||||
REM environments where security is not a concern, 0.0.0.0 can be used to allow
|
||||
REM Solr to accept connections on all network interfaces.
|
||||
REM set SOLR_JETTY_HOST=127.0.0.1
|
||||
REM Sets the network interface the Embedded ZK binds to.
|
||||
REM set SOLR_ZK_EMBEDDED_HOST=127.0.0.1
|
||||
|
||||
REM Restrict access to solr by IP address.
|
||||
REM Specify a comma-separated list of addresses or networks, for example:
|
||||
REM 127.0.0.1, 192.168.0.0/24, [::1], [2000:123:4:5::]/64
|
||||
REM set SOLR_IP_ALLOWLIST=
|
||||
|
||||
REM Block access to solr from specific IP addresses.
|
||||
REM Specify a comma-separated list of addresses or networks, for example:
|
||||
REM 127.0.0.1, 192.168.0.0/24, [::1], [2000:123:4:5::]/64
|
||||
REM set SOLR_IP_DENYLIST=
|
||||
|
||||
REM Enables HTTPS. It is implictly true if you set SOLR_SSL_KEY_STORE. Use this config
|
||||
REM to enable https module with custom jetty configuration.
|
||||
REM set SOLR_SSL_ENABLED=true
|
||||
REM Uncomment to set SSL-related system properties
|
||||
REM Be sure to update the paths to the correct keystore for your environment
|
||||
REM set SOLR_SSL_KEY_STORE=etc/solr-ssl.keystore.p12
|
||||
REM set SOLR_SSL_KEY_STORE_PASSWORD=secret
|
||||
REM set SOLR_SSL_TRUST_STORE=etc/solr-ssl.keystore.p12
|
||||
REM set SOLR_SSL_TRUST_STORE_PASSWORD=secret
|
||||
REM Require clients to authenticate
|
||||
REM set SOLR_SSL_NEED_CLIENT_AUTH=false
|
||||
REM Enable clients to authenticate (but not require)
|
||||
REM set SOLR_SSL_WANT_CLIENT_AUTH=false
|
||||
REM Verify client hostname during SSL handshake
|
||||
REM set SOLR_SSL_CLIENT_HOSTNAME_VERIFICATION=false
|
||||
REM SSL Certificates contain host/ip "peer name" information that is validated by default. Setting
|
||||
REM this to false can be useful to disable these checks when re-using a certificate on many hosts.
|
||||
REM This will also be used for the default value of whether SNI Host checking should be enabled.
|
||||
REM set SOLR_SSL_CHECK_PEER_NAME=true
|
||||
REM Override Key/Trust Store types if necessary
|
||||
REM set SOLR_SSL_KEY_STORE_TYPE=PKCS12
|
||||
REM set SOLR_SSL_TRUST_STORE_TYPE=PKCS12
|
||||
|
||||
REM Uncomment if you want to override previously defined SSL values for HTTP client
|
||||
REM otherwise keep them commented and the above values will automatically be set for HTTP clients
|
||||
REM set SOLR_SSL_CLIENT_KEY_STORE=
|
||||
REM set SOLR_SSL_CLIENT_KEY_STORE_PASSWORD=
|
||||
REM set SOLR_SSL_CLIENT_TRUST_STORE=
|
||||
REM set SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD=
|
||||
REM set SOLR_SSL_CLIENT_KEY_STORE_TYPE=
|
||||
REM set SOLR_SSL_CLIENT_TRUST_STORE_TYPE=
|
||||
|
||||
REM Sets path of Hadoop credential provider (hadoop.security.credential.provider.path property) and
|
||||
REM enables usage of credential store.
|
||||
REM Credential provider should store the following keys:
|
||||
REM * solr.jetty.keystore.password
|
||||
REM * solr.jetty.truststore.password
|
||||
REM Set the two below if you want to set specific store passwords for HTTP client
|
||||
REM * javax.net.ssl.keyStorePassword
|
||||
REM * javax.net.ssl.trustStorePassword
|
||||
REM More info: https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/CredentialProviderAPI.html
|
||||
REM set SOLR_HADOOP_CREDENTIAL_PROVIDER_PATH=localjceks://file/home/solr/hadoop-credential-provider.jceks
|
||||
REM set SOLR_OPTS=%SOLR_OPTS% -Dsolr.ssl.credential.provider.chain=hadoop
|
||||
|
||||
REM Settings for authentication
|
||||
REM Please configure only one of SOLR_AUTHENTICATION_CLIENT_BUILDER or SOLR_AUTH_TYPE parameters
|
||||
REM set SOLR_AUTHENTICATION_CLIENT_BUILDER=org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory
|
||||
REM set SOLR_AUTH_TYPE=basic
|
||||
REM set SOLR_AUTHENTICATION_OPTS=-Dbasicauth=solr:SolrRocks
|
||||
|
||||
REM Settings for ZK ACL
|
||||
REM set SOLR_ZK_CREDS_AND_ACLS=-DzkACLProvider=org.apache.solr.common.cloud.DigestZkACLProvider ^
|
||||
REM -DzkCredentialsProvider=org.apache.solr.common.cloud.DigestZkCredentialsProvider ^
|
||||
REM -DzkCredentialsInjector=org.apache.solr.common.cloud.VMParamsZkCredentialsInjector ^
|
||||
REM -DzkDigestUsername=admin-user -DzkDigestPassword=CHANGEME-ADMIN-PASSWORD ^
|
||||
REM -DzkDigestReadonlyUsername=readonly-user -DzkDigestReadonlyPassword=CHANGEME-READONLY-PASSWORD
|
||||
REM set SOLR_OPTS=%SOLR_OPTS% %SOLR_ZK_CREDS_AND_ACLS%
|
||||
|
||||
REM optionally, you can use using a a Java properties file 'zkDigestCredentialsFile'
|
||||
REM ...
|
||||
REM -DzkDigestCredentialsFile=/path/to/zkDigestCredentialsFile.properties
|
||||
REM ...
|
||||
|
||||
REM Use a custom injector to inject ZK credentials into DigestZkACLProvider
|
||||
REM -DzkCredentialsInjector expects a class implementing org.apache.solr.common.cloud.ZkCredentialsInjector
|
||||
REM ...
|
||||
REM -DzkCredentialsInjector=fully.qualified.class.CustomInjectorClassName
|
||||
REM ...
|
||||
|
||||
REM Jetty GZIP module enabled by default
|
||||
REM set SOLR_GZIP_ENABLED=true
|
||||
|
||||
REM When running Solr in non-cloud mode and if planning to do distributed search (using the "shards" parameter), the
|
||||
REM list of hosts needs to be defined in an allow-list or Solr will forbid the request. The allow-list can be configured
|
||||
REM in solr.xml, or if you are using the OOTB solr.xml, can be specified using the system property "solr.allowUrls".
|
||||
REM Alternatively host checking can be disabled by using the system property "solr.disable.allowUrls"
|
||||
REM set SOLR_OPTS=%SOLR_OPTS% -Dsolr.allowUrls=http://localhost:8983,http://localhost:8984
|
||||
|
||||
REM For a visual indication in the Admin UI of what type of environment this cluster is, configure
|
||||
REM a -Dsolr.environment property below. Valid values are prod, stage, test, dev, with an optional
|
||||
REM label or color, e.g. -Dsolr.environment=test,label=Functional+test,color=brown
|
||||
REM set SOLR_OPTS=%SOLR_OPTS% -Dsolr.environment=prod
|
||||
|
||||
REM Specifies the path to a common library directory that will be shared across all cores.
|
||||
REM Any JAR files in this directory will be added to the search path for Solr plugins.
|
||||
REM If the specified path is not absolute, it will be relative to `%SOLR_HOME%`.
|
||||
REM set SOLR_OPTS=%SOLR_OPTS% -Dsolr.sharedLib=/path/to/lib
|
||||
|
||||
REM Runs solr in a java security manager sandbox. This can protect against some attacks.
|
||||
REM Runtime properties are passed to the security policy file (server\etc\security.policy)
|
||||
REM You can also tweak via standard JDK files such as ~\.java.policy, see https://s.apache.org/java8policy
|
||||
REM This is experimental! It may not work at all with Hadoop/HDFS features.
|
||||
REM set SOLR_SECURITY_MANAGER_ENABLED=true
|
||||
REM This variable provides you with the option to disable the Admin UI. if you uncomment the variable below and
|
||||
REM change the value to true. The option is configured as a system property as defined in SOLR_START_OPTS in the start
|
||||
REM scripts.
|
||||
REM set SOLR_ADMIN_UI_DISABLED=false
|
||||
|
||||
REM Solr is by default allowed to read and write data from/to SOLR_HOME and a few other well defined locations
|
||||
REM Sometimes it may be necessary to place a core or a backup on a different location or a different disk
|
||||
REM This parameter lets you specify file system path(s) to explicitly allow. The special value of '*' will allow any path
|
||||
REM set SOLR_OPTS=%SOLR_OPTS% -Dsolr.allowPaths=D:\,E:\other\path
|
||||
|
||||
REM Before version 9.0, Solr required a copy of solr.xml file in $SOLR_HOME. Now Solr will use a default file if not found.
|
||||
REM To restore the old behavior, set the variable below to true
|
||||
REM set SOLR_SOLRXML_REQUIRED=false
|
||||
|
||||
REM Some previous versions of Solr use an outdated log4j dependency. If you are unable to use at least log4j version 2.15.0
|
||||
REM then enable the following setting to address CVE-2021-44228
|
||||
REM set SOLR_OPTS=%SOLR_OPTS% -Dlog4j2.formatMsgNoLookups=true
|
||||
|
||||
REM The bundled plugins in the "modules" folder can easily be enabled as a comma-separated list in SOLR_MODULES variable
|
||||
REM set SOLR_MODULES=extraction,ltr
|
||||
|
||||
REM Configure the default replica placement plugin to use if one is not configured in cluster properties
|
||||
REM See https://solr.apache.org/guide/solr/latest/configuration-guide/replica-placement-plugins.html for details
|
||||
REM set SOLR_PLACEMENTPLUGIN_DEFAULT=simple
|
||||
304
solr/bin/solr.in.sh.orig
Executable file
304
solr/bin/solr.in.sh.orig
Executable file
@@ -0,0 +1,304 @@
|
||||
# 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.
|
||||
|
||||
# Settings here will override settings in existing env vars or in bin/solr. The default shipped state
|
||||
# of this file is completely commented.
|
||||
|
||||
# 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=""
|
||||
|
||||
# This controls the number of seconds that the solr script will wait for
|
||||
# Solr to stop gracefully. If the graceful stop fails, the script will
|
||||
# forcibly stop Solr.
|
||||
#SOLR_STOP_WAIT="180"
|
||||
|
||||
# This controls the number of seconds that the solr script will wait for
|
||||
# Solr to start. If the start fails, the script will give up waiting and
|
||||
# display the last few lines of the logfile.
|
||||
#SOLR_START_WAIT="$SOLR_STOP_WAIT"
|
||||
|
||||
# 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="-Xms512m -Xmx512m"
|
||||
|
||||
# Enable verbose GC logging...
|
||||
# * If this is unset, various default options will be selected depending on which JVM version is in use
|
||||
# * For Java 8: if this is set, additional params will be added to specify the log file & rotation
|
||||
# * For Java 9 or higher: each included opt param that starts with '-Xlog:gc', but does not include an
|
||||
# output specifier, will have a 'file' output specifier (as well as formatting & rollover options)
|
||||
# appended, using the effective value of the SOLR_LOGS_DIR.
|
||||
#
|
||||
#GC_LOG_OPTS='-Xlog:gc*' # (Java 9+)
|
||||
#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:+ExplicitGCInvokesConcurrent \
|
||||
#-XX:SurvivorRatio=4 \
|
||||
#-XX:TargetSurvivorRatio=90 \
|
||||
#-XX:MaxTenuringThreshold=8 \
|
||||
#-XX:+UseConcMarkSweepGC \
|
||||
#-XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 \
|
||||
#-XX:+CMSScavengeBeforeRemark \
|
||||
#-XX:PretenureSizeThreshold=64m \
|
||||
#-XX:+UseCMSInitiatingOccupancyOnly \
|
||||
#-XX:CMSInitiatingOccupancyFraction=50 \
|
||||
#-XX:CMSMaxAbortablePrecleanTime=6000 \
|
||||
#-XX:+CMSParallelRemarkEnabled \
|
||||
#-XX:+ParallelRefProcEnabled etc.
|
||||
|
||||
# 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 to true if your ZK host has a chroot path, and you want to create it automatically.
|
||||
#ZK_CREATE_CHROOT=true
|
||||
|
||||
# Set the ZooKeeper client timeout (for SolrCloud mode)
|
||||
#ZK_CLIENT_TIMEOUT="30000"
|
||||
|
||||
# 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 Solr will try to connect to Zookeeper with 30 seconds in timeout; override the timeout if needed
|
||||
#SOLR_WAIT_FOR_ZK="30"
|
||||
|
||||
# By default Solr will log a warning for cores that are not registered in Zookeeper at startup
|
||||
# but otherwise ignore them. This protects against misconfiguration (e.g. connecting to the
|
||||
# wrong Zookeeper instance or chroot), however you need to manually delete the cores if
|
||||
# they are no longer required. Set to "true" to have Solr automatically delete unknown cores.
|
||||
#SOLR_DELETE_UNKNOWN_CORES=false
|
||||
|
||||
# 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"
|
||||
|
||||
# Most properties have an environment variable equivalent.
|
||||
# A naming convention is that SOLR_FOO_BAR maps to solr.foo.bar
|
||||
#SOLR_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 for Solr to store cores and their data. By default, Solr will use server/solr
|
||||
# If solr.xml is not stored in ZooKeeper, this directory needs to contain solr.xml
|
||||
#SOLR_HOME=
|
||||
|
||||
# Path to a directory that Solr will use as root for data folders for each core.
|
||||
# If not set, defaults to <instance_dir>/data. Overridable per core through 'dataDir' core property
|
||||
#SOLR_DATA_HOME=
|
||||
|
||||
# Solr provides a default Log4J configuration xml 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 log4j2.xml file
|
||||
#LOG4J_PROPS=/var/solr/log4j2.xml
|
||||
|
||||
# Changes the logging level. Valid values: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF. Default is INFO
|
||||
# This is an alternative to changing the rootLogger in log4j2.xml
|
||||
#SOLR_LOG_LEVEL=INFO
|
||||
|
||||
# Location where Solr should write logs to. Absolute or relative to solr start dir
|
||||
#SOLR_LOGS_DIR=logs
|
||||
|
||||
# Enables jetty request log for all requests
|
||||
#SOLR_REQUESTLOG_ENABLED=true
|
||||
|
||||
# Sets the port Solr binds to, default is 8983
|
||||
#SOLR_PORT=8983
|
||||
|
||||
# Restrict access to solr by IP address.
|
||||
# Specify a comma-separated list of addresses or networks, for example:
|
||||
# 127.0.0.1, 192.168.0.0/24, [::1], [2000:123:4:5::]/64
|
||||
#SOLR_IP_ALLOWLIST=
|
||||
|
||||
# Block access to solr from specific IP addresses.
|
||||
# Specify a comma-separated list of addresses or networks, for example:
|
||||
# 127.0.0.1, 192.168.0.0/24, [::1], [2000:123:4:5::]/64
|
||||
#SOLR_IP_DENYLIST=
|
||||
|
||||
# Sets the network interface the Solr binds to. To prevent administrators from
|
||||
# accidentally exposing Solr more widely than intended, this defaults to 127.0.0.1.
|
||||
# Administrators should think carefully about their deployment environment and
|
||||
# set this value as narrowly as required before going to production. In
|
||||
# environments where security is not a concern, 0.0.0.0 can be used to allow
|
||||
# Solr to accept connections on all network interfaces.
|
||||
#SOLR_JETTY_HOST="127.0.0.1"
|
||||
# Sets the network interface the Embedded ZK binds to.
|
||||
#SOLR_ZK_EMBEDDED_HOST="127.0.0.1"
|
||||
|
||||
# Enables HTTPS. It is implictly true if you set SOLR_SSL_KEY_STORE. Use this config
|
||||
# to enable https module with custom jetty configuration.
|
||||
#SOLR_SSL_ENABLED=true
|
||||
# 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.p12
|
||||
#SOLR_SSL_KEY_STORE_PASSWORD=secret
|
||||
#SOLR_SSL_TRUST_STORE=etc/solr-ssl.keystore.p12
|
||||
#SOLR_SSL_TRUST_STORE_PASSWORD=secret
|
||||
# Require clients to authenticate
|
||||
#SOLR_SSL_NEED_CLIENT_AUTH=false
|
||||
# Enable clients to authenticate (but not require)
|
||||
#SOLR_SSL_WANT_CLIENT_AUTH=false
|
||||
# Verify client's hostname during SSL handshake
|
||||
#SOLR_SSL_CLIENT_HOSTNAME_VERIFICATION=false
|
||||
# SSL Certificates contain host/ip "peer name" information that is validated by default. Setting
|
||||
# this to false can be useful to disable these checks when re-using a certificate on many hosts.
|
||||
# This will also be used for the default value of whether SNI Host checking should be enabled.
|
||||
#SOLR_SSL_CHECK_PEER_NAME=true
|
||||
# Override Key/Trust Store types if necessary
|
||||
#SOLR_SSL_KEY_STORE_TYPE=PKCS12
|
||||
#SOLR_SSL_TRUST_STORE_TYPE=PKCS12
|
||||
#SOLR_SSL_RELOAD_ENABLED=true
|
||||
|
||||
# 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=
|
||||
#SOLR_SSL_CLIENT_KEY_STORE_TYPE=
|
||||
#SOLR_SSL_CLIENT_TRUST_STORE_TYPE=
|
||||
|
||||
# Sets path of Hadoop credential provider (hadoop.security.credential.provider.path property) and
|
||||
# enables usage of credential store.
|
||||
# Credential provider should store the following keys:
|
||||
# * solr.jetty.keystore.password
|
||||
# * solr.jetty.truststore.password
|
||||
# Set the two below if you want to set specific store passwords for HTTP client
|
||||
# * javax.net.ssl.keyStorePassword
|
||||
# * javax.net.ssl.trustStorePassword
|
||||
# More info: https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/CredentialProviderAPI.html
|
||||
#SOLR_HADOOP_CREDENTIAL_PROVIDER_PATH=localjceks://file/home/solr/hadoop-credential-provider.jceks
|
||||
#SOLR_OPTS=" -Dsolr.ssl.credential.provider.chain=hadoop"
|
||||
|
||||
# Settings for authentication
|
||||
# Please configure only one of SOLR_AUTHENTICATION_CLIENT_BUILDER or SOLR_AUTH_TYPE parameters
|
||||
#SOLR_AUTHENTICATION_CLIENT_BUILDER="org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory"
|
||||
#SOLR_AUTH_TYPE="basic"
|
||||
#SOLR_AUTHENTICATION_OPTS="-Dbasicauth=solr:SolrRocks"
|
||||
|
||||
# Settings for ZK ACL
|
||||
#SOLR_ZK_CREDS_AND_ACLS="-DzkACLProvider=org.apache.solr.common.cloud.DigestZkACLProvider \
|
||||
# -DzkCredentialsProvider=org.apache.solr.common.cloud.DigestZkCredentialsProvider \
|
||||
# -DzkCredentialsInjector=org.apache.solr.common.cloud.VMParamsZkCredentialsInjector \
|
||||
# -DzkDigestUsername=admin-user -DzkDigestPassword=CHANGEME-ADMIN-PASSWORD \
|
||||
# -DzkDigestReadonlyUsername=readonly-user -DzkDigestReadonlyPassword=CHANGEME-READONLY-PASSWORD"
|
||||
#SOLR_OPTS="$SOLR_OPTS $SOLR_ZK_CREDS_AND_ACLS"
|
||||
|
||||
# optionally, you can use using a a Java properties file 'zkDigestCredentialsFile'
|
||||
#...
|
||||
# -DzkDigestCredentialsFile=/path/to/zkDigestCredentialsFile.properties
|
||||
#...
|
||||
|
||||
# Use a custom injector to inject ZK credentials into DigestZkACLProvider
|
||||
# -DzkCredentialsInjector expects a class implementing org.apache.solr.common.cloud.ZkCredentialsInjector
|
||||
# ...
|
||||
# -DzkCredentialsInjector=fully.qualified.class.CustomInjectorClassName"
|
||||
# ...
|
||||
|
||||
# Jetty GZIP module enabled by default
|
||||
#SOLR_GZIP_ENABLED=true
|
||||
|
||||
# Settings for common system values that may cause operational imparement when system defaults are used.
|
||||
# Solr can use many processes and many file handles. On modern operating systems the savings by leaving
|
||||
# these settings low is minuscule, while the consequence can be Solr instability. To turn these checks off, set
|
||||
# SOLR_ULIMIT_CHECKS=false either here or as part of your profile.
|
||||
|
||||
# Different limits can be set in solr.in.sh or your profile if you prefer as well.
|
||||
#SOLR_RECOMMENDED_OPEN_FILES=
|
||||
#SOLR_RECOMMENDED_MAX_PROCESSES=
|
||||
#SOLR_ULIMIT_CHECKS=
|
||||
|
||||
# When running Solr in non-cloud mode and if planning to do distributed search (using the "shards" parameter), the
|
||||
# list of hosts needs to be defined in an allow-list or Solr will forbid the request. The allow-list can be configured
|
||||
# in solr.xml, or if you are using the OOTB solr.xml, can be specified using the system property "solr.allowUrls".
|
||||
# Alternatively host checking can be disabled by using the system property "solr.disable.allowUrls"
|
||||
#SOLR_OPTS="$SOLR_OPTS -Dsolr.allowUrls=http://localhost:8983,http://localhost:8984"
|
||||
|
||||
# For a visual indication in the Admin UI of what type of environment this cluster is, configure
|
||||
# a -Dsolr.environment property below. Valid values are prod, stage, test, dev, with an optional
|
||||
# label or color, e.g. -Dsolr.environment=test,label=Functional+test,color=brown
|
||||
#SOLR_OPTS="$SOLR_OPTS -Dsolr.environment=prod"
|
||||
|
||||
# Specifies the path to a common library directory that will be shared across all cores.
|
||||
# Any JAR files in this directory will be added to the search path for Solr plugins.
|
||||
# If the specified path is not absolute, it will be relative to `$SOLR_HOME`.
|
||||
#SOLR_OPTS="$SOLR_OPTS -Dsolr.sharedLib=/path/to/lib"
|
||||
|
||||
# Runs solr in java security manager sandbox. This can protect against some attacks.
|
||||
# Runtime properties are passed to the security policy file (server/etc/security.policy)
|
||||
# You can also tweak via standard JDK files such as ~/.java.policy, see https://s.apache.org/java8policy
|
||||
# This is experimental! It may not work at all with Hadoop/HDFS features.
|
||||
#SOLR_SECURITY_MANAGER_ENABLED=true
|
||||
# This variable provides you with the option to disable the Admin UI. if you uncomment the variable below and
|
||||
# change the value to true. The option is configured as a system property as defined in SOLR_START_OPTS in the start
|
||||
# scripts.
|
||||
# SOLR_ADMIN_UI_DISABLED=false
|
||||
|
||||
# Solr is by default allowed to read and write data from/to SOLR_HOME and a few other well defined locations
|
||||
# Sometimes it may be necessary to place a core or a backup on a different location or a different disk
|
||||
# This parameter lets you specify file system path(s) to explicitly allow. The special value of '*' will allow any path
|
||||
#SOLR_OPTS="$SOLR_OPTS -Dsolr.allowPaths=/mnt/bigdisk,/other/path"
|
||||
|
||||
# Solr can attempt to take a heap dump on out of memory errors. To enable this, uncomment the line setting
|
||||
# SOLR_HEAP_DUMP below. Heap dumps will be saved to SOLR_LOG_DIR/dumps by default. Alternatively, you can specify any
|
||||
# other directory, which will implicitly enable heap dumping. Dump name pattern will be solr-[timestamp]-pid[###].hprof
|
||||
# When using this feature, it is recommended to have an external service monitoring the given dir.
|
||||
# If more fine grained control is required, you can manually add the appropriate flags to SOLR_OPTS
|
||||
# See https://docs.oracle.com/en/java/javase/11/troubleshoot/command-line-options1.html
|
||||
# You can test this behavior by setting SOLR_HEAP=25m
|
||||
#SOLR_HEAP_DUMP=true
|
||||
#SOLR_HEAP_DUMP_DIR=/var/log/dumps
|
||||
|
||||
# Before version 9.0, Solr required a copy of solr.xml file in $SOLR_HOME. Now Solr will use a default file if not found.
|
||||
# To restore the old behavior, set the variable below to true
|
||||
#SOLR_SOLRXML_REQUIRED=false
|
||||
|
||||
# Some previous versions of Solr use an outdated log4j dependency. If you are unable to use at least log4j version 2.15.0
|
||||
# then enable the following setting to address CVE-2021-44228
|
||||
# SOLR_OPTS="$SOLR_OPTS -Dlog4j2.formatMsgNoLookups=true"
|
||||
|
||||
# The bundled plugins in the "modules" folder can easily be enabled as a comma-separated list in SOLR_MODULES variable
|
||||
# SOLR_MODULES=extraction,ltr
|
||||
|
||||
# Configure the default replica placement plugin to use if one is not configured in cluster properties
|
||||
# See https://solr.apache.org/guide/solr/latest/configuration-guide/replica-placement-plugins.html for details
|
||||
#SOLR_PLACEMENTPLUGIN_DEFAULT=simple
|
||||
|
||||
# Solr internally doesn't use cookies other than for modules such as Kerberos/Hadoop Auth. If you don't need any of those
|
||||
# And you don't need them for an external system (such as a load balancer), you can disable the use of a CookieStore with:
|
||||
# SOLR_OPTS="$SOLR_OPTS -Dsolr.http.disableCookies=true"
|
||||
Reference in New Issue
Block a user