Import the old solr role.

This commit is contained in:
Andrea Dell'Amico 2020-06-25 12:24:53 +02:00
parent a67ca953ff
commit 1587069029
12 changed files with 2670 additions and 68 deletions

View File

@ -1,31 +1,81 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
A role that installs a solr instance, <https://lucene.apache.org/solr/>
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
The most important variables are listed below:
``` yaml
solr_install: True
solr_version: 7.4.0
solr_http_port: 8983
solr_service: -solr
solr_config_name: hindex
solr_shards: 1
solr_instance: '{{ solr_service }}'
solr_custom_log4j: False
solr_rotate_logs_on_start: 'true'
solr_log_dir: /var/log/solr
solr_log_level: ERROR
solr_http_port_1: '{{ solr_http_port }}'
solr_zoo_port: 9983
solr_zoo_port_1: 9984
solr_zoo_port_2: 9985
solr_jmx_port_1: 8601
solr_jmx_enabled: 'false'
solr_user: solr
solr_group: solr
# We need to define this one because we are using the tomcat multiple instances role
solr_base_dir: /opt
solr_server_dir: '{{ solr_base_dir }}/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_pid_dir: '{{ solr_server_dir }}/bin'
solr_heap: 1024M
solr_mode: solrcloud
solr_download_dir: '{{ solr_base_dir }}/download'
solr_zookeeper_data_dir: '{{ solr_data_dir }}/zoo_data'
solr_install_collection1: False
solr_download_url: 'http://www-eu.apache.org/dist/lucene/solr/{{ solr_version }}/solr-{{ solr_version }}.tgz'
solr_jar_files:
- contrib/analysis-extras/lib/icu4*.jar
- contrib/analysis-extras/lucene-libs/lucene-analyzers-icu*.jar
solr_startup_opts: '-Ddisable.configEdit=true'
solr_set_gc_options: False
#solr_gc_tune: '-XX:NewRatio=3 -XX:SurvivorRatio=4'
solr_gc_tune: ''
solr_multicore: False
solr_cores:
- collection1
solr_cloud_mode: True
# When we want to use an external zookeeper cluster, set this one to True
solr_zk_external_cluster: False
solr_zk_hosts: '127.0.0.1:2181'
solr_zk_timeout: 15000
solr_prometheus_exporter: True
solr_prometheus_port: 9983
solr_prometheus_threads: 2
solr_prometheus_bindir: '{{ solr_server_dir }}/contrib/prometheus-exporter/bin'
solr_prometheus_command: 'solr-exporter'
solr_prometheus_command_params: '-p {{ solr_prometheus_port }} -b {{ solr_zk_hosts }} -f {{ solr_prometheus_conf_file }} -n {{ solr_prometheus_threads }}'
solr_prometheus_data_dir: '{{ solr_base_dir }}/solr_prometheus_exporter'
solr_prometheus_conf_dir: '{{ solr_prometheus_data_dir }}/conf'
solr_prometheus_conf_file: '{{ solr_prometheus_conf_dir }}/solr-exporter-config.xml'
```
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
* openjdk
License
-------
@ -35,4 +85,4 @@ EUPL-1.2
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
Andrea Dell'Amico, <andrea.dellamico@isti.cnr.it>

View File

