본문 바로가기

DevOps __

ELK 설치 및 실행

ELK 구축서버 생성하기 ( CPU : 2core , RAM : 4GB 이상) - 권장사양 안될 시 구동안됨. 

AWS EC2 -  CentOS 7.6 (t2.medium )  storage : 40GB

https://www.elastic.co/downloads   # Elastic Stack 최신버전

Elasticsearch xx , Logstash xx , Kibana xx   ( 최신 )

 

ELK

& OS 기본 셋팅 및 JDK 설치

  • yum -y update
  • yum -y install epel-release
  • setenforce 0
  • yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel

& Elasticsearch 

Elasticsearch는 루씬 기반의 검색 엔진이다.

HTTP 웹 인터페이스와 스키마에서 자유로운 JSON 문서와 함께 분산 멀티테넌트 지원 전문 검색 엔진을 제공한다.

Elasticsearch는 JAVA로 개발되어 있으며 아파치 라이선스 조항에 의거하여 오픈 소스로 출시되어 있다.

  • rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch    # PGP 암호화 통신을 위한 공개 서명키 등록
  • vim /etc/yum.repos.d/elasticsearch.repo                                        # 저장소 이용을 위한 elasticsearch.repo 파일 생성

       

  • yum -y install elasticsearch
  • systemctl start elasticsearch
  • systemctl enable elasticsearch

& Logstash 

실시간 파이프라인 기능을 가진 오픈소스 데이터 수집 엔진.

서로 다른 소스의 데이터를 탄력적으로 통합하고 사용자가 선택한 목적지로 데이터를 정규화 할 수 있다.

& Kibana

데이터를 시각화 작업을 통해 보여주는 오픈소스 플랫폼

자바스크립트로 작성.

& Nginx : Kibana proxy settings

  • yum -y install nginx
  • vim /etc/nginx/conf.d/proxy.conf

     

  • systemctl start nginx
  • systemctl enable nginx

LEPM + filebeat 서버

CentOS 7.6 , nginx 1.12.2 , php 5.4 , mariadb 5.5 , filebeat 6.5.4

& OS 기본 셋팅

  • yum -y update
  • yum -y install epel-release

& Nginx

  • yum -y install nginx
  • vim /etc/nginx/conf.d/default.conf

server {
listen 80;
server_name localhost;

root html;
index index.html index.htm index.php;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

error_page 404 /404.html;

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

  • service start nginx
  • service enable nginx

& PHP

  • yum -y install php php-fpm php-mysql
  • vim /etc/php.ini  →  cgi.fix_pathinfo = 0
  • vim /etc/php-fpm.d/www.conf

          user = nginx

          group = nginx

          listen = /var/run/php-fpm/php-fpm.sock

  • systemctl start php-fpm
  • systemctl enable php-fpm

& mariaDB

  • yum -y install mariadb mariadb-server
  • systemctl start mariadb
  • systemctl enable mariadb
  • mysql_secure_installation

& filebeat

         paths:

              - /var/log/nginx/*

              - /var/log/mariadb/*

          ------- Logstash output ---------

          output.logstash:

               hosts: ["192.168.0.117:5044"]

  • systemctl start filebeat
  • systemctl enable filebeat

 

<script data-ad-client="ca-pub-1768459225312054" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

'DevOps __' 카테고리의 다른 글

Kubernetes - 구성  (0) 2020.04.22
GCP LB ssl offload  (0) 2019.11.04
Zabbix 설치 및 agent 구성  (0) 2019.11.04
Zabbix (Alert -> Slack)  (0) 2019.11.04
Zabbix (Alert -> Mail)  (0) 2019.11.04