Git Product home page Git Product logo

ansible-role-solr's Introduction

Ansible Role: Apache Solr

CI

Installs Apache Solr on Linux servers.

Requirements

Java must be available on the server. You can easily install Java using the geerlingguy.java role. Make sure the Java version installed meets the minimum requirements of Solr (e.g. Java 8 for Solr 6+).

This role is currently tested and working with Solr 3.x, 4.x, 5.x, 6.x, 7.x, and 8.x.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

solr_workspace: /root

Files will be downloaded to this path on the remote server before being moved into place.

solr_create_user: true
solr_user: solr
solr_group: "{{ solr_user }}"

Solr will be run under the solr_user. Set solr_create_user to false if solr_user is created before this role runs, or if you're using Solr 5+ and want Solr's own installation script to set up the user. By default, solr_group equals solr_user, but it can be overwritten to fit your own configuration.

solr_version: "8.11.2"

The Apache Solr version to install. For a full list, see available Apache Solr versions.

solr_mirror: "https://archive.apache.org/dist"

The Apache Project mirror from which the Solr tarball will be downloaded. In case of slow download speed or timeouts it is useful to set the mirror to the one suggested by Apache's mirror download site.

solr_remove_cruft: false

Whether to remove unneccessary documentation and examples from the solr directory.

solr_service_manage: true
solr_service_name: solr
solr_service_state: started

By default, this role will manage the solr service, ensuring it is enabled at system boot and is running. You can ensure Solr is stopped by setting solr_service_state: stopped, or you can disable this role's management of the solr service entirely by setting solr_service_manage: false. You may also want to set solr_restart_handler_enabled: false (documented later) in this case.

solr_install_dir: /opt
solr_install_path: /opt/solr

The path where Apache Solr will be installed. For Solr 5+, the solr_install_dir will be used by Solr's installation script. For Solr < 5, the Solr installation files will be copied in place in the solr_install_path.

solr_home: /var/solr

The path where local Solr data (search collections and configuration) will be stored. Should typically be outside of the solr_path, to make Solr upgrades easier.

solr_port: "8983"

The port on which Solr will run.

solr_xms: "256M"
solr_xmx: "512M"

Memory settings for the JVM. These should be set as high as you can allow for best performance and to reduce the chance of Solr restarting itself due to OOM situations.

solr_timezone: "UTC"

Default timezone of JVM running solr. You can override this if needed when using dataimport and delta imports (ex: comparing against a MySQL external data source). Read through Apache Solr's Working with Dates documentation for more background.

solr_opts: "$SOLR_OPTS -Dlog4j2.formatMsgNoLookups=true"

Solr options. This option was added to the role in part to mitigate CVE-2021-44228.

solr_cores:
  - collection1

A list of cores / collections which should exist on the server. Each one will be created (if it doesn't exist already) using the default example configuration that ships with Solr. Note that this variable only applies when using Solr 5+.

solr_connect_host: localhost

The hostname or IP address on which Solr will be reachable. localhost should work in most circumstances, but there are special cases where you may only be able to access the local Solr instance via another IP or hostname.

solr_restart_handler_enabled: true

Whether the restart solr handler should be used or not. If you're building containers or AMIs, you might need to disable the restart handler for a provisioning run.

Variables used only for Solr < 5.

The following variables are currently only applied to installations of Solr 4 and below:

solr_log_file_path: /var/log/solr.log

Path where Solr log file will be created.

solr_host: "0.0.0.0"

The hostname or IP address to which Solr will bind. Defaults to 0.0.0.0 which allows Solr to listen on all interfaces.

Dependencies

None.

Example Playbook

- hosts: solr-servers
  roles:
    - geerlingguy.java
    - geerlingguy.solr

License

MIT / BSD

Author Information

This role was created in 2014 by Jeff Geerling, author of Ansible for DevOps.

ansible-role-solr's People

Contributors

geerlingguy avatar gadelkareem avatar longwave avatar jonathonwalz avatar fredleger avatar saily avatar baschny avatar nemeth avatar ixai avatar mhitza avatar mroest avatar diadzine avatar allardhoeve avatar dale-c-anderson avatar gremid avatar gdelafond avatar sermo-de-arboribus avatar kekkis avatar raistlin avatar timohund avatar dkd-schmidt avatar lopf avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.