ElasticSearch 모니터링툴 설치하기

두가지 종류가 있음

apache elasiticHQ

파이썬 설치 

https://linuxize.com/post/how-to-install-python-3-on-centos-7/

Apache elasticsearch HQ

http://www.elastichq.org/gettingstarted.html



$sudo yum install centos-release-scl


$sudo yum install rh-python36

$python --version

$scl enable rh-python36 bash

$python --version

install HQ

1. Download or clone the repository https://github.com/ElasticHQ/elasticsearch-HQ

2. Navigate to the root of the repository: pip install -r requirements.txt

3. Start the server: python3 application.py

4. Point your browser to: http://localhost:5000

Kibana monitoring

두 번째는 elasticsearch의 모니터링툴

6.5 부터는 모니터링툴이 자동으로 포함되어잇지만 이전버전들은 설치 해야함 .

현재 사용중인 6.2.2 에서는 kibana monitoring 을 사용하려면 xpack 설치가 필요

elasticsearch와 kibana 에 x-pack 설치 (sudo 권한)

[user@localhost bin]$ ./elasticsearch-plugin install x-pack
[sudo] pduser의 암호:
-> Downloading x-pack from elastic
[=================================================] 100%  
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@     WARNING: plugin requires additional permissions     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.io.FilePermission \\.\pipe\* read,write
* java.lang.RuntimePermission accessClassInPackage.com.sun.activation.registries
* java.lang.RuntimePermission getClassLoader
* java.lang.RuntimePermission setContextClassLoader
* java.lang.RuntimePermission setFactory
* java.net.SocketPermission * connect,accept,resolve
* java.security.SecurityPermission createPolicy.JavaPolicy
* java.security.SecurityPermission getPolicy
* java.security.SecurityPermission putProviderProperty.BC
* java.security.SecurityPermission setPolicy
* java.util.PropertyPermission * read,write
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.

Continue with installation? [y/N]y
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@        WARNING: plugin forks a native controller        @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
This plugin launches a native controller that is not subject to the Java
security manager nor to system call filters.

Continue with installation? [y/N]y
Elasticsearch keystore is required by plugin [x-pack-security], creating...
-> Installed x-pack with: x-pack-core,x-pack-deprecation,x-pack-graph,x-pack-logstash,x-pack-ml,x-pack-monitoring,x-pack-security,x-pack-upgrade,x-pack-watcher

설치를 하면 bin 디렉토리안에 x-pack 폴더가 생긴다 폴더에 들어가서 비밀번호 설정을 할것이다.

[user@localhost x-pack]$ ./setup-passwords interactive
Initiating the setup of passwords for reserved users elastic,kibana,logstash_system.
You will be prompted to enter passwords as the process progresses.
Please confirm that you would like to continue [y/N]y


Enter password for [elastic]:
Reenter password for [elastic]:
Enter password for [kibana]:
Reenter password for [kibana]:
Enter password for [logstash_system]:
Reenter password for [logstash_system]:
Changed password for user [kibana]
Changed password for user [logstash_system]
Changed password for user [elastic]
[user@localhost x-pack]$

kibana xpack 설치

kibana 홈디렉토리의 bin디렉토리로 이동

[user@localhost bin]$ ./kibana-plugin install x-pack
Attempting to transfer from x-pack
Attempting to transfer from https://artifacts.elastic.co/downloads/kibana-plugins/x-pack/x-pack-6.2.2.zip
Transferring 269704442 bytes....................
Transfer complete
Retrieving metadata from plugin archive
Extracting plugin archive
Extraction complete
Optimizing and caching browser bundles...
Plugin installation complete

kiabana 비밀번호 설정

xpack 을 설치하면 보안이 복잡하다 그렇기 때문에 나는 사용하지 않기로 함 !!

elasticsearch.yml 파일과 kibana.yml 파일에 다음과 같이 추가해줘야함

xpack.security.enabled: false

설정 후에 elasticsearch 를 종료하고 다시 시작해야한다.

참고자료

https://www.elastic.co/guide/en/elasticsearch/reference/6.2/installing-xpack-es.html

http://www.kwangsiklee.com/2017/02/%EC%97%98%EB%9D%BC%EC%8A%A4%ED%8B%B1%EC%84%9C%EC%B9%98%EC%97%90%EC%84%9C-x-pack%EC%9C%BC%EB%A1%9C-%EC%9D%B8%EC%A6%9Dauthentication-%EC%A0%81%EC%9A%A9%ED%95%98%EA%B8%B0/

+ Recent posts