@ -1,2 +1,63 @@
---
# defaults file for ansible-role-template
# solr
solr_install: True
solr_version: 7.4.0
solr_http_port: 8983
solr_service: -solr
solr_config_name: hindex
solr_shards: 1
solr_instance: '{{ solr_service }}'
solr_custom_log4j: False
solr_rotate_logs_on_start: 'true'
solr_log_dir: /var/log/solr
solr_log_level: ERROR
solr_http_port_1: '{{ solr_http_port }}'
solr_zoo_port: 9983
solr_zoo_port_1: 9984
solr_zoo_port_2: 9985
solr_jmx_port_1: 8601
solr_jmx_enabled: 'false'
solr_user: solr
solr_group: solr
# We need to define this one because we are using the tomcat multiple instances role
solr_base_dir: /opt
solr_server_dir: '{{ solr_base_dir }}/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_pid_dir: '{{ solr_server_dir }}/bin'
solr_heap: 1024M
solr_mode: solrcloud
solr_download_dir: '{{ solr_base_dir }}/download'
solr_zookeeper_data_dir: '{{ solr_data_dir }}/zoo_data'
solr_install_collection1: False
solr_download_url: 'http://www-eu.apache.org/dist/lucene/solr/{{ solr_version }}/solr-{{ solr_version }}.tgz'
solr_jar_files:
- contrib/analysis-extras/lib/icu4*.jar
- contrib/analysis-extras/lucene-libs/lucene-analyzers-icu*.jar
solr_startup_opts: '-Ddisable.configEdit=true'
solr_set_gc_options: False
#solr_gc_tune: '-XX:NewRatio=3 -XX:SurvivorRatio=4'
solr_gc_tune: ''
solr_multicore: False
solr_cores:
- collection1
solr_cloud_mode: True
# When we want to use an external zookeeper cluster, set this one to True
solr_zk_external_cluster: False
solr_zk_hosts: '127.0.0.1:2181'
solr_zk_timeout: 15000
solr_prometheus_exporter: True
solr_prometheus_port: 9983
solr_prometheus_threads: 2
solr_prometheus_bindir: '{{ solr_server_dir }}/contrib/prometheus-exporter/bin'
solr_prometheus_command: 'solr-exporter'
solr_prometheus_command_params: '-p {{ solr_prometheus_port }} -b {{ solr_zk_hosts }} -f {{ solr_prometheus_conf_file }} -n {{ solr_prometheus_threads }}'
solr_prometheus_data_dir: '{{ solr_base_dir }}/solr_prometheus_exporter'
solr_prometheus_conf_dir: '{{ solr_prometheus_data_dir }}/conf'
solr_prometheus_conf_file: '{{ solr_prometheus_conf_dir }}/solr-exporter-config.xml'

View File

@ -1,2 +1,6 @@
---
# handlers file for ansible-role-template
- name: solr restart
service: name=solr state=restarted
- name: Restart Solr prometheus exporter
service: name=solr_prometheus_exporter state=restarted enabled=yes

View File

@ -1,61 +1,29 @@
galaxy_info:
author: your name
description: your description
author: Andrea Dell'Amico
description: Systems Architect
company: ISTI-CNR
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
issue_tracker_url: https://redmine-s2i2s.isti.cnr.it/projects/provisioning
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: EUPL-1.2
license: EUPL 1.2+
min_ansible_version: 2.8
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
platforms:
- name: Ubuntu
versions:
- bionic
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
galaxy_tags:
- solr
- lucene
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
dependencies:
- src: git+https://gitea-s2i2s.isti.cnr.it/ISTI-ansible-roles/ansible-role-openjdk.git
version: master
name: openjdk
state: latest

View File

