Skip to main content

Managed Service Solr

Apache Solr is an open source search server based on Java.

We offer you the possibility to let us run Apache Solr as a managed service. Nine is responsible for configuration, patching and monitoring of the service, while you can create Solr cores yourself, fill them with data and use them within your applications. The official documentation for Solr can be found here: https://solr.apache.org/guide/solr/latest/

IP/Port

By default, Solr is accessible on port 8983. The service is bound to the localhost by default, so it cannot be accessed externally. If you use a separate server for Solr, we can adjust the configuration accordingly so that the service can be accessed from your web server, for example.

If further external access is required (e.g. to tTo increase the security of the service, Solr can be operated with user authentication. In this case, authentication with username and password must be performed for each API request. This also applies to other applications that want to connect to Solr.

Authentication

To increase the security of the service, Solr can be operated with user authentication. In this case, authentication with username and password must be performed for each API request. This also applies to other applications that want to connect to Solr.

When operating with user authentication, we will provide you with a user account. In this case you will find the authentication data in your user directory (usually /home/www-data) in the file .solr_client_credentials:

www-data@host:~ $ cat .solr_client_credentials
httpBasicAuthUser=client
httpBasicAuthPassword=LRaXifKBn3LNfT3g

Cores Management

By default, we configure a default core based on the default configset provided with Solr. However, this is only intended for test operation. For production operation, a separate core should be created.

Since Solr runs under a separate system user solr and the cores must be created in the /var/lib/solr/$VERSION directory, you cannot use the script provided by Solr to create cores because of the permissions on the server. Instead, we provide the nine-manage-solr script for managing Solr cores.

nine-manage-solr

Solr provides a script to create and delete cores. Other actions like a backup or restore of a core can be triggered via API. However, direct use of Solr's own script is not possible due to system permissions of your user.

Instead, with nine-manage-solr, Nine provides all the necessary functions for managing Solr cores.

The script must be called by you via sudo. With the --help option you can display the available commands:

Usage:
-------
nine-manage-solr core list - List cores
nine-manage-solr core details <corename> - Show details of a given core
nine-manage-solr core create <corename> [--configdir=<dir>] - Create a new core
nine-manage-solr core delete <corename> - Delete a core
nine-manage-solr backup list - List all core backups
nine-manage-solr backup create <corename> [--backupdir=<dir>] - Backup a core
nine-manage-solr backup status <corename> - Status of last backup
nine-manage-solr backup restore <corename> [--backupdir=<dir>] - Restore a core
nine-manage-solr backup restore status <corename> - Show restore status
nine-manage-solr backup delete <corename> <backup> - Delete a core
nine-manage-solr -h | --help - Show this help


Parameters:
-----------
-d / --configdir Specify core config directory. Only available for create option.
(default: $SOLR_INSTALL_DIR/server/solr/configsets/_default)
-d / --backupdir Specify custom backup directory to create and restore core backups from.
(default: /var/lib/solr/9.0.0/<corname>/data/)

Create Core

You can create a Solr Core using

sudo nine-manage-solr core create <corename>

The core is created in $SOLR_HOME, for Solr 9 for example under /var/lib/solr/9.0.0. This uses a default configuration (default configset), which is not recommended for production use.

Usually you will therefore want to use your own configuration, which you can copy to your home folder and pass to the script with the --configdir parameter:

sudo nine-manage-solr core create <corename> --configdir ./configdirectory

How a configset must be structured can be found in the Solr documentation.

List Cores

You can list the available cores with the list command:

sudo nine-manage-solr core list

Delete Core

You can remove an existing Solr Core with the delete command:

sudo nine-manage-solr core delete <corename>

Create and Restore Backups

With the backup create command you can create a consistent backup of a running core:

sudo nine-manage-solr backup create <corename>

The backup is created in the /data folder of the corresponding core.

Optionally, --backupdir can be used to make a backup to a specific directory.

With the backup status command you can display the creation time as well as the status of a backup for a core:

sudo nine-manage-solr backup status <corename>

The output contains, among other things, the name of the last backup and the creation time.

With the backup restore command you can restore a core from a backup:

sudo nine-manage-solr backup restore <corename>

The last created backup of the core is always restored. In a future iteration of the integration it will be possible to select the backup to be restored.