|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 2 | +# contributor license agreements. See the NOTICE file distributed with |
| 3 | +# this work for additional information regarding copyright ownership. |
| 4 | +# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 5 | +# (the "License"); you may not use this file except in compliance with |
| 6 | +# the License. You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | +# By default the script will use JAVA_HOME to determine which java |
| 17 | +# to use, but you can set a specific path for Solr to use without |
| 18 | +# affecting other Java applications on your server/workstation. |
| 19 | +#SOLR_JAVA_HOME="" |
| 20 | + |
| 21 | +# Increase Java Heap as needed to support your indexing / query needs |
| 22 | +SOLR_HEAP="{{ solr_heap | default('512m') }}" |
| 23 | + |
| 24 | +# Expert: If you want finer control over memory options, specify them directly |
| 25 | +# Comment out SOLR_HEAP if you are using this though, that takes precedence |
| 26 | +#SOLR_JAVA_MEM="-Xms512m -Xmx512m" |
| 27 | + |
| 28 | +# Enable verbose GC logging |
| 29 | +{% if use_openjdk11 or use_openjdk17 %} |
| 30 | +GC_LOG_OPTS='-Xlog:gc*' |
| 31 | +{% else %} |
| 32 | +GC_LOG_OPTS="-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails \ |
| 33 | +-XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime" |
| 34 | +{% endif %} |
| 35 | + |
| 36 | +# These GC settings have shown to work well for a number of common Solr workloads |
| 37 | +GC_TUNE="-XX:NewRatio=3 \ |
| 38 | +-XX:SurvivorRatio=4 \ |
| 39 | +-XX:TargetSurvivorRatio=90 \ |
| 40 | +-XX:MaxTenuringThreshold=8 \ |
| 41 | +-XX:+UseConcMarkSweepGC \ |
| 42 | +{% if use_openjdk8 %} |
| 43 | +-XX:+UseParNewGC \ |
| 44 | +{% endif %} |
| 45 | +-XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 \ |
| 46 | +-XX:+CMSScavengeBeforeRemark \ |
| 47 | +-XX:PretenureSizeThreshold=64m \ |
| 48 | +-XX:+UseCMSInitiatingOccupancyOnly \ |
| 49 | +-XX:CMSInitiatingOccupancyFraction=50 \ |
| 50 | +-XX:CMSMaxAbortablePrecleanTime=6000 \ |
| 51 | +-XX:+CMSParallelRemarkEnabled \ |
| 52 | +-XX:+ParallelRefProcEnabled" |
| 53 | + |
| 54 | +# Set the ZooKeeper connection string if using an external ZooKeeper ensemble |
| 55 | +# e.g. host1:2181,host2:2181/chroot |
| 56 | +# Leave empty if not using SolrCloud |
| 57 | +ZK_HOST="{{ solr_zk_host | default('127.0.0.1:2181') }}" |
| 58 | + |
| 59 | +# Set the ZooKeeper client timeout (for SolrCloud mode) |
| 60 | +ZK_CLIENT_TIMEOUT="{{ solr_zk_client_timeout | default('15000') }}" |
| 61 | + |
| 62 | +# By default the start script uses "localhost"; override the hostname here |
| 63 | +# for production SolrCloud environments to control the hostname exposed to cluster state |
| 64 | +SOLR_HOST="{{ solr_host }}" |
| 65 | + |
| 66 | +# By default the start script uses UTC; override the timezone if needed |
| 67 | +#SOLR_TIMEZONE="UTC" |
| 68 | + |
| 69 | +# CVE-2021-44228 mitigation |
| 70 | +SOLR_OPTS="$SOLR_OPTS -Dlog4j2.formatMsgNoLookups=true" |
| 71 | + |
| 72 | +# Set to true to activate the JMX RMI connector to allow remote JMX client applications |
| 73 | +# to monitor the JVM hosting Solr; set to "false" to disable that behavior |
| 74 | +# (false is recommended in production environments) |
| 75 | +{% if solr_jmx_port is defined %} |
| 76 | +# The usual solr method includes the instruction "-Dcom.sun.management.jmxremote.local.only=false" which may be hampering zabbix connecting to JMX |
| 77 | +#ENABLE_REMOTE_JMX_OPTS="true" |
| 78 | +#RMI_PORT="{{ solr_jmx_port }}" |
| 79 | +# Alternative to the above is to manually include the necessary JMX properties |
| 80 | +ENABLE_REMOTE_JMX_OPTS="false" |
| 81 | +SOLR_OPTS="$SOLR_OPTS -Djava.rmi.server.hostname={{ solr_host }}" |
| 82 | +SOLR_OPTS="$SOLR_OPTS -Dcom.sun.management.jmxremote" |
| 83 | +SOLR_OPTS="$SOLR_OPTS -Dcom.sun.management.jmxremote.port={{ solr_jmx_port }}" |
| 84 | +SOLR_OPTS="$SOLR_OPTS -Dcom.sun.management.jmxremote.rmi.port={{ solr_jmx_port }}" |
| 85 | +SOLR_OPTS="$SOLR_OPTS -Dcom.sun.management.jmxremote.authenticate=false" |
| 86 | +SOLR_OPTS="$SOLR_OPTS -Dcom.sun.management.jmxremote.ssl=false" |
| 87 | +# JMX monitoring needs IPV4 preferred |
| 88 | +SOLR_OPTS="$SOLR_OPTS -Djava.net.preferIPv4Stack=true" |
| 89 | +{% else %} |
| 90 | +ENABLE_REMOTE_JMX_OPTS="false" |
| 91 | +# The script will use SOLR_PORT+10000 for the RMI_PORT or you can set it here |
| 92 | +# RMI_PORT=18983 |
| 93 | +{% endif %} |
| 94 | + |
| 95 | +# Set the thread stack size |
| 96 | +SOLR_OPTS="$SOLR_OPTS -Xss256k" |
| 97 | + |
| 98 | +# Anything you add to the SOLR_OPTS variable will be included in the java |
| 99 | +# start command line as-is, in ADDITION to other options. If you specify the |
| 100 | +# -a option on start script, those options will be appended as well. Examples: |
| 101 | +#SOLR_OPTS="$SOLR_OPTS -Dsolr.autoSoftCommit.maxTime=3000" |
| 102 | +#SOLR_OPTS="$SOLR_OPTS -Dsolr.autoCommit.maxTime=60000" |
| 103 | +#SOLR_OPTS="$SOLR_OPTS -Dsolr.clustering.enabled=true" |
| 104 | + |
| 105 | +{% if solr_bind_jetty_host is defined and solr_bind_jetty_host | bool == true %} |
| 106 | +# Only listen on the defined interface |
| 107 | +# This may not be necessary if you are using firewalls or VLANs/VPCs to limit access to the port |
| 108 | +SOLR_OPTS="$SOLR_OPTS -Djetty.host=${SOLR_HOST}" |
| 109 | +{% endif %} |
| 110 | + |
| 111 | +# turn off config editing for security |
| 112 | +SOLR_OPTS="$SOLR_OPTS -Ddisable.configEdit=true" |
| 113 | + |
| 114 | +# Location where the bin/solr script will save PID files for running instances |
| 115 | +# If not set, the script will create PID files in $SOLR_TIP/bin |
| 116 | +#SOLR_PID_DIR= |
| 117 | + |
| 118 | +# Path to a directory for Solr to store cores and their data. By default, Solr will use server/solr |
| 119 | +# If solr.xml is not stored in ZooKeeper, this directory needs to contain solr.xml |
| 120 | +SOLR_HOME={{ solr_home | default('/data/solr/data') }} |
| 121 | + |
| 122 | +# Solr provides a default Log4J configuration properties file in server/resources |
| 123 | +# however, you may want to customize the log settings and file appender location |
| 124 | +# so you can point the script to use a different log4j.properties file |
| 125 | +#LOG4J_PROPS={{ solr_log4j_props | default('/data/solr/log4j.properties') }} |
| 126 | + |
| 127 | +# Location where Solr should write logs to; should agree with the file appender |
| 128 | +# settings in server/resources/log4j.properties |
| 129 | +#SOLR_LOGS_DIR={{ solr_logs_dir | default('/data/solr/logs') }} |
| 130 | + |
| 131 | +# Sets the port Solr binds to, default is 8983 |
| 132 | +SOLR_PORT={{ solr_port| default('8983') }} |
| 133 | + |
| 134 | +# Uncomment to set SSL-related system properties |
| 135 | +# Be sure to update the paths to the correct keystore for your environment |
| 136 | +#SOLR_SSL_KEY_STORE=etc/solr-ssl.keystore.jks |
| 137 | +#SOLR_SSL_KEY_STORE_PASSWORD=secret |
| 138 | +#SOLR_SSL_TRUST_STORE=etc/solr-ssl.keystore.jks |
| 139 | +#SOLR_SSL_TRUST_STORE_PASSWORD=secret |
| 140 | +#SOLR_SSL_NEED_CLIENT_AUTH=false |
| 141 | +#SOLR_SSL_WANT_CLIENT_AUTH=false |
| 142 | + |
| 143 | +# Uncomment if you want to override previously defined SSL values for HTTP client |
| 144 | +# otherwise keep them commented and the above values will automatically be set for HTTP clients |
| 145 | +#SOLR_SSL_CLIENT_KEY_STORE= |
| 146 | +#SOLR_SSL_CLIENT_KEY_STORE_PASSWORD= |
| 147 | +#SOLR_SSL_CLIENT_TRUST_STORE= |
| 148 | +#SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD= |
| 149 | + |
| 150 | +# Settings for authentication |
| 151 | +#SOLR_AUTHENTICATION_CLIENT_CONFIGURER= |
| 152 | +#SOLR_AUTHENTICATION_OPTS= |
| 153 | + |
| 154 | +SOLR_MODE="{{ solr_mode | default('solrcloud') }}" |
0 commit comments