@ -1,2 +1,93 @@
---
# tasks file for ansible-role-template
- block:
- name: Create a solr user
user: name={{ solr_user }} home={{ solr_base_dir }} createhome=yes shell=/bin/bash
- name: Create the downloads directory
file: dest={{ solr_download_dir }} state=directory
- name: Download solr
get_url: url='{{ solr_download_url }}' dest={{ solr_download_dir }}/solr-{{ solr_version }}.tgz validate_certs=no
- name: Unarchive solr release
unarchive: src={{ solr_download_dir }}/solr-{{ solr_version }}.tgz dest={{ solr_base_dir }} copy=no
args:
creates: '{{ solr_base_dir }}/bin/solr'
- name: Link to the latest release
file: src={{ solr_base_dir }}/solr-{{ solr_version }} dest={{ solr_server_dir }} state=link
- name: Create the solr service, download, data and logs directories
file: path={{ item }} state=directory owner={{ solr_user }} group={{ solr_user }}
with_items:
- '{{ solr_download_dir }}'
- '{{ solr_data_dir }}'
- '{{ solr_pid_dir }}'
- '{{ solr_log_dir }}'
- name: Fix the permissions of the solr server directory
file: dest={{ solr_data_dir }} state=directory owner={{ solr_user }} group={{ solr_user }} recurse=yes
- name: Create the solr lib 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
template: src={{ item }}.j2 dest={{ solr_data_dir }}/{{ item }}
with_items:
- solr.xml
- zoo.cfg
notify: solr restart
tags: [ 'solr', 'solr_default', 'solr_conf' ]
- name: copy extra libraries
shell: cd {{ solr_server_dir }}; cp -u {{ item }} {{ solr_data_dir }}/lib
with_items: '{{ solr_jar_files }}'
- name: install the solr init script
template: src=solr dest=/etc/init.d/solr mode=0755 owner=root group=root
- name: Install the solr default
template: src=solr-default.j2 dest=/etc/default/solr.in.sh mode=0644 owner=root group=root
notify: solr restart
tags: [ 'solr', 'solr_default', 'solr_conf' ]
- name: Start and enable the solr service
service: name=solr state=started enabled=yes
ignore_errors: True
become: True
become_user: root
when: solr_install
tags: solr
- block:
- name: Create the Solr prometheus exporter conf directory
file: dest={{ solr_prometheus_conf_dir }} state=directory mode=0755
- name: Install the Solr prometheus exporter config file
template: src=solr-exporter-config.xml dest={{ solr_prometheus_conf_file }} mode=0644
notify: Restart Solr prometheus exporter
tags: [ 'solr', 'solr_prometheus', 'solr_prometheus_exporter', 'solr_prometheus_exporter_config' ]
- name: Install the Solr prometheus exporter upstart script
template: src=solr_prometheus_exporter.upstart.j2 dest=/etc/init/solr_prometheus_exporter.conf mode=0644 owner=root group=root
when: ansible_service_mgr != 'systemd'
- name: Install the Solr prometheus exporter systemd unit
template: src=solr_prometheus_exporter.systemd.j2 dest=/etc/systemd/system/solr_prometheus_exporter.service mode=0644 owner=root group=root
when: ansible_service_mgr == 'systemd'
notify: systemd reload
- name: Ensure that Solr prometheus exporter is started and enabled
service: name=solr_prometheus_exporter state=started enabled=yes
become: True
become_user: root
when:
- solr_install
- solr_prometheus_exporter
tags: [ 'solr', 'solr_prometheus', 'solr_prometheus_exporter' ]

78
templates/solr Executable file
View File

@ -0,0 +1,78 @@
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
### BEGIN INIT INFO
# Provides: solr
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Controls Apache Solr as a Service
### END INIT INFO
# Example of a very simple *nix init script that delegates commands to the bin/solr script
# Typical usage is to do:
#
# cp bin/init.d/solr /etc/init.d/solr
# chmod 755 /etc/init.d/solr
# chown root:root /etc/init.d/solr
# update-rc.d solr defaults
# update-rc.d solr enable
# Where you extracted the Solr distribution bundle
SOLR_INSTALL_DIR="{{ solr_server_dir }}"
if [ ! -d "$SOLR_INSTALL_DIR" ]; then
echo "$SOLR_INSTALL_DIR not found! Please check the SOLR_INSTALL_DIR setting in your $0 script."
exit 1
fi
# Path to an include file that defines environment specific settings to override default
# variables used by the bin/solr script. It's highly recommended to define this script so
# that you can keep the Solr binary files separated from live files (pid, logs, index data, etc)
# see bin/solr.in.sh for an example
SOLR_ENV="/etc/default/solr.in.sh"
if [ ! -f "$SOLR_ENV" ]; then
echo "$SOLR_ENV not found! Please check the SOLR_ENV setting in your $0 script."
exit 1
fi
# Specify the user to run Solr as; if not set, then Solr will run as root.
# Running Solr as root is not recommended for production environments
RUNAS="solr"
# verify the specified run as user exists
runas_uid="`id -u "$RUNAS"`"
if [ $? -ne 0 ]; then
echo "User $RUNAS not found! Please create the $RUNAS user before running this script."
exit 1
fi
case "$1" in
start|stop|restart|status)
SOLR_CMD="$1"
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit
esac
if [ -n "$RUNAS" ]; then
su -c "SOLR_INCLUDE=\"$SOLR_ENV\" \"$SOLR_INSTALL_DIR/bin/solr\" $SOLR_CMD" - "$RUNAS"
else
SOLR_INCLUDE="$SOLR_ENV" "$SOLR_INSTALL_DIR/bin/solr" "$SOLR_CMD"
fi

159
templates/solr-default.j2 Normal file
View File

