[ELK stack] 2. CentOS에서 Kibana 설치 및 원격 접속 설정

So yeong Choe·2022년 1월 31일
0

ELK stack

목록 보기
2/2
post-thumbnail

엘라스틱 서치를 설치했으니 이제 키바나를 설치해보려고 한다.

elastic 공식 사이트에서 설치 파일과 함께 자세한 설치 가이드를 제공하고 있으니 참고하자.

🔗 www.elastic.co/kr/downloads/kibana

📌 1. Kibana 설치

필자는 익숙하고 간단한 방법인 rpm 수동 설치를 사용했다.

# 설치파일 다운로드
wget https://artifacts.elastic.co/downloads/kibana/kibana-7.9.2-x86_64.rpm

# SHA checksums 검사
shasum -a 512 kibana-7.9.2-x86_64.rpm

# rpm 설치
sudo rpm --install kibana-7.9.2-x86_64.r

끝. 너무 간단하다 🍳

본인의 로컬 환경에 설치했다면 바로 구동시킬 수 있다.

방법 1) 실행파일 호출

/usr/share/kibana/bin/kibana

방법 2) systemd 활용

kibana를 자주 올리고 내려야한다면 이 방법이 훨씬 간단하다.

# 키바나 구동
sudo systemctl start kibana.service
 
# 키바나 재구동
sudo systemctl restart kibana.service
 
# 키바나 중지
sudo systemctl stop kibana.service

이제 웹 브라우저로 본인의 로컬호스트에 접속하면 kibana 웹페이지를 볼 수 있다.

설정을 변경하지 않았다면 default 포트번호는 5601이다.

http://localhost:5601


📌 2. 원격접속 설정

로컬호스트에서만 키바나를 사용할 것이라면 설정을 따로 변경할 필요가 없지만, 일반적으로 키바나는 서버에 설치한 후 외부에서 원격접속으로 접근하는 경우가 많다. (특히 리눅스환경이라면)

외부에서도 웹페이지로 키바나에 접속할 수 있도록 설정을 변경해보자.

우리가 변경해야할 설정 파일의 경로는 아래와 같다.

sudo vi /etc/kibana/kibana.yml

끝 없는 주석의 나열에 당황하지 말자. 우리가 바꿀 설정은 딱 하나이다!

# Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values.
# The default is 'localhost', which usually means remote machines will not be able to connect.
# To allow connections from remote users, set this parameter to a non-loopback address.
# server.host: "localhost"

아래처럼 server.host의 값을 "0.0.0.0"으로 바꾼 뒤 주석을 해제하면 된다.

모든 IP로부터의 접근을 허용하겠다는 의미이다.

# Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values.
# The default is 'localhost', which usually means remote machines will not be able to connect.
# To allow connections from remote users, set this parameter to a non-loopback address.
server.host: "0.0.0.0"

yml 파일을 저장하고 키바나를 재구동하면, 웹 브라우저를 통해 정상적으로 접근할 수 있다.
포트 번호는 변경하지 않았으므로 여전히 5601.

systemctl restart kibana.service

오늘도 무사히 환경 세팅을 완료한 당신에게 박수를 보낸다. 👏
profile
IT 공부하는 블로그

0개의 댓글