Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Elasticsearch Setup

Sumedh Anantrao Kulkarni edited this page Sep 8, 2021 · 8 revisions

Note: Follow below steps on all 3 nodes.


Pre-Requisites:

  1. Install Elastic-Search rpms

    wget https://github.com/Seagate/cortx/releases/download/third-party-deps-1.0.0-0/third-party-centos-7.9.2009-1.0.0-0.tar.gz
    tar -xvf third-party-centos-7.9.2009-1.0.0-0.tar.gz
    cd centos-7.9.2009-2.0.0-latest/commons/elasticsearch/
    yum install -y *.rpm java-1.8.0-openjdk-headless
  2. Install cortx-utils rpm

    Follow installation steps till installation of cortx-py-utils from utils-build-guide

  3. Add private-ip and node-name of all nodes in /etc/hosts file.

    For single node setup

    192.168.95.231  srvnode-1
    

    For 3 node setup

    192.168.95.231  srvnode-1
    192.168.95.232  srvnode-2
    192.168.95.233  srvnode-3
    

Mini Provisioning

Post Install:

Run this cmd individually on all 3 nodes.

/opt/seagate/cortx/utils/bin/elasticsearch_setup post_install --config yaml:///opt/seagate/cortx/utils/conf/elasticsearch/elasticsearch.post_install.tmpl

Prepare:

Run this cmd individually on all 3 nodes.

/opt/seagate/cortx/utils/bin/elasticsearch_setup prepare --config yaml:///opt/seagate/cortx/utils/conf/elasticsearch/elasticsearch.prepare.tmpl

Config:

For single node.

a. Edit /opt/seagate/cortx/utils/conf/elasticsearch/elasticsearch.config.tmpl.1-node template file.

b. /opt/seagate/cortx/utils/bin/elasticsearch_setup config --config yaml:///opt/seagate/cortx/utils/conf/elasticsearch/elasticsearch.config.tmpl.1-node

Sample template file for single node.

server_node:
  30512e5ae6df9f1ea02327bab45e499d:
    cluster_id: 7f5441ae-6e30-4883-9efd-90e8773f15d0
    name: srvnode-1
cluster:
  7f5441ae-6e30-4883-9efd-90e8773f15d0:
    storage_set:
    - server_nodes: ["30512e5ae6df9f1ea02327bab45e499d"]

For 3 node setup.

a. Edit /opt/seagate/cortx/utils/conf/elasticsearch/elasticsearch.config.tmpl.3-node template file.

b. /opt/seagate/cortx/utils/bin/elasticsearch_setup config --config yaml:///opt/seagate/cortx/utils/conf/elasticsearch/elasticsearch.config.tmpl.3-node

Sample file for 3 node:

server_node:
  30512e5ae6df9f1ea02327bab45e499d:
    cluster_id: 7f5441ae-6e30-4883-9efd-90e8773f15d0
    name: srvnode-1
  8d00f71d6e0eeef02e971e6356bb83aa:
    cluster_id: 7f5441ae-6e30-4883-9efd-90e8773f15d0
    name: srvnode-2
  0b6dc7068f454d84942b4be638e16179:
    cluster_id: 7f5441ae-6e30-4883-9efd-90e8773f15d0
    name: srvnode-3
cluster:
  7f5441ae-6e30-4883-9efd-90e8773f15d0:
    storage_set:
    - server_nodes: ["30512e5ae6df9f1ea02327bab45e499d", "8d00f71d6e0eeef02e971e6356bb83aa", "0b6dc7068f454d84942b4be638e16179"]

Init:

Run this cmd individually on all 3 nodes.

/opt/seagate/cortx/utils/bin/elasticsearch_setup init --config yaml:///opt/seagate/cortx/utils/conf/elasticsearch/elasticsearch.init.tmpl

Start Elasticsearch service.

systemctl enable elasticsearch.service
systemctl start elasticsearch.service

Test:

/opt/seagate/cortx/utils/bin/elasticsearch_setup test --config yaml:///opt/seagate/cortx/utils/conf/elasticsearch/elasticsearch.test.tmpl

Reset:

Run this cmd individually on all 3 nodes.

/opt/seagate/cortx/utils/bin/elasticsearch_setup reset --config yaml:///opt/seagate/cortx/utils/conf/elasticsearch/elasticsearch.reset.tmpl

Cleanup:

Run this cmd individually on all 3 nodes.

/opt/seagate/cortx/utils/bin/elasticsearch_setup cleanup  --config yaml:///opt/seagate/cortx/utils/conf/elasticsearch/elasticsearch.cleanup.tmpl

Pre-factory:

/opt/seagate/cortx/utils/bin/elasticsearch_setup cleanup --pre-factory --config yaml:///opt/seagate/cortx/utils/conf/elasticsearch/elasticsearch.cleanup.tmpl