Skip to main content
Skip table of contents

Install with Ansible

You can easily install Indexima on a cluster of machines with our official Ansible Role.

Prerequisites

In order to use Ansible, you will need a few things.

For the sake of this guide, let's assume your infrastructure is as follow:

  1. Ansible machine
  2. Indexima primary master
  3. Indexima secondary master 1
  4. Indexima secondary master 2

The Ansible machine needs to have access to all 3 Indexima nodes on port 22.

Ideally, it also needs to have access to ports 8082, 9999, 10000 to do a connectivity check at the end of the installation.

On the Indexima machines, the ansible user you will use to connect to SSH will need to have sudo privileges and be able to become root.

Install Ansible on the "Ansible Machine"

You can use your local machine or any Linux VM on which you have sudo access.

You can install Ansible following the official instructions here: https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html

In order to easily perform all the following operations, it is recommended that the Ansible Machine has internet access to the following sites:

Clone Indexima role

Start by cloning the Indexima Ansible role

BASH
git clone https://github.com/indexima-dev/ansible-indexima-install.git
cd ansible-indexima-install

Prepare the playbook

Hosts file

In order to use Ansible, you need to provide a hosts file, in the .ini format.

You can find an example of a hosts file in the examples folder. Copy it to the root directory

BASH
cp examples/hosts.local ./hosts

Then you need to create your machine groups.

Below the "[indexima]" line, there is a line that looks like: node1 ansible_host=localhost is_master=1

Delete it, and write three more lines like this:

hosts

TEXT
node1 ansible_host=<primary_master_ip> is_master=1
node2 ansible_host=<secondary_master_1_ip> is_master=0
node3 ansible_host=<secondary_master_2_ip> is_master=0

Then there are a few variables that you need to customize to make it work

Variable nameDescriptionExample
ansible_userThe UNIX user of the Indexima machine to connect to SSH toIf you are hosting Indexima on an Amazon Linux machine, ansible_user=ec2-user
ansible_ssh_private_key_filePath to the private key used to connect to the Indexima machinesansible_ssh_private_key_file=~/.ssh/mykey.pem
ansible_connection

Define whether or not Ansible uses SSH to connect to the machine.

Set to local if you want to install on the same machine as the Ansible node

In our example, comment this line
service_user

After connecting with the ansible_user, the Indexima install role will become a service user
in order to do all actions. By default, service_user is root.

The ansible_user will need to have sudo privilege in order to become root or any other service
user

If you are hosting Indexima on an Amazon Linux machine, service_user=ec2-user

This will install Indexima as the same user as the ansible_user

nodesThe number of Indexima nodes in your clusternodes=3
versionThe Indexima version you want to install

version=1.7.12.1257.0

Playbook

You can then write your playbook.

You can find an example in the tests folder

BASH
cp tests/test.yml ./indexima.yml

Execute the playbook

Full install

To do a full install, execute this command

BASH
ansible-playbook -i hosts indexima.yml

Partial execution

To execute only a small part of the playbook, you can use tags.

Here are the most useful ones:

Tag nameDescriptionCommand example
prerequisitesInstall only the Indexima prerequisites: Java8, Hadoop libs, and setting env variables and ulimitansible-playbook -i hosts indexima.yml -t 'prerequisites'
installInstall the prerequisites and Indexima, without deploying the configurationansible-playbook -i hosts indexima.yml -t 'install'
updateInstall Indexima only, without the prerequisites, without deploying the configurationansible-playbook -i hosts indexima.yml -t 'update'
confDeploy the configuration to all Indexima nodesansible-playbook -i hosts indexima.yml -t 'conf'
startStart Indeximaansible-playbook -i hosts indexima.yml -t 'start'
stopStop Indeximaansible-playbook -i hosts indexima.yml -t 'stop'
restartCompletely stop Indexima, Indexima web UI, and then restart it allansible-playbook -i hosts indexima.yml -t 'irestart'

You can also combine tags. For example, if you want to redeploy the configuration and restart the cluster, you can do so with the command:

BASH
ansible-playbook -i hosts indexima.yml -t 'conf,restart'
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.