OBSOLETE Project
On August 25th, 2017 users were informed of the subsequent sunset of OpenShift Online v2 platform by September 30th, 2017 (extended to December 31st, 2017 for paying customers). The next generation v3 platform replaces Cartridges with Images, therefore, making this quick Elasticsearch set-up solution now, unfortunately obsolete. Comments on the "sunset" blog post records some of the incredulity expressed by users on the decision.
This project is kept for archival purposes and any possible benefit it may still provide.
OpenShift Elasticsearch 5.3.2 Cartridge
Downloadable Elasticsearch 5.3.2 cartridge for OpenShift.
To create your scalable Elasticsearch app, run:
rhc app create <your app name> http://cartreflect-claytondev.rhcloud.com/github/AhmadFCheema/openshift-elasticsearch-cartridge -s
NOTE: Your app currently must be a scalable app or this cartridge will not run.
Adding additional cluster nodes
To add more nodes to the cluster, simply add more gears:
rhc cartridge scale -a <your app name> elasticsearch <number of total gears you want>
Plugins
To install Elasticsearch plugins:
- SSH into your OpenShift application
- Run commands:
export JAVA_HOME=/etc/alternatives/java_sdk_1.8.0; export PATH=$JAVA_HOME/bin:$PATH
elasticsearch/usr/bin/elasticsearch-plugin install <plugin_name>
- The first command directs to the correct Java version (i.e. Java 8).
- The second command installs the plugin. Plugin names can be found from here. For example:
elasticsearch/usr/bin/elasticsearch-plugin install analysis-icu
.
OR
- Clone OpenShift application's git repository (
git clone <OpenShift app SSH URL>
) - Edit the
plugins.txt
file - Commit (
git commit -am "new plugin"
) - Push your changes to OpenShift (
git push
) - The current setup first removes all previously installed plugins and then installs the ones declared in
plugins.txt
.
Testing
- The above steps have been tested in OpenShift Online (v2).
- Adding additional cluster nodes was not tried.
- Tested on MediaWiki 1.29.0 (0e6e155) using Elasticsearch implementation on MediaWiki through CirrusSearch (0.2) and Elastica (1.3.0.0 ) extensions.
Development
- Development work on this cartridge is detailed at Elasticsearch 5.3.2 Cartridge (Dev notes).