Deploying the Elasticsearch Plugin for Cassandra
UCS 9.1 uses Elasticsearch—an open-source, full-text search engine—to provide full-text search functionality as well as flexible queries on UCS data. UCS comes with a plugin that integrates into Cassandra and replicates all the data to Elasticsearch.
Deploying Elasticsearch plugin for Cassandra
The Elasticsearch version must be 5.5 or 6.2 only—other versions are not supported.
Do the following to deploy Cassandra:
- Install the Elasticsearch plugin for Cassandra by copying the content of the lib4cassandra folder from the UCS installation folder to the lib folder of Cassandra.
- In the UCS that will create the schema add the following options in the [elasticsearch] section:
Elasticsearch IP Addresses
In the case of a multi-data-center deployment, it is very important that the Elasticsearch nodes from one site cannot reach the nodes from the other site(s). The data replication performed by Cassandra is more efficient than Elasticsearch. The multi-cast address 18.104.22.168 and port 54328 should be blocked between the sites. Also, it is very important that each host name—host1, host2—should be the same in each data center but should point to the IP addresses of the Elasticsearch nodes local to this data center.
For example with:
In data-center us-west eshost1=192.168.0.11, eshost2=192.168.0.12, eshost3=192.168.0.13
In data-center us-east eshost1=192.168.1.11, eshost2=192.168.1.12, eshost3=192.168.1.13
it is safer to use non-routable IP addresses for Elasticsearch nodes.
Providing the Cassandra index with Elasticsearch credentials
To provide the Cassandra index for Elasticsearch with credentials, each node must have the environment variable ESCREDENTIALS correctly set before starting. This must be set on all Cassandra hosts, but is not needed on UCS hosts.
The example below provides the password for the user elastic and password examplepassword separated by a : (colon) character. It can be done either directly in the system as an environment variable or in the shortcut that launches Cassandra.
ESCREDENTIALS = elastic:examplepassword
Once the index is successfully initialized, it will write the message Elasticsearch credentials provided in Cassandra logs at the INFO level. Once this message is output, it is possible to clear the environment variable. If Cassandra is restarted the environment variable must be set again before starting. The credentials are kept in memory only and are not saved anywhere else. If the user and/or password is changed, all Cassandra nodes must be restarted with the updated environment variable value.
Configure UCS to use the secured port
In the UCS options, set the following:
elasticsearch/unicast-hosts = https://<host1>:9200,...,https://<hostN>:9200
It is currently not possible to migrate an existing index from HTTP to HTTPS—usage of one or other must be decided before UCS creates the Cassandra schema. In order to ease HTTPS deployment, the index will automatically trust all HTTPS certificates.