@ -0,0 +1,159 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
SOLR_INSTALL_DIR="{{ solr_data_dir }}"
# 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.
#SOLR_JAVA_HOME=""
# This controls the number of seconds that the solr script will wait for
# Solr to stop gracefully or Solr to start. If the graceful stop fails,
# the script will forcibly stop Solr. If the start fails, the script will
# give up waiting and display the last few lines of the logfile.
#SOLR_STOP_WAIT="180"
# Increase Java Heap as needed to support your indexing / query needs
SOLR_HEAP="{{ solr_heap }}"
# Expert: If you want finer control over memory options, specify them directly
# Comment out SOLR_HEAP if you are using this though, that takes precedence
#SOLR_JAVA_MEM="-Xms512m -Xmx512m"
# Enable verbose GC logging...
# * If this is unset, various default options will be selected depending on which JVM version is in use
# * For java8 or lower: if this is set, additional params will be added to specify the log file & rotation
# * For java9 or higher: each included opt param that starts with '-Xlog:gc', but does not include an output
# specifier, will have a 'file' output specifier (as well as formatting & rollover options) appended,
# using the effective value of the SOLR_LOGS_DIR.
#
#GC_LOG_OPTS='-Xlog:gc*' # (java9)
#GC_LOG_OPTS="-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails \
# -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime"
{% if solr_set_gc_options %}
GC_LOG_OPTS="-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails \
-XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime"
{% endif %}
# These GC settings have shown to work well for a number of common Solr workloads
GC_TUNE="{{ solr_gc_tune }}"
# 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 solr_zk_external_cluster %}
ZK_HOST="{{ solr_zk_hosts }}"
{% endif %}
# Set the ZooKeeper client timeout (for SolrCloud mode)
ZK_CLIENT_TIMEOUT="{{ solr_zk_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="192.168.1.1"
# By default the start script uses UTC; override the timezone if needed
#SOLR_TIMEZONE="UTC"
# 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
# (false is recommended in production environments)
ENABLE_REMOTE_JMX_OPTS="{{ solr_jmx_enabled }}"
# The script will use SOLR_PORT+10000 for the RMI_PORT or you can set it here
RMI_PORT={{ solr_jmx_port_1 }}
# SOLR additional options
SOLR_OPTS="$SOLR_OPTS {{ solr_startup_opts }}"
# Set the thread stack size
SOLR_OPTS="$SOLR_OPTS -Xss256k"
{% if not solr_zk_external_cluster %}
export SOLR_MODE={{ solr_mode }}
{% endif %}
# 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. Examples:
#SOLR_OPTS="$SOLR_OPTS -Dsolr.autoSoftCommit.maxTime=3000"
#SOLR_OPTS="$SOLR_OPTS -Dsolr.autoCommit.maxTime=60000"
#SOLR_OPTS="$SOLR_OPTS -Dsolr.clustering.enabled=true"
# 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={{ solr_pid_dir }}
# Path to a directory for Solr to store cores and their data. By default, Solr will use server/solr
# If solr.xml is not stored in ZooKeeper, this directory needs to contain solr.xml
SOLR_HOME={{ solr_data_dir }}
{% if solr_custom_log4j %}
# Solr provides a default Log4J configuration properties file in server/resources
# 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
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
# This is an alternative to changing the rootLogger in log4j.properties
SOLR_LOG_LEVEL={{ solr_log_level }}
# Location where Solr should write logs to; should agree with the file appender
# settings in server/resources/log4j.properties
SOLR_LOGS_DIR={{ solr_log_dir }}
# 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.
# This pre-startup rotation may need to be disabled depending how much you customize the default logging setup.
SOLR_LOG_PRESTART_ROTATION={{ solr_rotate_logs_on_start }}
# Sets the port Solr binds to, default is 8983
SOLR_PORT={{ solr_http_port }}
# Uncomment to set SSL-related system properties
# Be sure to update the paths to the correct keystore for your environment
#SOLR_SSL_KEY_STORE=/home/shalin/work/oss/shalin-lusolr/solr/server/etc/solr-ssl.keystore.jks
#SOLR_SSL_KEY_STORE_PASSWORD=secret
#SOLR_SSL_KEY_STORE_TYPE=JKS
#SOLR_SSL_TRUST_STORE=/home/shalin/work/oss/shalin-lusolr/solr/server/etc/solr-ssl.keystore.jks
#SOLR_SSL_TRUST_STORE_PASSWORD=secret
#SOLR_SSL_TRUST_STORE_TYPE=JKS
#SOLR_SSL_NEED_CLIENT_AUTH=false
#SOLR_SSL_WANT_CLIENT_AUTH=false
# Uncomment if you want to override previously defined SSL values for HTTP client
# otherwise keep them commented and the above values will automatically be set for HTTP clients
#SOLR_SSL_CLIENT_KEY_STORE=
#SOLR_SSL_CLIENT_KEY_STORE_PASSWORD=
#SOLR_SSL_CLIENT_KEY_STORE_TYPE=
#SOLR_SSL_CLIENT_TRUST_STORE=
#SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD=
#SOLR_SSL_CLIENT_TRUST_STORE_TYPE=
# Settings for authentication
# Please configure only one of SOLR_AUTHENTICATION_CLIENT_CONFIGURER or SOLR_AUTH_TYPE parameters
#SOLR_AUTHENTICATION_CLIENT_CONFIGURER="org.apache.solr.client.solrj.impl.PreemptiveBasicAuthConfigurer"
#SOLR_AUTH_TYPE="basic"
#SOLR_AUTHENTICATION_OPTS="-Dbasicauth=solr:SolrRocks"
# Settings for ZK ACL
#SOLR_ZK_CREDS_AND_ACLS="-DzkACLProvider=org.apache.solr.common.cloud.VMParamsAllAndReadonlyDigestZkACLProvider \
# -DzkCredentialsProvider=org.apache.solr.common.cloud.VMParamsSingleSetCredentialsDigestZkCredentialsProvider \
# -DzkDigestUsername=admin-user -DzkDigestPassword=CHANGEME-ADMIN-PASSWORD \
# -DzkDigestReadonlyUsername=readonly-user -DzkDigestReadonlyPassword=CHANGEME-READONLY-PASSWORD"
#SOLR_OPTS="$SOLR_OPTS $SOLR_ZK_CREDS_AND_ACLS"

