AKAI TSUKI

System development or Technical something

check status Elasticsearch

ref

install elasticsearch-head on CentOS 7.3 - AKAI TSUKI
install eleasticsearch on CentOS 7.3 - AKAI TSUKI

check by curl command

[root@cent7no31 ~]# curl -X GET http://localhost:9200/
{
  "name" : "cent7no31",
  "cluster_name" : "test-cluster",
  "cluster_uuid" : "XM0VikGzTve-p7Bb_p81Rw",
  "version" : {
    "number" : "5.4.3",
    "build_hash" : "eed30a8",
    "build_date" : "2017-06-22T00:34:03.743Z",
    "build_snapshot" : false,
    "lucene_version" : "6.5.1"
  },
  "tagline" : "You Know, for Search"
}
[root@cent7no31 ~]#

cat APIs | Elasticsearch Reference [5.6] | Elastic

[root@cent7no31 ~]# curl -X GET http://localhost:9200/_cat/health
1509877640 19:27:20 test-cluster green 4 3 2 1 0 0 0 0 - 100.0%
[root@cent7no31 ~]#
[root@cent7no31 ~]# curl -X GET http://localhost:9200/_cat/health?v
epoch      timestamp cluster      status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1509877664 19:27:44  test-cluster green           4         3      2   1    0    0        0             0                  -                100.0%
[root@cent7no31 ~]#
[root@cent7no31 ~]# curl -X GET http://localhost:9200/_cat/master
OeS8YZ8vTU-DCZgg7xlX2g 172.16.10.213 172.16.10.213 cent7no13
[root@cent7no31 ~]#
[root@cent7no31 ~]# curl -X GET http://localhost:9200/_cat/master?v
id                     host          ip            node
OeS8YZ8vTU-DCZgg7xlX2g 172.16.10.213 172.16.10.213 cent7no13
[root@cent7no31 ~]#
[root@cent7no31 ~]# curl -X GET http://localhost:9200/_cat/nodes
172.16.10.213  6 71 0 0.00 0.01 0.05 md * cent7no13
172.16.10.212  7 69 0 0.00 0.01 0.05 md - cent7no12
172.16.10.231  5 38 0 0.00 0.01 0.05 -  - cent7no31
172.16.10.211 10 69 0 0.00 0.01 0.05 md - cent7no11
[root@cent7no31 ~]#
[root@cent7no31 ~]# curl -X GET http://localhost:9200/_cat/nodes?v
ip            heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
172.16.10.213            6          71   0    0.00    0.01     0.05 md        *      cent7no13
172.16.10.212            7          69   0    0.00    0.01     0.05 md        -      cent7no12
172.16.10.231            5          38   0    0.00    0.01     0.05 -         -      cent7no31
172.16.10.211           10          69   0    0.00    0.01     0.05 md        -      cent7no11
[root@cent7no31 ~]#

install eleasticsearch on CentOS 7.3

ref

install logstash on CentOS 7.3 - AKAI TSUKI
install kibana on CentOS 7.3 - AKAI TSUKI

environment

hostname ip node
cent7no31 172.16.10.231 Coordinating node
cent7no11 172.16.10.211 Master/Data node
cent7no12 172.16.10.212 Master/Data node
cent7no13 172.16.10.213 Master/Data node

install

install java in all node

# yum install -y java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64

install java in all node

# rpm -ivh https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.3.rpm

configure

# vi /etc/elasticsearch/elasticsearch.yml

cent7no31

[root@cent7no31 elasticsearch]# grep -v "^#" /etc/elasticsearch/elasticsearch.yml | grep -v "^$"
cluster.name: test-cluster
node.name: cent7no31
network.host: 172.16.10.231
discovery.zen.ping.unicast.hosts: ["cent7no11", "cent7no12", "cent7no13", "cent7no31"]
node.master: false
node.data: false
node.ingest: false
[root@cent7no31 elasticsearch]#

cent7no11

