solr-env.sh 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #!/bin/bash
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  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=/usr/java/default
  20. # Increase Java Min/Max Heap as needed to support your indexing / query needs
  21. SOLR_JAVA_MEM="-Xms1024m -Xmx2048m"
  22. # Enable verbose GC logging
  23. GC_LOG_OPTS="-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails \
  24. -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime"
  25. # These GC settings have shown to work well for a number of common Solr workloads
  26. GC_TUNE="-XX:NewRatio=3 \
  27. -XX:SurvivorRatio=4 \
  28. -XX:TargetSurvivorRatio=90 \
  29. -XX:MaxTenuringThreshold=8 \
  30. -XX:+UseConcMarkSweepGC \
  31. -XX:+UseParNewGC \
  32. -XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 \
  33. -XX:+CMSScavengeBeforeRemark \
  34. -XX:PretenureSizeThreshold=64m \
  35. -XX:+UseCMSInitiatingOccupancyOnly \
  36. -XX:CMSInitiatingOccupancyFraction=50 \
  37. -XX:CMSMaxAbortablePrecleanTime=6000 \
  38. -XX:+CMSParallelRemarkEnabled \
  39. -XX:+ParallelRefProcEnabled"
  40. # Set the ZooKeeper connection string if using an external ZooKeeper ensemble
  41. # e.g. host1:2181,host2:2181/chroot
  42. # Leave empty if not using SolrCloud
  43. #ZK_HOST="localhost:9983/ambari-solr"
  44. # Set the ZooKeeper client timeout (for SolrCloud mode)
  45. ZK_CLIENT_TIMEOUT="60000"
  46. # By default the start script uses "localhost"; override the hostname here
  47. # for production SolrCloud environments to control the hostname exposed to cluster state
  48. #SOLR_HOST="192.168.1.1"
  49. # By default the start script uses UTC; override the timezone if needed
  50. #SOLR_TIMEZONE="UTC"
  51. # Set to true to activate the JMX RMI connector to allow remote JMX client applications
  52. # to monitor the JVM hosting Solr; set to "false" to disable that behavior
  53. # (false is recommended in production environments)
  54. ENABLE_REMOTE_JMX_OPTS="true"
  55. # The script will use SOLR_PORT+10000 for the RMI_PORT or you can set it here
  56. RMI_PORT=18886
  57. # Anything you add to the SOLR_OPTS variable will be included in the java
  58. # start command line as-is, in ADDITION to other options. If you specify the
  59. # -a option on start script, those options will be appended as well. Examples:
  60. #SOLR_OPTS="$SOLR_OPTS -Dsolr.autoSoftCommit.maxTime=3000"
  61. #SOLR_OPTS="$SOLR_OPTS -Dsolr.autoCommit.maxTime=60000"
  62. #SOLR_OPTS="$SOLR_OPTS -Dsolr.clustering.enabled=true"
  63. # Location where the bin/solr script will save PID files for running instances
  64. # If not set, the script will create PID files in $SOLR_TIP/bin
  65. SOLR_PID_DIR=/var/run/ambari-logsearch-solr
  66. # Path to a directory where Solr creates index files, the specified directory
  67. # must contain a solr.xml; by default, Solr will use server/solr
  68. SOLR_HOME=/root/logsearch_solr_index/data
  69. # Solr provides a default Log4J configuration properties file in server/resources
  70. # however, you may want to customize the log settings and file appender location
  71. # so you can point the script to use a different log4j.properties file
  72. LOG4J_PROPS=/root/config/solr/log4j.properties
  73. # Location where Solr should write logs to; should agree with the file appender
  74. # settings in server/resources/log4j.properties
  75. SOLR_LOGS_DIR=/var/log/ambari-logsearch-solr
  76. # Sets the port Solr binds to, default is 8983
  77. SOLR_PORT=8886