코린이의 기록

[ELK] Elasticsearch in the MAC OS 본문

ELK

[ELK] Elasticsearch in the MAC OS

코린이예요 2020. 8. 25. 19:26
반응형

E: Elasticsearch

설치

$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.0-linux-x86_64.tar.gz

$ tar -xzvf elasticsearch-7.9.0-linux-x86_64.tar.gz

소프트 링크 걸기 (옵션)

$ sudo ln -s ./elasticsearch-7.9.0 elasticsearch

 

실행

$ bin/elasticsearch -d -p els.pid

-d : 데몬 모드로 작동

-p : process id 를 파일로 떨굼

 

실행 확인

$ curl -XGET localhost:9200

또는

http://localhost:9200/

URL 링크로 확인

{
  "name" : "yoonsoyeonui-MacBookPro.local",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "7M8EwgnYTIWo8GTxhTr48Q",
  "version" : {
    "number" : "7.9.0",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "a479a2a7fce0389512d6a9361301708b92dff667",
    "build_date" : "2020-08-11T21:36:48.204330Z",
    "build_snapshot" : false,
    "lucene_version" : "8.6.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

 

* 참고

chrome에서 elasticsearch head 플러그인을 설치하면 cluster 상태, index 정보, 간단한 쿼리 수행 등의 기능을 편리하게 사용할 수 있다.

설치

https://chrome.google.com/webstore/detail/elasticsearch-head/ffmkiejjmecolpfloofpjologoblkegm/

 


L : Logstash

설치

$ wget artifacts.elastic.co/downloads/logstash/logstash-7.9.0.tar.gz

$ tar -zxvf logstash-7.9.0.tar.gz

 

소프트 링크 걸기 (옵션)

$ sudo ln -s ./logstash-7.9.0 logstash

 

설정

설정파일을 생성하고 입력한다.

$ mkdir conf.d생성

설정 파일을 생성한다.

$ vim conf.d/[your_config_file_name].conf

 

실행 (데몬 형태로 실행)

$ nohup bin/logstash -f conf.d/[your_config_file_name].conf -&

 

실행 확인

$ ps -ef | grep logstash


K : Kibana

설치

$ wget artifacts.elastic.co/downloads/kibana/kibana-7.9.0-darwin-x86_64.tar.gz

$ tar -xzvf kibana-7.9.0-darwin-x86_64.tar.gz

 

소프트링크 (옵션)

$ sudo ln -s ./kibana-7.9.0-darwin-x86_64 kibana

 

설정

$ vim config/kibana.yml

server.host: "서버호스트"

elasticsearch.hosts: "elasticsearch호스트"

(host설정하지 않으면 localhost가 default)

 

실행

$ nohup bin/kibana &

[1] 34219
sy@yoonsoyeonui-MacBookPro kibana % appending output to nohup.out

 

실행 확인

$ ps -ef | grep node

  501  6855  6840   0 15 820  ??         0:06.04 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer) --type=renderer --disable-color-correct-rendering --field-trial-handle=1718379636,7529274255847471067,15417318097044527087,131072 --disable-features=LayoutNG,PictureInPicture,SpareRendererForSitePerProcess --lang=ko --standard-schemes=vscode-webview,vscode-webview-resource --secure-schemes=vscode-webview,vscode-webview-resource --bypasscsp-schemes --cors-schemes=vscode-webview,vscode-webview-resource --fetch-schemes=vscode-webview,vscode-webview-resource --service-worker-schemes --app-path=/Applications/Visual Studio Code.app/Contents/Resources/app --node-integration --no-sandbox --no-zygote --native-window-open --preload=/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/base/parts/sandbox/electron-browser/preload.js --disable-remote-module --background-color=#171717 --disable-blink-features=Auxclick --num-raster-threads=4 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --enable-main-frame-before-activation --service-request-channel-token=18164874017107923175 --renderer-client-id=7 --no-v8-untrusted-code-mitigations
  501 34157     1   0  7:06PM ??         0:56.87 bin/../node/bin/node bin/../src/cli
  501 34219 34203   0  7:09PM ttys000    0:32.81 bin/../node/bin/node bin/../src/cli
  501 34236 34203   0  7:09PM ttys000    0:00.00 grep node
sy@yoonsoyeonui-MacBookPro kibana % 
[1]  + exit 1     nohup bin/kibana

 

확인

http://localhost:5601/app/kibana

or http://[server.host]:5601/app/kibana

 


 

Reference

Elasticsearch : http://libqa.com/wiki/803

Kibana : http://libqa.com/wiki/808

Logstash : http://libqa.com/wiki/809

ELK : https://oblab.tistory.com/5

반응형
Comments