solr: Fix the default log level and add a way to customize the log4j configuration. See https://support.d4science.org/issues/11068

This commit is contained in:
Andrea Dell'Amico 2018-01-27 15:56:24 +01:00
parent d2db6b59bf
commit 45e40eb5d2
3 changed files with 14 additions and 6 deletions

View File

@ -7,19 +7,23 @@ solr_service: -solr
solr_config_name: hindex solr_config_name: hindex
solr_shards: 1 solr_shards: 1
solr_instance: '{{ solr_service }}' solr_instance: '{{ solr_service }}'
solr_custom_log4j: False
solr_rotate_logs_on_start: 'true'
solr_log_dir: /var/log/solr solr_log_dir: /var/log/solr
solr_log_level: INFO solr_log_level: ERROR
solr_http_port_1: '{{ solr_http_port }}' solr_http_port_1: '{{ solr_http_port }}'
solr_zoo_port: 9983 solr_zoo_port: 9983
solr_zoo_port_1: 9984 solr_zoo_port_1: 9984
solr_zoo_port_2: 9985 solr_zoo_port_2: 9985
solr_jmx_port_1: 8601 solr_jmx_port_1: 8601
solr_jmx_enabled: 'false'
solr_user: solr solr_user: solr
solr_group: solr solr_group: solr
# We need to define this one because we are using the tomcat multiple instances role # We need to define this one because we are using the tomcat multiple instances role
solr_base_dir: /opt solr_base_dir: /opt
solr_server_dir: '{{ solr_base_dir }}/solr' solr_server_dir: '{{ solr_base_dir }}/solr'
solr_data_dir: '{{ solr_server_dir }}/server/solr' solr_data_dir: '{{ solr_server_dir }}/server/solr'
solr_conf_dir: '{{ solr_server_dir }}'/conf
solr_collections_base_dir: '{{ solr_data_dir }}/data/solr' solr_collections_base_dir: '{{ solr_data_dir }}/data/solr'
solr_pid_dir: '{{ solr_server_dir }}/bin' solr_pid_dir: '{{ solr_server_dir }}/bin'
solr_heap: 1024M solr_heap: 1024M

View File

@ -28,6 +28,9 @@
- name: Create the solr lib directory - name: Create the solr lib directory
file: dest={{ solr_data_dir }}/lib state=directory file: dest={{ solr_data_dir }}/lib state=directory
- name: Create the solr conf directory
file: dest={{ solr_conf_dir }} state=directory
- name: Install the zookeeper configuration - name: Install the zookeeper configuration
template: src={{ item }}.j2 dest={{ solr_data_dir }}/{{ item }} template: src={{ item }}.j2 dest={{ solr_data_dir }}/{{ item }}
with_items: with_items:

View File

@ -1,4 +1,3 @@
# Licensed to the Apache Software Foundation (ASF) under one or more # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with # contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. # this work for additional information regarding copyright ownership.
@ -72,10 +71,10 @@ ZK_CLIENT_TIMEOUT="{{ solr_zk_timeout }}"
# Set to true to activate the JMX RMI connector to allow remote JMX client applications # 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 # to monitor the JVM hosting Solr; set to "false" to disable that behavior
# (false is recommended in production environments) # (false is recommended in production environments)
ENABLE_REMOTE_JMX_OPTS="false" ENABLE_REMOTE_JMX_OPTS="{{ solr_jmx_enabled }}"
# The script will use SOLR_PORT+10000 for the RMI_PORT or you can set it here # The script will use SOLR_PORT+10000 for the RMI_PORT or you can set it here
# RMI_PORT=18983 RMI_PORT={{ solr_jmx_port_1 }}
# SOLR additional options # SOLR additional options
SOLR_OPTS="$SOLR_OPTS {{ solr_startup_opts }}" SOLR_OPTS="$SOLR_OPTS {{ solr_startup_opts }}"
@ -102,10 +101,12 @@ SOLR_PID_DIR={{ solr_pid_dir }}
# If solr.xml is not stored in ZooKeeper, this directory needs to contain solr.xml # If solr.xml is not stored in ZooKeeper, this directory needs to contain solr.xml
SOLR_HOME={{ solr_data_dir }} SOLR_HOME={{ solr_data_dir }}
{% if solr_custom_log4j %}
# Solr provides a default Log4J configuration properties file in server/resources # Solr provides a default Log4J configuration properties file in server/resources
# however, you may want to customize the log settings and file appender location # however, you may want to customize the log settings and file appender location
# so you can point the script to use a different log4j.properties file # so you can point the script to use a different log4j.properties file
#LOG4J_PROPS=/var/solr/log4j.properties LOG4J_PROPS={{ solr_conf_dir }}/log4j.properties
{% endif %}
# Changes the logging level. Valid values: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF. Default is INFO # 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 log4j.properties # This is an alternative to changing the rootLogger in log4j.properties
@ -118,7 +119,7 @@ SOLR_LOGS_DIR={{ solr_log_dir }}
# Enables log rotation, cleanup, and archiving during start. Setting SOLR_LOG_PRESTART_ROTATION=false will skip start # Enables log rotation, cleanup, and archiving during start. Setting SOLR_LOG_PRESTART_ROTATION=false will skip start
# time rotation of logs, and the archiving of the last GC and console log files. It does not affect Log4j configuration. # time rotation of logs, and the archiving of the last GC and console log files. It does not affect Log4j configuration.
# This pre-startup rotation may need to be disabled depending how much you customize the default logging setup. # This pre-startup rotation may need to be disabled depending how much you customize the default logging setup.
#SOLR_LOG_PRESTART_ROTATION=true SOLR_LOG_PRESTART_ROTATION={{ solr_rotate_logs_on_start }}
# Sets the port Solr binds to, default is 8983 # Sets the port Solr binds to, default is 8983
SOLR_PORT={{ solr_http_port }} SOLR_PORT={{ solr_http_port }}