solr.in.cmd 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. @REM
  2. @REM Licensed to the Apache Software Foundation (ASF) under one or more
  3. @REM contributor license agreements. See the NOTICE file distributed with
  4. @REM this work for additional information regarding copyright ownership.
  5. @REM The ASF licenses this file to You under the Apache License, Version 2.0
  6. @REM (the "License"); you may not use this file except in compliance with
  7. @REM the License. You may obtain a copy of the License at
  8. @REM
  9. @REM http://www.apache.org/licenses/LICENSE-2.0
  10. @REM
  11. @REM Unless required by applicable law or agreed to in writing, software
  12. @REM distributed under the License is distributed on an "AS IS" BASIS,
  13. @REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. @REM See the License for the specific language governing permissions and
  15. @REM limitations under the License.
  16. @echo off
  17. REM Settings here will override settings in existing env vars or in bin/solr. The default shipped state
  18. REM of this file is completely commented.
  19. REM By default the script will use JAVA_HOME to determine which java
  20. REM to use, but you can set a specific path for Solr to use without
  21. REM affecting other Java applications on your server/workstation.
  22. REM set SOLR_JAVA_HOME=
  23. REM Increase Java Min/Max Heap as needed to support your indexing / query needs
  24. REM set SOLR_JAVA_MEM=-Xms512m -Xmx512m
  25. REM Configure verbose GC logging:
  26. REM For Java 8: if this is set, additional params will be added to specify the log file & rotation
  27. REM For Java 9 or higher: GC_LOG_OPTS is currently not supported. If you set it, the startup script will exit with failure.
  28. REM set GC_LOG_OPTS=-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime
  29. REM Various GC settings have shown to work well for a number of common Solr workloads.
  30. REM See solr.cmd GC_TUNE for the default list.
  31. REM set GC_TUNE=-XX:NewRatio=3 -XX:SurvivorRatio=4 etc.
  32. REM Set the ZooKeeper connection string if using an external ZooKeeper ensemble
  33. REM e.g. host1:2181,host2:2181/chroot
  34. REM Leave empty if not using SolrCloud
  35. REM set ZK_HOST=
  36. REM Set the ZooKeeper client timeout (for SolrCloud mode)
  37. REM set ZK_CLIENT_TIMEOUT=15000
  38. REM By default the start script uses "localhost"; override the hostname here
  39. REM for production SolrCloud environments to control the hostname exposed to cluster state
  40. REM set SOLR_HOST=192.168.1.1
  41. REM By default Solr will try to connect to Zookeeper with 30 seconds in timeout; override the timeout if needed
  42. REM set SOLR_WAIT_FOR_ZK=30
  43. REM By default the start script uses UTC; override the timezone if needed
  44. REM set SOLR_TIMEZONE=UTC
  45. REM Set to true to activate the JMX RMI connector to allow remote JMX client applications
  46. REM to monitor the JVM hosting Solr; set to "false" to disable that behavior
  47. REM (false is recommended in production environments)
  48. REM set ENABLE_REMOTE_JMX_OPTS=false
  49. REM The script will use SOLR_PORT+10000 for the RMI_PORT or you can set it here
  50. REM set RMI_PORT=18983
  51. REM Anything you add to the SOLR_OPTS variable will be included in the java
  52. REM start command line as-is, in ADDITION to other options. If you specify the
  53. REM -a option on start script, those options will be appended as well. Examples:
  54. REM set SOLR_OPTS=%SOLR_OPTS% -Dsolr.autoSoftCommit.maxTime=3000
  55. REM set SOLR_OPTS=%SOLR_OPTS% -Dsolr.autoCommit.maxTime=60000
  56. REM set SOLR_OPTS=%SOLR_OPTS% -Dsolr.clustering.enabled=true
  57. REM Path to a directory for Solr to store cores and their data. By default, Solr will use server\solr
  58. REM If solr.xml is not stored in ZooKeeper, this directory needs to contain solr.xml
  59. REM set SOLR_HOME=
  60. REM Path to a directory that Solr will use as root for data folders for each core.
  61. REM If not set, defaults to <instance_dir>/data. Overridable per core through 'dataDir' core property
  62. REM set SOLR_DATA_HOME=
  63. REM Changes the logging level. Valid values: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF. Default is INFO
  64. REM This is an alternative to changing the rootLogger in log4j2.xml
  65. REM set SOLR_LOG_LEVEL=INFO
  66. REM Location where Solr should write logs to. Absolute or relative to solr start dir
  67. REM set SOLR_LOGS_DIR=logs
  68. REM Enables log rotation before starting Solr. Setting SOLR_LOG_PRESTART_ROTATION=true will let Solr take care of pre
  69. REM start rotation of logs. This is false by default as log4j2 handles this for us. If you choose to use another log
  70. REM framework that cannot do startup rotation, you may want to enable this to let Solr rotate logs on startup.
  71. REM set SOLR_LOG_PRESTART_ROTATION=false
  72. REM Set the host interface to listen on. Jetty will listen on all interfaces (0.0.0.0) by default.
  73. REM This must be an IPv4 ("a.b.c.d") or bracketed IPv6 ("[x::y]") address, not a hostname!
  74. REM set SOLR_JETTY_HOST=0.0.0.0
  75. REM Sets the port Solr binds to, default is 8983
  76. REM set SOLR_PORT=8983
  77. REM Enables HTTPS. It is implictly true if you set SOLR_SSL_KEY_STORE. Use this config
  78. REM to enable https module with custom jetty configuration.
  79. REM set SOLR_SSL_ENABLED=true
  80. REM Uncomment to set SSL-related system properties
  81. REM Be sure to update the paths to the correct keystore for your environment
  82. REM set SOLR_SSL_KEY_STORE=etc/solr-ssl.keystore.jks
  83. REM set SOLR_SSL_KEY_STORE_PASSWORD=secret
  84. REM set SOLR_SSL_TRUST_STORE=etc/solr-ssl.keystore.jks
  85. REM set SOLR_SSL_TRUST_STORE_PASSWORD=secret
  86. REM Require clients to authenticate
  87. REM set SOLR_SSL_NEED_CLIENT_AUTH=false
  88. REM Enable clients to authenticate (but not require)
  89. REM set SOLR_SSL_WANT_CLIENT_AUTH=false
  90. REM SSL Certificates contain host/ip "peer name" information that is validated by default. Setting
  91. REM this to false can be useful to disable these checks when re-using a certificate on many hosts
  92. REM set SOLR_SSL_CHECK_PEER_NAME=true
  93. REM Override Key/Trust Store types if necessary
  94. REM set SOLR_SSL_KEY_STORE_TYPE=JKS
  95. REM set SOLR_SSL_TRUST_STORE_TYPE=JKS
  96. REM Uncomment if you want to override previously defined SSL values for HTTP client
  97. REM otherwise keep them commented and the above values will automatically be set for HTTP clients
  98. REM set SOLR_SSL_CLIENT_KEY_STORE=
  99. REM set SOLR_SSL_CLIENT_KEY_STORE_PASSWORD=
  100. REM set SOLR_SSL_CLIENT_TRUST_STORE=
  101. REM set SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD=
  102. REM set SOLR_SSL_CLIENT_KEY_STORE_TYPE=
  103. REM set SOLR_SSL_CLIENT_TRUST_STORE_TYPE=
  104. REM Sets path of Hadoop credential provider (hadoop.security.credential.provider.path property) and
  105. REM enables usage of credential store.
  106. REM Credential provider should store the following keys:
  107. REM * solr.jetty.keystore.password
  108. REM * solr.jetty.truststore.password
  109. REM Set the two below if you want to set specific store passwords for HTTP client
  110. REM * javax.net.ssl.keyStorePassword
  111. REM * javax.net.ssl.trustStorePassword
  112. REM More info: https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/CredentialProviderAPI.html
  113. REM set SOLR_HADOOP_CREDENTIAL_PROVIDER_PATH=localjceks://file/home/solr/hadoop-credential-provider.jceks
  114. REM set SOLR_OPTS=" -Dsolr.ssl.credential.provider.chain=hadoop"
  115. REM Settings for authentication
  116. REM Please configure only one of SOLR_AUTHENTICATION_CLIENT_BUILDER or SOLR_AUTH_TYPE parameters
  117. REM set SOLR_AUTHENTICATION_CLIENT_BUILDER=org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory
  118. REM set SOLR_AUTH_TYPE=basic
  119. REM set SOLR_AUTHENTICATION_OPTS="-Dbasicauth=solr:SolrRocks"
  120. REM Settings for ZK ACL
  121. REM set SOLR_ZK_CREDS_AND_ACLS=-DzkACLProvider=org.apache.solr.common.cloud.VMParamsAllAndReadonlyDigestZkACLProvider ^
  122. REM -DzkCredentialsProvider=org.apache.solr.common.cloud.VMParamsSingleSetCredentialsDigestZkCredentialsProvider ^
  123. REM -DzkDigestUsername=admin-user -DzkDigestPassword=CHANGEME-ADMIN-PASSWORD ^
  124. REM -DzkDigestReadonlyUsername=readonly-user -DzkDigestReadonlyPassword=CHANGEME-READONLY-PASSWORD
  125. REM set SOLR_OPTS=%SOLR_OPTS% %SOLR_ZK_CREDS_AND_ACLS%
  126. REM When running Solr in non-cloud mode and if planning to do distributed search (using the "shards" parameter), the
  127. REM list of hosts needs to be whitelisted or Solr will forbid the request. The whitelist can be configured in solr.xml,
  128. REM or if you are using the OOTB solr.xml, can be specified using the system property "solr.shardsWhitelist". Alternatively
  129. REM host checking can be disabled by using the system property "solr.disable.shardsWhitelist"
  130. REM set SOLR_OPTS="%SOLR_OPTS% -Dsolr.shardsWhitelist=http://localhost:8983,http://localhost:8984"