This is second part of my installation blog on InfluxDB.
In the First part of this blog we have discussed single instance
installation. In this part we are going to discuss cluster installation for InfluxDB.
For cluster installation which is not a production ready system InfluxDB provides a special cluster installation package which they called “QuickStart Cluster
“. This system is nearly production ready i.e. “QuickStart Cluster” can’t be used as production system because of licensing policies however it has all features which is available with production cluster.
To install download it from InfluxDB site. This will require a registration formalities based on which they will provide a license file for free trial. Moreover this cluster is in-complete without TICK stack
which will also be covered in another blog.
Server’s Status:
Server Name | CPU Core | RAM | Storage |
influx01 | 4 | 16GB | 100GB |
influx02 | 4 | 16GB | 100GB |
influx03 | 4 | 16GB | 100GB |
influx04 | 4 | 16GB | 100GB |
Cluster configuration on Servers:
Server Name | Meta Node | Data Node |
influx01 | Y | Y |
influx02 | Y | Y |
influx03 | Y | Y |
influx04 | N | Y |
Before installation, there needs to be at three VMs or physical system to be ready. These four systems should have OS installed into it. System should be able to ping each other. Host file of each systems should be modified and looks like:
[sanjeevakumar@influx01 ~]$ more /etc/hosts
127.0.0.1 influx01.sanjeeva.local influx01 ## influx02./03sanjeeva.local influx02/03 on 2nd/3rd node
192.168.1.101 influx01.sanjeeva.local influx01
192.168.1.102 influx02.sanjeeva.local influx02
192.168.1.103 influx03.sanjeeva.local influx03
192.168.1.104 influx03.sanjeeva.local influx04
Once host file is updated on all nodes, this needs to be validated by using “ping” on all nodes.
On all nodes, run ping command to validate if all machines are reachable to each other:
ping 192.168.1.101
ping 192.168.1.102
ping 192.168.1.103
ping 192.168.1.104
ping influx01.sanjeeva.local
ping influx02.sanjeeva.local
ping influx03.sanjeeva.local
ping influx04.sanjeeva.local
ping influx01
ping influx02
ping influx03
ping influx04
Once node reachable to each other, its time to install influxDB quick cluster. We will install meta node on three nodes and data node on four nodes. Let’s install meta nodes first.
Create a folder “influx” in your local path and download meta node on all the three nodes.
On first node:
[sanjeevakumar@influx01 influx]$ wget https://dl.influxdata.com/enterprise/releases/influxdb-meta-1.5.0_c1.5.0.x86_64.rpm
–2018-03-13 17:20:31– https://dl.influxdata.com/enterprise/releases/influxdb-meta-1.5.0_c1.5.0.x86_64.rpm
Resolving dl.influxdata.com (dl.influxdata.com)… 52.84.110.131, 52.84.110.245, 52.84.110.230, …
Connecting to dl.influxdata.com (dl.influxdata.com)|52.84.110.131|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 10898677 (10M) [application/octet-stream]
Saving to: ‘influxdb-meta-1.5.0_c1.5.0.x86_64.rpm’
100%[=====================================================>] 10,898,677 2.71MB/s in 5.5s
2018-03-13 17:20:37 (1.88 MB/s) – ‘influxdb-meta-1.5.0_c1.5.0.x86_64.rpm’ saved [10898677/10898677]
[sanjeevakumar@influx01 influx]$ ls -ltr
total 10644
-rw-r–r– 1 sanjeevakumar 1409299126 10898677 Mar 7 04:26 influxdb-meta-1.5.0_c1.5.0.x86_64.rpm
[sanjeevakumar@influx01 influx]$
IT’s time to install. Use yum localinstall and perform this on all nodes.
First node:
[sanjeevakumar@influx01 influx]$ sudo yum localinstall influxdb-meta-1.5.0_c1.5.0.x86_64.rpm
Loaded plugins: fastestmirror, langpacks
Examining influxdb-meta-1.5.0_c1.5.0.x86_64.rpm: influxdb-meta-1.5.0_c1.5.0-1.x86_64
Marking influxdb-meta-1.5.0_c1.5.0.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package influxdb-meta.x86_64 0:1.5.0_c1.5.0-1 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
======================================================================================
Package Arch Version Repository Size
======================================================================================
Installing:
influxdb-meta x86_64 1.5.0_c1.5.0-1 /influxdb-meta-1.5.0_c1.5.0.x86_64 34 M
Transaction Summary
======================================================================================
Install 1 Package
Total size: 34 M
Installed size: 34 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : influxdb-meta-1.5.0_c1.5.0-1.x86_64 1/1
Created symlink from /etc/systemd/system/multi-user.target.wants/influxdb-meta.service to /usr/lib/systemd/system/influxdb-meta.service.
Verifying : influxdb-meta-1.5.0_c1.5.0-1.x86_64 1/1
Installed:
influxdb-meta.x86_64 0:1.5.0_c1.5.0-1
Complete!
Second node:
[sanjeevakumar@influx02 influx]$ sudo yum localinstall influxdb-meta-1.5.0_c1.5.0.x86_64.rpm
Loaded plugins: fastestmirror, langpacks
Examining influxdb-meta-1.5.0_c1.5.0.x86_64.rpm: influxdb-meta-1.5.0_c1.5.0-1.x86_64
Marking influxdb-meta-1.5.0_c1.5.0.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package influxdb-meta.x86_64 0:1.5.0_c1.5.0-1 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
======================================================================================
Package Arch Version Repository Size
======================================================================================
Installing:
influxdb-meta x86_64 1.5.0_c1.5.0-1 /influxdb-meta-1.5.0_c1.5.0.x86_64 34 M
Transaction Summary
======================================================================================
Install 1 Package
Total size: 34 M
Installed size: 34 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : influxdb-meta-1.5.0_c1.5.0-1.x86_64 1/1
Created symlink from /etc/systemd/system/multi-user.target.wants/influxdb-meta.service to /usr/lib/systemd/system/influxdb-meta.service.
Verifying : influxdb-meta-1.5.0_c1.5.0-1.x86_64 1/1
Installed:
influxdb-meta.x86_64 0:1.5.0_c1.5.0-1
Complete!
Third node:
[sanjeevakumar@influx03 influx]$ sudo yum localinstall influxdb-meta-1.5.0_c1.5.0.x86_64.rpm
Loaded plugins: fastestmirror, langpacks
Examining influxdb-meta-1.5.0_c1.5.0.x86_64.rpm: influxdb-meta-1.5.0_c1.5.0-1.x86_64
Marking influxdb-meta-1.5.0_c1.5.0.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package influxdb-meta.x86_64 0:1.5.0_c1.5.0-1 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
======================================================================================
Package Arch Version Repository Size
======================================================================================
Installing:
influxdb-meta x86_64 1.5.0_c1.5.0-1 /influxdb-meta-1.5.0_c1.5.0.x86_64 34 M
Transaction Summary
======================================================================================
Install 1 Package
Total size: 34 M
Installed size: 34 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : influxdb-meta-1.5.0_c1.5.0-1.x86_64 1/1
Created symlink from /etc/systemd/system/multi-user.target.wants/influxdb-meta.service to /usr/lib/systemd/system/influxdb-meta.service.
Verifying : influxdb-meta-1.5.0_c1.5.0-1.x86_64 1/1
Installed:
influxdb-meta.x86_64 0:1.5.0_c1.5.0-1
Complete!
Once meta services are installed on all three nodes, installation of data node to be done on all four nodes. The same steps to be followed for this. Download data service rpm in influx folder and use yum localinstall to install it on all four nodes.
On all Nodes download RPM:
[sanjeevakumar@influx01 influx]$ wget https://dl.influxdata.com/enterprise/releases/influxdb-meta-1.5.0_c1.5.0.x86_64.rpm
–2018-03-13 17:22:05– https://dl.influxdata.com/enterprise/releases/influxdb-meta-1.5.0_c1.5.0.x86_64.rpm
Resolving dl.influxdata.com (dl.influxdata.com)… 52.84.110.245, 52.84.110.230, 52.84.110.59, …
Connecting to dl.influxdata.com (dl.influxdata.com)|52.84.110.245|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 10898677 (10M) [application/octet-stream]
Saving to: ‘influxdb-meta-1.5.0_c1.5.0.x86_64.rpm’
100%[======================================================>] 10,898,677 6.23MB/s in 1.7s
2018-03-13 17:22:07 (6.23 MB/s) – ‘influxdb-meta-1.5.0_c1.5.0.x86_64.rpm’ saved [10898677/10898677]
On first node install:
[sanjeevakumar@influx01 influx]$ sudo yum localinstall influxdb-data-1.5.0_c1.5.0.x86_64.rpm
Loaded plugins: fastestmirror, langpacks
Examining influxdb-data-1.5.0_c1.5.0.x86_64.rpm: influxdb-data-1.5.0_c1.5.0-1.x86_64
Marking influxdb-data-1.5.0_c1.5.0.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package influxdb-data.x86_64 0:1.5.0_c1.5.0-1 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
======================================================================================
Package Arch Version Repository Size
======================================================================================
Installing:
influxdb-data x86_64 1.5.0_c1.5.0-1 /influxdb-data-1.5.0_c1.5.0.x86_64 72 M
Transaction Summary
======================================================================================
Install 1 Package
Total size: 72 M
Installed size: 72 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : influxdb-data-1.5.0_c1.5.0-1.x86_64 1/1
Created symlink from /etc/systemd/system/influxd.service to /usr/lib/systemd/system/influxdb.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/influxdb.service to /usr/lib/systemd/system/influxdb.service.
Verifying : influxdb-data-1.5.0_c1.5.0-1.x86_64 1/1
Installed:
influxdb-data.x86_64 0:1.5.0_c1.5.0-1
Complete!
[sanjeevakumar@influx01 influx]$
On Second node install:
[sanjeevakumar@influx02 influx]$ sudo yum localinstall influxdb-data-1.5.0_c1.5.0.x86_64.rpm
Loaded plugins: fastestmirror, langpacks
Examining influxdb-data-1.5.0_c1.5.0.x86_64.rpm: influxdb-data-1.5.0_c1.5.0-1.x86_64
Marking influxdb-data-1.5.0_c1.5.0.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package influxdb-data.x86_64 0:1.5.0_c1.5.0-1 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
======================================================================================
Package Arch Version Repository Size
======================================================================================
Installing:
influxdb-data x86_64 1.5.0_c1.5.0-1 /influxdb-data-1.5.0_c1.5.0.x86_64 72 M
Transaction Summary
======================================================================================
Install 1 Package
Total size: 72 M
Installed size: 72 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : influxdb-data-1.5.0_c1.5.0-1.x86_64 1/1
Created symlink from /etc/systemd/system/influxd.service to /usr/lib/systemd/system/influxdb.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/influxdb.service to /usr/lib/systemd/system/influxdb.service.
Verifying : influxdb-data-1.5.0_c1.5.0-1.x86_64 1/1
Installed:
influxdb-data.x86_64 0:1.5.0_c1.5.0-1
Complete!
[sanjeevakumar@influx02 influx]$
On Third node install:
[sanjeevakumar@influx03 influx]$ sudo yum localinstall influxdb-data-1.5.0_c1.5.0.x86_64.rpm
Loaded plugins: fastestmirror, langpacks
Examining influxdb-data-1.5.0_c1.5.0.x86_64.rpm: influxdb-data-1.5.0_c1.5.0-1.x86_64
Marking influxdb-data-1.5.0_c1.5.0.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package influxdb-data.x86_64 0:1.5.0_c1.5.0-1 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
======================================================================================
Package Arch Version Repository Size
======================================================================================
Installing:
influxdb-data x86_64 1.5.0_c1.5.0-1 /influxdb-data-1.5.0_c1.5.0.x86_64 72 M
Transaction Summary
======================================================================================
Install 1 Package
Total size: 72 M
Installed size: 72 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : influxdb-data-1.5.0_c1.5.0-1.x86_64 1/1
Created symlink from /etc/systemd/system/influxd.service to /usr/lib/systemd/system/influxdb.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/influxdb.service to /usr/lib/systemd/system/influxdb.service.
Verifying : influxdb-data-1.5.0_c1.5.0-1.x86_64 1/1
Installed:
influxdb-data.x86_64 0:1.5.0_c1.5.0-1
Complete!
[sanjeevakumar@influx03 influx]$
On fourth node install:
[sanjeevakumar@influx04 influx]$ sudo yum localinstall influxdb-data-1.5.0_c1.5.0.x86_64.rpm
Loaded plugins: fastestmirror, langpacks
Examining influxdb-data-1.5.0_c1.5.0.x86_64.rpm: influxdb-data-1.5.0_c1.5.0-1.x86_64
Marking influxdb-data-1.5.0_c1.5.0.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package influxdb-data.x86_64 0:1.5.0_c1.5.0-1 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
======================================================================================
Package Arch Version Repository Size
======================================================================================
Installing:
influxdb-data x86_64 1.5.0_c1.5.0-1 /influxdb-data-1.5.0_c1.5.0.x86_64 72 M
Transaction Summary
======================================================================================
Install 1 Package
Total size: 72 M
Installed size: 72 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : influxdb-data-1.5.0_c1.5.0-1.x86_64 1/1
Created symlink from /etc/systemd/system/influxd.service to /usr/lib/systemd/system/influxdb.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/influxdb.service to /usr/lib/systemd/system/influxdb.service.
Verifying : influxdb-data-1.5.0_c1.5.0-1.x86_64 1/1
Installed:
influxdb-data.x86_64 0:1.5.0_c1.5.0-1
Complete!
[sanjeevakumar@influx04 influx]$
After installing all data nodes it’s time to start services. Meta nodes is to be started first and it will be followed by data node.
[sanjeevakumar@influx01 influxdb]$ sudo /bin/systemctl start influxdb-meta.service
[sanjeevakumar@influx01 influxdb]$ sudo systemctl start influxdb
[sanjeevakumar@influx01 influxdb]$ ps aux | grep -v grep | grep influxdb-meta
influxdb 25527 0.2 0.1 275084 14456 ? Ssl 17:54 0:02 /usr/bin/influxd-meta -config /etc/influxdb/influxdb-meta.conf
influxdb 26684 0.5 0.1 286428 13060 ? Ssl 18:08 0:00 /usr/bin/influxd -config /etc/influxdb/influxdb.conf
[sanjeevakumar@influx01 influxdb]$
Once meta and data services are started, you need to search all nodes and join to create a cluster of meta and data services. Hence, this command to be executed on all nodes and same output is expected.
[sanjeevakumar@influx01 influxdb]$ influxd-ctl join -v
Joining meta node at localhost:8091
Searching for meta node on influx01:8091…
Searching for data node on influx01:8088…
Successfully created cluster
* Added meta node 1 at influx01.sanjeeva.local:8091
* Added data node 2 at influx01.sanjeeva.local:8088
To join additional nodes to this cluster, run the following command:
influxd-ctl join influx01.sanjeeva.local:8091
[sanjeevakumar@influx01 influxdb]$
On all other nodes:
[sanjeevakumar@influx03 influxdb]$ influxd-ctl join influx01.sanjeeva.local:8091
Joining meta node at influx01.sanjeeva.local:8091
Searching for meta node on influx03:8091…
Searching for data node on influx03:8088…
Successfully joined cluster
* Added meta node 5 at influx03.sanjeeva.local:8091
* Added data node 6 at influx03.sanjeeva.local:8088
[sanjeevakumar@influx03 influxdb]$
Cluster health check on any of node:
[sanjeevakumar@influx01 influxdb]$ influxd-ctl show
Data Nodes
==========
ID TCP Address Version
2 influx01.sanjeeva.local:8088 1.5.0-c1.5.0
4 influx02.sanjeeva.local:8088 1.5.0-c1.5.0
6 influx03.sanjeeva.local:8088 1.5.0-c1.5.0
8 influx04.sanjeeva.local:8088 1.5.0-c1.5.0
Meta Nodes
==========
TCP Address Version
influx01.sanjeeva.local:8091 1.5.0-c1.5.0
influx02.sanjeeva.local:8091 1.5.0-c1.5.0
influx03.sanjeeva.local:8091 1.5.0-c1.5.0
[sanjeevakumar@influx01 influxdb]$