File diff suppressed because it is too large Load Diff

62
templates/solr.xml.j2 Normal file
View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
This is an example of a simple "solr.xml" file for configuring one or
more Solr Cores, as well as allowing Cores to be added, removed, and
reloaded via HTTP requests.
More information about options available in this configuration file,
and Solr Core administration can be found online:
http://wiki.apache.org/solr/CoreAdmin
-->
<solr>
<solrcloud>
{% if not solr_multicore %}
<str name="host">{{ ansible_fqdn }}</str>
<int name="hostPort">{{ solr_http_port_1 }}</int>
<str name="hostContext">${hostContext:solr}</str>
<int name="zkClientTimeout">{{ solr_zk_timeout }}</int>
<bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool>
{% if solr_zk_external_cluster %}
<str name="zkHost">{{ solr_zk_hosts }}</str>
{% endif %}
{% endif %}
</solrcloud>
<shardHandlerFactory name="shardHandlerFactory" class="HttpShardHandlerFactory">
<int name="socketTimeout">${socketTimeout:0}</int>
<int name="connTimeout">${connTimeout:0}</int>
</shardHandlerFactory>
{% if solr_multicore %}
<cores adminPath="/admin/cores">
{% for core in solr_cores %}
<core name="{{ core }}" instanceDir="{{ core }}">
<property name="dataDir" value="{{ solr_collections_base_dir }}/{{ core }}" />
</core>
{% endfor %}
</cores>
{% endif %}
</solr>

View File

@ -0,0 +1,11 @@
[Unit]
Description=solr_prometheus_exporter - Prometheus exporter for Solr metrics.
After=network.target
[Service]
Type=simple
User={{ solr_user }}
Group={{ solr_group }}
ExecStart={{ solr_prometheus_bindir }}/{{ solr_prometheus_command }} {{ solr_prometheus_command_params }}
Restart=on-failure

View File

@ -0,0 +1,12 @@
description "Solr exporter for Prometheus"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [016]
respawn
respawn limit 10 5
setuid {{ solr_user }}
setgid {{ solr_group }}
script
exec {{ solr_prometheus_bindir }}/{{ solr_prometheus_command }} {{ solr_prometheus_command_params }}
end script

17
templates/zoo.cfg.j2 Normal file
View File

@ -0,0 +1,17 @@
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
dataDir={{ solr_zookeeper_data_dir }}
# NOTE: Solr defaults the dataDir to <solrHome>/zoo_data
# the port at which the clients will connect
clientPort={{ solr_zoo_port }}
# NOTE: Solr sets this based on zkRun / zkHost params