Skip to content

Commit

Permalink
issue #52 - solr user unable to start solr v5.2.1 service and refacto…
Browse files Browse the repository at this point in the history
…ring
  • Loading branch information
vkhatri committed Jul 24, 2015
1 parent 030db6a commit a5960bc
Showing 1 changed file with 34 additions and 43 deletions.
77 changes: 34 additions & 43 deletions templates/default/v5.2.x/solr.conf.erb
Expand Up @@ -17,6 +17,30 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# 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.
SOLR_OPTS="$SOLR_OPTS
<% if node['solrcloud']['zk_run'] -%>
-DzkRun
<% end -%>
<% if node['solrcloud']['hdfs']['enable'] && node['solrcloud']['hdfs']['hdfs_home'] -%>
-Dsolr.directoryFactory=<%= node['solrcloud']['hdfs']['directory_factory'] %>
-Dsolr.lock.type=<%= node['solrcloud']['hdfs']['lock_type'] %>
-Dsolr.hdfs.home=<%= node['solrcloud']['hdfs']['hdfs_home'] %>
<% end -%>
<% if node['solrcloud']['enable_jmx'] -%>
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=<%= node['solrcloud']['jmx']['authenticate'] %>
-Dcom.sun.management.jmxremote.password.file=<%= node['solrcloud']['jmx']['password_file'] %>
-Dcom.sun.management.jmxremote.access.file=<%= node['solrcloud']['jmx']['access_file'] %>
-Djava.rmi.server.hostname=<%= node['solrcloud']['solr_config']['solr_host'] %>
<% end -%>
<%= node['solrcloud']['java_options'].join(" \n") %>
"

# 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.
Expand All @@ -29,33 +53,21 @@
# Comment out SOLR_HEAP if you are using this though, that takes precedence
SOLR_JAVA_MEM="-Xms<%= node.solrcloud.java_xms %> -Xmx<%= node.solrcloud.java_xmx %>"

# Enable verbose GC logging
GC_LOG_OPTS="<%= node['solrcloud']['solr_config']['gc_log_opts'].sort.join(" \\ \n") %>"

# These GC settings have shown to work well for a number of common Solr workloads
GC_TUNE="<%= node['solrcloud']['solr_config']['gc_tune'].sort.join(" \\ \n") %>"

# Set the ZooKeeper connection string if using an external ZooKeeper ensemble
# e.g. host1:2181,host2:2181/chroot
# Leave empty if not using SolrCloud
<% if node['solrcloud']['zk_run'] -%>
SOLR_OPTS="$SOLR_OPTS -DzkRun"
ZK_HOST=""
<% elsif !node['solrcloud']['solr_config']['solrcloud']['zk_host'].empty? -%>
<% unless node['solrcloud']['zk_run'] -%>
ZK_HOST="<%=node['solrcloud']['solr_config']['solrcloud']['zk_host'].sort.uniq.join(',') %><%= node['solrcloud']['solr_config']['solrcloud']['zk_chroot'] %>"
<% else -%>
ZK_HOST=""
<% end -%>

# Set the ZooKeeper client timeout (for SolrCloud mode)
ZK_CLIENT_TIMEOUT="<%= node['solrcloud']['solr_config']['solrcloud']['zk_client_timeout'] %>"

# 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="<%= node['solrcloud']['solr_config']['solr_host'] %>"
# Enable verbose GC logging
GC_LOG_OPTS="<%= node['solrcloud']['solr_config']['gc_log_opts'].sort.join(" \n") %>"

# By default the start script uses UTC; override the timezone if needed
SOLR_TIMEZONE="<%= node['solrcloud']['solr_config']['solr_timezone'] %>"
# These GC settings have shown to work well for a number of common Solr workloads
GC_TUNE="<%= node['solrcloud']['solr_config']['gc_tune'].sort.join(" \n") %>"

# 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
Expand All @@ -65,40 +77,19 @@ ENABLE_REMOTE_JMX_OPTS="<%= boolean_string(node['solrcloud']['enable_jmx']) %>"
# The script will use SOLR_PORT+10000 for the RMI_PORT or you can set it here
RMI_PORT=<%= node['solrcloud']['jmx']['port'] %>

# 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.
<% if node['solrcloud']['hdfs']['enable'] && node['solrcloud']['hdfs']['hdfs_home'] -%>
SOLR_OPTS="$SOLR_OPTS \
-Dsolr.directoryFactory=<%= node['solrcloud']['hdfs']['directory_factory'] %> \
-Dsolr.lock.type=<%= node['solrcloud']['hdfs']['lock_type'] %> \
-Dsolr.hdfs.home=<%= node['solrcloud']['hdfs']['hdfs_home'] %>"
<% end -%>
<% if node['solrcloud']['enable_jmx'] -%>
SOLR_OPTS="$SOLR_OPTS \
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.local.only=false \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=<%= node['solrcloud']['jmx']['authenticate'] %> \
-Dcom.sun.management.jmxremote.password.file=<%= node['solrcloud']['jmx']['password_file'] %> \
-Dcom.sun.management.jmxremote.access.file=<%= node['solrcloud']['jmx']['access_file'] %> \
-Djava.rmi.server.hostname=<%= node['solrcloud']['solr_config']['solr_host'] %>"
<% end -%>
# 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="<%= node['solrcloud']['solr_config']['solr_host'] %>"

<%= unless node['solrcloud']['java_options'].empty? -%>
SOLR_OPTS="$SOLR_OPTS \
<%= node['solrcloud']['java_options'].join(' \/n') -%>
"
<% end -%>
# By default the start script uses UTC; override the timezone if needed
SOLR_TIMEZONE="<%= node['solrcloud']['solr_config']['solr_timezone'] %>"

# 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=<%= node['solrcloud']['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
# CHECK THIS LOCATION, MIGHT BE A CONFLICT WITH DATA DIR
SOLR_HOME=<%= node['solrcloud']['solr_home'] %>

# Solr provides a default Log4J configuration properties file in server/resources
Expand Down

0 comments on commit a5960bc

Please sign in to comment.