Link Search Menu Expand Document Documentation Menu

Configuring Lucenia

There are two types of Lucenia settings: dynamic and static.

Dynamic settings

Dynamic index settings are settings that you can update at any time. You can configure dynamic Lucenia settings through the Cluster Settings API. For details, see Update cluster settings using the API.

Whenever possible, use the Cluster Settings API; lucenia.yml is local to each node, whereas the API applies the setting to all nodes in the cluster.

Static settings

Certain operations are static and require you to modify the lucenia.yml configuration file and restart the cluster. In general, these settings relate to networking, cluster formation, and the local file system. To learn more, see Cluster formation.

License settings

To learn more about license settings, see License Settings.

Specifying settings as environment variables

You can specify environment variables as arguments using -E when launching Lucenia:

./lucenia -Ecluster.name=lucenia-cluster -Enode.name=lucenia-node1 -Ehttp.host=0.0.0.0 -Ediscovery.type=single-node

Updating cluster settings using the API

The first step in changing a setting is to view the current settings by sending the following request:

GET _cluster/settings?include_defaults=true

For a more concise summary of non-default settings, send the following request:

GET _cluster/settings

Three categories of setting exist in the cluster settings API: persistent, transient, and default. Persistent settings, well, persist after a cluster restart. After a restart, Lucenia clears transient settings.

If you specify the same setting in multiple places, Lucenia uses the following precedence:

  1. Transient settings
  2. Persistent settings
  3. Settings from lucenia.yml
  4. Default settings

To change a setting, use the Cluster Settings API and specify the new value as either persistent or transient. This example shows the flat settings form:

PUT _cluster/settings
{
  "persistent" : {
    "action.auto_create_index" : false
  }
}

You can also use the expanded form, which lets you copy and paste from the GET response and change existing values:

PUT _cluster/settings
{
  "persistent": {
    "action": {
      "auto_create_index": false
    }
  }
}


Configuration file

You can find lucenia.yml in /usr/share/lucenia/config/lucenia.yml (Docker) or /etc/lucenia/lucenia.yml (most Linux distributions) on each node.

You can edit the LUCENIA_PATH_CONF=/etc/lucenia to change the config directory location. This variable is sourced from /etc/default/lucenia(Debian package) and /etc/sysconfig/lucenia(RPM package).

If you set your customized LUCENIA_PATH_CONF variable, be aware that other default environment variables will not be loaded.

You don’t mark settings in lucenia.yml as persistent or transient, and settings use the flat form:

cluster.name: my-application
action.auto_create_index: true
compatibility.override_main_response_version: true

The demo configuration includes a number of settings for the Security implementation that you should modify before using Lucenia for a production workload. To learn more, see Security.

(Optional) CORS header configuration

If you are working on a client application running against an Lucenia cluster on a different domain, you can configure headers in lucenia.yml to allow for developing a local application on the same machine. Use Cross Origin Resource Sharing so that your application can make calls to the Lucenia API running locally. Add the following lines in your custom-lucenia.yml file (note that the “-“ must be the first character in each line).

- http.host:0.0.0.0
- http.port:9200
- http.cors.allow-origin:"http://localhost"
- http.cors.enabled:true
- http.cors.allow-headers:X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization
- http.cors.allow-credentials:true

Related articles