Elasticsearch 1.2.2 is installed on the default port 9200 and doesn’t require any credentials. However, it is not running by default. To use Elasticsearch during your builds, start the service via the following command:
sudo /etc/init.d/elasticsearch start
Note, this is one of the only commands available via
sudo and root access to run any other commands is not available on the build VMs.
If you need to install a later version or use a custom configuration, please take a look at this script.
For example if you wanted to install 5.2.0 you would set the desired version as an environment variable in your project.
Next, make sure the following commands are added to your Setup Commands as Elasticsearch 5.x requires them.
jdk_switcher home oraclejdk8 jdk_switcher use oraclejdk8
Finally add this command to your Setup Commands and the script will automatically be called at build time. Note, this script will automatically start the Elasticsearch service, so you do not need to call the sudo command mentioned above.