AKAI TSUKI

System development or Technical something

install ansible 2.5 on centos 7.

[root@localhost ~]# yum install epel-release

*snip*

Installed:
  epel-release.noarch 0:7-9

Complete!
[root@localhost ~]# 
[root@localhost ~]# yum --enablerepo=epel install ansible

*snip*

Installed:
  ansible.noarch 0:2.5.2-1.el7

Dependency Installed:
  PyYAML.x86_64 0:3.10-11.el7
  libtomcrypt.x86_64 0:1.17-26.el7
  libtommath.x86_64 0:0.42.0-6.el7
  libyaml.x86_64 0:0.1.4-11.el7_0
  python-babel.noarch 0:0.9.6-8.el7
  python-backports.x86_64 0:1.0-8.el7
  python-backports-ssl_match_hostname.noarch 0:3.4.0.2-4.el7
  python-cffi.x86_64 0:1.6.0-5.el7
  python-enum34.noarch 0:1.0.4-1.el7
  python-httplib2.noarch 0:0.9.2-1.el7
  python-idna.noarch 0:2.4-1.el7
  python-ipaddress.noarch 0:1.0.16-2.el7
  python-jinja2.noarch 0:2.7.2-2.el7
  python-keyczar.noarch 0:0.71c-2.el7
  python-markupsafe.x86_64 0:0.11-10.el7
  python-paramiko.noarch 0:2.1.1-4.el7
  python-ply.noarch 0:3.4-11.el7
  python-pycparser.noarch 0:2.14-1.el7
  python-setuptools.noarch 0:0.9.8-7.el7
  python-six.noarch 0:1.9.0-2.el7
  python2-crypto.x86_64 0:2.6.1-15.el7
  python2-cryptography.x86_64 0:1.7.2-1.el7_4.1
  python2-jmespath.noarch 0:0.9.0-3.el7
  python2-pyasn1.noarch 0:0.1.9-7.el7
  sshpass.x86_64 0:1.06-2.el7

Complete!
[root@localhost ~]#
[root@localhost ~]# ansible --version
ansible 2.5.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
[root@localhost ~]#

When we study java and spring boot and docker.

When we study java and spring boot and docker, please check.

https://blog.docker.com/2018/03/video-series-modernizing-java-apps-developers-part-1/

https://blog.docker.com/2018/03/video-series-modernizing-java-apps-developers-part-2/

https://blog.docker.com/2018/03/video-series-modernizing-java-apps-developers-part-3/

https://blog.docker.com/2018/04/video-series-modernizing-java-apps-developers-part-4/

https://training.play-with-docker.com/ops-landing/
-> Stage 1: The Basics

https://spring.io/guides/gs/spring-boot-docker/
Spring Boot with Docker

https://www.slideshare.net/masatoshitada7/spring-boot-jjug

check index infomation by REST API

infomation

# curl http://localhost:9200/customer?pretty
{
  "customer" : {
    "aliases" : { },
    "mappings" : { },
    "settings" : {
      "index" : {
        "creation_date" : "1514796397799",
        "number_of_shards" : "5",
        "number_of_replicas" : "1",
        "uuid" : "2bDYA53CQp6lvXxoHe_jAQ",
        "version" : {
          "created" : "5040399"
        },
        "provided_name" : "customer"
      }
    }
  }
}
#

settings

# curl http://localhost:9200/customer/_settings?pretty
{
  "customer" : {
    "settings" : {
      "index" : {
        "creation_date" : "1514796397799",
        "number_of_shards" : "5",
        "number_of_replicas" : "1",
        "uuid" : "2bDYA53CQp6lvXxoHe_jAQ",
        "version" : {
          "created" : "5040399"
        },
        "provided_name" : "customer"
      }
    }
  }
}
#

mappings

# curl http://localhost:9200/customer/_mappings?pretty
{
  "customer" : {
    "mappings" : { }
  }
}
#

alias

# curl http://localhost:9200/customer/_alias?pretty
{
  "customer" : {
    "aliases" : { }
  }
}
#

mappings and alias

# curl http://localhost:9200/customer/_mappings,_alias?pretty
{
  "customer" : {
    "mappings" : { },
    "aliases" : { }
  }
}
#

Install Prometheus on CentOS 7

ref. prometheus-rpm/release - Packages - packagecloud.io | packagecloud

Setting yum repository

[root@cent7devops ~]# vi /etc/yum.repos.d/prometheus.repo
[root@cent7devops ~]# cat /etc/yum.repos.d/prometheus.repo
[prometheus]
name=prometheus
baseurl=https://packagecloud.io/prometheus-rpm/release/el/7/$basearch
repo_gpgcheck=1
enabled=1
gpgkey=https://packagecloud.io/prometheus-rpm/release/gpgkey
       https://raw.githubusercontent.com/lest/prometheus-rpm/master/RPM-GPG-KEY-prometheus-rpm
gpgcheck=1
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
[root@cent7devops ~]#

install prometheus 2

[root@cent7devops ~]# yum install -y prometheus2.x86_64
*snip*
Installed:
  prometheus2.x86_64 0:2.0.0-2.el7.centos

Complete!
[root@cent7devops ~]#

install node exporter

[root@cent7devops ~]# yum install -y node_exporter.x86_64
*snip*
Installed:
  node_exporter.x86_64 0:0.15.1-1.el7.centos

Complete!
[root@cent7devops ~]#

firewall setting

[root@cent7devops ~]# firewall-cmd --zone=public --add-port=9090/tcp
success
[root@cent7devops ~]# firewall-cmd --zone=public --add-port=9090/tcp --permanent
success
[root@cent7devops ~]# firewall-cmd --reload
success
[root@cent7devops ~]#

[root@cent7devops ~]# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: enp0s3
  sources:
  services: dhcpv6-client ssh
  ports: 9090/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

[root@cent7devops ~]#

start Prometheus

[root@cent7devops ~]# systemctl start prometheus

access to prometheus web

f:id:akai_tsuki:20171203184946p:plain

start Node exporter

[root@cent7devops ~]# systemctl start node_exporter

edit Prometheus config file

[root@cent7devops ~]# cp -p /etc/prometheus/prometheus.yml{,.org}
[root@cent7devops ~]# vi /etc/prometheus/prometheus.yml
[root@cent7devops ~]# diff /etc/prometheus/prometheus.yml.org /etc/prometheus/prometheus.yml
29c29
<       - targets: ['localhost:9090']
---
>       - targets: ['localhost:9090', 'localhost:9100']
[root@cent7devops ~]#

reload

[root@cent7devops ~]# systemctl reload prometheus

check Graph for node_memory_Active

f:id:akai_tsuki:20171203190029p:plain