[root@cent7no11 ~]# grep -v "^#" /etc/elasticsearch/elasticsearch.yml | grep -v "^$"
cluster.name: test-cluster
node.name: cent7no11
network.host: 172.16.10.211
discovery.zen.ping.unicast.hosts: ["cent7no11", "cent7no12", "cent7no13", "cent7no31"]
discovery.zen.minimum_master_nodes: 2
node.master: true
node.data: true
node.ingest: false
[root@cent7no11 ~]#

cent7no12

[root@cent7no12 elasticsearch]# grep -v "^#" /etc/elasticsearch/elasticsearch.yml | grep -v "^$"
cluster.name: test-cluster
node.name: cent7no12
network.host: 172.16.10.212
discovery.zen.ping.unicast.hosts: ["cent7no11", "cent7no12", "cent7no13", "cent7no31"]
discovery.zen.minimum_master_nodes: 2
node.master: true
node.data: true
node.ingest: false
[root@cent7no12 elasticsearch]#

cent7no13

[root@cent7no13 elasticsearch]# grep -v "^#" /etc/elasticsearch/elasticsearch.yml | grep -v "^$"
cluster.name: test-cluster
node.name: cent7no13
network.host: 172.16.10.213
discovery.zen.ping.unicast.hosts: ["cent7no11", "cent7no12", "cent7no13", "cent7no31"]
discovery.zen.minimum_master_nodes: 2
node.master: true
node.data: true
node.ingest: false
[root@cent7no13 elasticsearch]#

install logstash on CentOS 7.3

environment

hostname ip
cent7no41 172.16.10.241

install

install java

[root@cent7no41 ~]# yum install -y java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64

install logstash

[root@cent7no41 ~]# rpm -ivh https://artifacts.elastic.co/downloads/logstash/logstash-5.4.3.rpm

check status

