bi_kibana - tetsuyaf1100/hello-world GitHub Wiki

Elasticsearch, Kibana, logstash 構築手順

検証環境
# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
インストール
  • OpenJDK インストール
# yum install java-1.8.0-openjdk-devel
# java -version
  • Elasticsearch PGPキー インストール
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
  • リポジトリの登録
# vi /etc/yum.repos.d/elasticsearch.repo
[elasticsearch]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md
  • Elasticsearch, kibana, logstashインストール
yum install -y --enablerepo=elasticsearch  elasticsearch kibana logstash
設定
  • Elasticsearchに利用するIPアドレスとシングルノードで動かす設定

    • /etc/elasticsearch/elasticsearch.yml
    # Set the bind address to a specific IP (IPv4 or IPv6):
    #
    #network.host: 192.168.0.1
    network.host: 0.0.0.0 ← 追加
    discovery.type: single-node ← 追加
    
    • /etc/kibana/kibana.yml
    #server.host: "localhost"
    server.host: "0.0.0.0" ← 追加
    
  • サービス起動・設定

# systemctl enable elasticsearch.service
# systemctl start elasticsearch.service
# curl localhost:9200

# systemctl enable kibana.service
# systemctl start kibana.service
Xpack
  • ライセンス確認
# curl -XPOST http://<ES_NODE>:9200/_xpack/license/start_trial?acknowledge=true

ref:
https://www.elastic.co/jp/blog/getting-started-with-security
  • パスワード設定
# bin/x-pack/setup-passwords auto|interactive

ref:
https://www.elastic.co/guide/en/elasticsearch/reference/6.1/setup-passwords.html
  • /etc/elasticsearch/elasticsearch.yml
xpack.security.enabled: true
  • /etc/kibana/kibana.yml
elasticsearch.username: "kibana"
elasticsearch.password: "password"
  • サービス再起動
# systemctl stop elasticsearch.service
# systemctl stop kibana.service
# systemctl start elasticsearch.service
# systemctl start kibana.service
  • 確認
xpack有効の場合:
# curl http://localhost:5601
curl: (7) Failed connect to localhost:5601; Connection refused

xpack無効の場合:
# curl http://localhost:5601

Note: セキュリティ機能のはじめ方
https://www.elastic.co/jp/blog/getting-started-with-security

⚠️ **GitHub.com Fallback** ⚠️