본문 바로가기

설정

elasticsearch 설치와 kibana설치

아 우울하다..

오늘 직장내 괴롭힘 금지법이 첫 시행일이라고 하는데.

작년에 시행됐으면 얼마나 좋았을까? 난 스트레스 받다가 뇌졸중도 왔는데.

아무튼 그런고로 엘라스틱 서치 설치하기가 존나 싫었다.

대충 아무거나 보고 따라함.

잘 설치 됨.

 

 

 

ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ이글이 엘라스틱 서치 설치 글이야 뇌졸중글이야? 

...더보기
curl -XGET https://atlas-search.interpark.com 으로 접속

 

 

 

참고

(https://linuxize.com/post/how-to-install-elasticsearch-on-centos-7/)

 

 

 


잘 살다가,

키바나를 설치하게 되었는데

키바나 고버전을 설치하면 elasticsearch와 버전이 맞지 않음.

yum.repos.d에 elasticsearch 6버전 대를 지정하고 설치해도 키바나 고버전을 설치하면 elasticsearch도 7을 받아버림.

지우고 다시 설치하니 계속 뜨지 않았음.

왜인지 모르겠고 ㅠㅠ

 

일단 echo $JAVA_HOME 하니까 패스 못잡아주고있길래

 

https://blog.hanumoka.net/2018/04/30/centOs-20180430-centos-install-jdk/

 

이거 보고 따라했음

 

 

 

 

 

 

https://github.com/elastic/elasticsearch/issues/10671#issuecomment-127457647

 

Starts and stops a single elasticsearch instance on this system (code=exited, status=3) · Issue #10671 · elastic/elasticsearch

$ sudo service elasticsearch start $ sudo service elasticsearch status ● elasticsearch.service - Starts and stops a single elasticsearch instance on this system Loaded: loaded (/usr/lib/systemd/sys...

github.com

이 답변 보고 해결하였다.

 

I encountered the same issue and finally figured it out that in the process of upgrading elasticsearch on centos (linux) my elasticsearch user and group was recreated and had a new user and group id. The logs and data directories and files within them were still owned by the old user and thus elasticsearch kept failing without giving a clue. Here is the command line that fixed it:

sudo chown -R elasticsearch:elasticsearch /var/lib/elasticsearch/

 

 

 

 

 


kibana설치를 하기위해 읽어보니

 

Kibana should be configured to run against an Elasticsearch node of the same version. This is the officially supported configuration.

Running different major version releases of Kibana and Elasticsearch (e.g. Kibana 5.x and Elasticsearch 2.x) is not supported, nor is running a minor version of Kibana that is newer than the version of Elasticsearch (e.g. Kibana 5.1 and Elasticsearch 5.0).

Running a minor version of Elasticsearch that is higher than Kibana will generally work in order to facilitate an upgrade process where Elasticsearch is upgraded first (e.g. Kibana 5.0 and Elasticsearch 5.1). In this configuration, a warning will be logged on Kibana server startup, so it’s only meant to be temporary until Kibana is upgraded to the same version as Elasticsearch.

Running different patch version releases of Kibana and Elasticsearch (e.g. Kibana 5.0.0 and Elasticsearch 5.0.1) is generally supported, though we encourage users to run the same versions of Kibana and Elasticsearch down to the patch version.

 

아무거나 설치하면 안되네 https://www.elastic.co/guide/en/kibana/7.2/setup.html

https://www.elastic.co/guide/en/kibana/6.8/index.html 

elasticsearch 가 6.8.1이니까 kibana는 6.8로 설치하기로 한드아

 

 

이거 보고 맞는 kibana 버전 설치함

https://unix.stackexchange.com/a/151690 

repoquery
If you're ever unsure that you're constructing the arguments right you can consult with repoquery too.

$ sudo yum install yum-utils  # (to get `repoquery`)
$ repoquery --show-duplicates httpd-2.4*
httpd-0:2.4.6-6.fc20.x86_64
httpd-0:2.4.10-1.fc20.x86_64

지울때,

이게 필요한지는 모르겠으나, systemctl 중 서비스 지우는 방법 (https://superuser.com/questions/513159/how-to-remove-systemd-services)

systemctl stop [servicename]
systemctl disable [servicename]
rm /etc/systemd/system/[servicename]
rm /etc/systemd/system/[servicename] symlinks that might be related
systemctl daemon-reload
systemctl reset-failed

 

kibana가 아마 서버에선 실행되고잇는듯한데 내 pc에서 접근하면 안되니까, 확인해봤음.

 

sudo tcpdump -n icmp

 

11:09:46.220976 IP 서버IP > 내 PC : ICMP host 서버 IP unreachable - admin prohibited, length 60

 

이런 에러가 떠서 방화벽을 열어줘야하는걸로!

 

firewall-cmd --permanent --zone=public --add-port=5601/tcp

# 5601은 kibana default port


firewall-cmd --reload
# reload

 

kibana 잘 돌아간드아~~

 

(https://www.lesstif.com/pages/viewpage.action?pageId=22053128)

 

 


kibana를 elasticsearch와 맞춰서 설치해야하는데 어째 계속 문제가 있었음.

log 파일도 쓰여지지 않는것같았음.

# (https://github.com/elastic/kibana/issues/13153#issuecomment-318415734)

journalctl -fu kibana.service

이렇게 상태 확인 할 수 있었음.

일단 강제로 log 파일을 만들수있는지 봐야겠음.

 

-> 만들었음. 걍 강제로 만드니 쓰여짐. chown kibana:kibana /var/log/kibana.log 도 해줌 ㅇㅇ 

 

문제를 보니까 

 

ValidationError: child "elasticsearch" fails because [child "hosts" fails because ["hosts" at position 0 fails because ["0" must be a string]]]

 

이런 에러였는데 

(https://discuss.elastic.co/t/kibana-server-not-ready-yet-validationerror-child-elasticsearch-fails-because-child-hosts-fails-because-hosts-at-position-0-fails-because-0-must-be-a-string/168925/2) 아마 내가 kibana.yml을 잘못 세팅한것같다.

 

참고로 "kibana elasticsearch.hosts multiple" 이라고 검색하면 (https://www.elastic.co/guide/en/kibana/current/production.html#high-availability)이런거 나오는데. 여기부분을 바꿔줘야함.

 

그래서 대충 

 

elasticsearch.hosts: ["호스트1", "호스트2", "호스트3"]

일케 적어주고 나니까 0 must be a valid uri with a scheme matching the http|https pattern 이게 1 2 3 다 하라고 되어있었음.

 

http://호스트1:9200 으로 변경하고~