[root@cent7no41 ~]# systemctl status logstash
● logstash.service - logstash
   Loaded: loaded (/etc/systemd/system/logstash.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
[root@cent7no41 ~]#

install kibana on CentOS 7.3

environment

hostname ip
cent7no31 172.16.10.231

install

install java

[root@cent7no31 ~]# yum install -y java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64
*snip*
Dependency Updated:
  nss-softokn.x86_64 0:3.28.3-8.el7_4           nss-softokn-freebl.x86_64 0:3.28.3-8.el7_4

Complete!
[root@cent7no31 ~]#

install kibana

[root@cent7no31 ~]# rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
[root@cent7no31 ~]# rpm -ivh  https://artifacts.elastic.co/downloads/kibana/kibana-5.4.3-x86_64.rpm
Retrieving https://artifacts.elastic.co/downloads/kibana/kibana-5.4.3-x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:kibana-5.4.3-1                   ################################# [100%]
[root@cent7no31 ~]#

configure server.host

[root@cent7no31 ~]# vi /etc/kibana/kibana.yml

#server.host: "localhost"
server.host: "172.16.10.231"

start kibana

[root@cent7no31 ~]# systemctl status kibana
● kibana.service - Kibana
   Loaded: loaded (/etc/systemd/system/kibana.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
[root@cent7no31 ~]# systemctl start kibana
[root@cent7no31 ~]#

access to kibana by browser
f:id:akai_tsuki:20171104213725p:plain

Try to prepare host for installation of OpenShift.

ref:
https://docs.openshift.org/latest/install_config/install/host_preparation.html

Host list

Host Role
opshift01 master/node(infra)
opshift02 node(west)
opshift03 node(east)

Stop firewalld

at all node

[root@opshift01 ~]# systemctl stop firewalld
[root@opshift01 ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@opshift01 ~]#

Install the following base packages:

at all node

# yum install wget git net-tools bind-utils iptables-services \
bridge-utils bash-completion kexec-tools sos psacct

Install Ansible

install at master node.

# yum -y install \
    https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# sed -i -e "s/^enabled=1/enabled=0/" /etc/yum.repos.d/epel.repo
# yum -y --enablerepo=epel install ansible pyOpenSSL

try to confirm version

# ansible --version
ansible 2.3.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.5 (default, Nov  6 2016, 00:28:07) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]
#

Get openshift-ansible

at master node.

# cd ~
# git clone https://github.com/openshift/openshift-ansible
Cloning into 'openshift-ansible'...
remote: Counting objects: 61775, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 61775 (delta 6), reused 15 (delta 4), pack-reused 61754
Receiving objects: 100% (61775/61775), 16.03 MiB | 1.66 MiB/s, done.
Resolving deltas: 100% (37890/37890), done.
# cd openshift-ansible

Install docker

at all node.

# yum install docker

check version

# docker -v
Docker version 1.12.6, build 88a4867/1.12.6
# 

configure /etc/sysconfig/docker file.

# cp -p /etc/sysconfig/docker{,.org}
# vi /etc/sysconfig/docker
# diff /etc/sysconfig/docker{,.org}
4c4
< OPTIONS='--selinux-enabled --insecure-registry 172.30.0.0/16 --log-driver=journald --signature-verification=false'
---
> OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false'
#

check physical volume and volume group for docker.
and ref. Create Physical volume in Linux CentOS - AKAI TSUKI

# pvs
  PV         VG          Fmt  Attr PSize  PFree
  /dev/sda2  cl          lvm2 a--  37.00g     0
  /dev/sda3  cl          lvm2 a--  15.00g     0
  /dev/sda4  docker-data lvm2 a--  27.00g 27.00g
# vgs
  VG          #PV #LV #SN Attr   VSize  VFree
  cl            2   2   0 wz--n- 51.99g     0
  docker-data   1   0   0 wz--n- 27.00g 27.00g
#

setting up docker storage

# cat <<EOF > /etc/sysconfig/docker-storage-setup
> VG=docker-data
> EOF
#

check this file.

# cat /etc/sysconfig/docker-storage-setup
VG=docker-data
#

run script

# docker-storage-setup
  Using default stripesize 64.00 KiB.
  Rounding up size to full physical extent 28.00 MiB
  Logical volume "docker-pool" created.
  Logical volume docker-data/docker-pool changed.
#

and check

# cat /etc/sysconfig/docker-storage
DOCKER_STORAGE_OPTIONS="--storage-driver devicemapper --storage-opt dm.fs=xfs --storage-opt dm.thinpooldev=/dev/mapper/docker--data-docker--pool --storage-opt dm.use_deferred_removal=true "
# lvs
  LV          VG          Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root        cl          -wi-ao---- 49.99g
  swap        cl          -wi-ao----  2.00g
  docker-pool docker-data twi-a-t--- 10.74g             0.00   0.14
#

start docker

# systemctl is-active docker
unknown
# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
# systemctl start docker
#

Install docker-compose 1.14.0 on CentOS 7.3

install

$ sudo curl -L https://github.com/docker/compose/releases/download/1.14.0/docker-compose-`uname -s`-`uname -m` > ./docker-compose
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   617    0   617    0     0   2666      0 --:--:-- --:--:-- --:--:--  2670
100 8084k  100 8084k    0     0  3789k      0  0:00:02  0:00:02 --:--:-- 6580k
$ sudo mv ./docker-compose /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
$ ls -l /usr/local/bin/docker-compose
-rwxrwxr-x 1 suzu suzu 8278112 Jul  8 05:35 /usr/local/bin/docker-compose
$

$ docker-compose -v
docker-compose version 1.14.0, build c7bdf9e
$

Install Node.ja 6.11 on CentOS 7

install Node.js

# curl -sL https://rpm.nodesource.com/setup_6.x | bash -
*snip*

# yum install -y nodejs
*snip*
Installed:
  nodejs.x86_64 2:6.11.0-1nodesource.el7.centos

Complete!
# 

check Node.js Version

# node -v
v6.11.0
# npm -v
3.10.10
#