[ASHOKA]
asoka / 2018. 2. 2. 11:25 / →[ELK]

 [MariaDB 설치]


%참고사이트  


 http://altkeycode.tistory.com/6


   https://downloads.mariadb.org/mariadb/repositories/#mirror=kaist&distro=CentOS&distro_release=centos7-amd64--centos7&version=10.2


1. Test user 생성


2. Test database 생성


    


[Logstash 연동]


1. Mariadb Connector Download


http://xbib.org/repository/org/xbib/elasticsearch/importer/elasticsearch-jdbc/2.3.4.1/  elasti사이트에서 csearch-jdbc-2.3.4.1-dist.zip 다운로드


2. elasticsearch-jdbc-2.3.4.1-dist\elasticsearch-jdbc-2.3.4.1\lib에서 mysql-connector-java-5.1.12.jar 확인


3. Centos 특정 디렉토리에 Copy                  


    mysql-connector-java-5.1.12.jar -> "/usr/share/java/mysql-connector-java-5.1.12.jar”


4. Logstash Configuration 


 conf 위치 -> /etc/logstash/conf.d/logstash.conf




input {


  jdbc {


    jdbc_driver_library => "./usr/share/java/mysql-connector-java-5.1.38.jar"


    jdbc_driver_class => "com.mysql.jdbc.Driver"


    jdbc_connection_string => "jdbc:mysql://192.168.0.6:3306/elkDB"


    jdbc_pool_timeout => 3000


    jdbc_paging_enabled => true


    jdbc_page_size => 100000


    jdbc_user => "elk"


    jdbc_password =>"elk"


    schedule => "* * * * *"


    #tracking_column_typ => "numeric"


    #use_column_value => true


    #tracking_column => CREATE_DATE


    #charset => "UTF-8"


    #parameters => { "tracking_date" => "create_date" }


    statement => "SELECT * FROM tb_test_table"


  }


}


filter {


}


output {


    elasticsearch {


        hosts => "localhost:9200"


        index => "elk"


    }


    stdout {


       codec => rubydebug


    }


}




위와 같이 정의 후


logstash restart를 수행


binding 에러발생시 


/var/log/logstash 로그 확인 진행



[참고사이트]

http://peung.tistory.com/13


https://vvhiteboard.github.io/general/2017/11/19/elasticsearch-ELK_example1/

http://digndig.kr/elasticsearch/756/

https://discuss.elastic.co/t/logstash-mariadb-to-elasticsearch-no-error-but-doesnt-load/95127

https://www.elastic.co/guide/en/logstash/5.2/plugins-inputs-jdbc.html

https://discuss.elastic.co/t/jdbc-output-plugin/86833

http://peung.tistory.com/13 (logstash JDBC input plugin 설명)

http://blog.naver.com/PostView.nhn?blogId=hanajava&logNo=221007040292&redirect=Dlog&widgetTypeCall=true



'→[ELK]' 카테고리의 다른 글

ELK 설치  (0) 2018.02.02
asoka / 2018. 2. 2. 11:22 / →[ELK]

ELK 설치


[설치환경]     


1. VirtualBox(-5.2.2-119230)에 CentOS(-7-x86_64-DVD-1708.iso) 


% 참고 사이트


http://richellin.tistory.com/3


https://m.blog.naver.com/PostView.nhn?blogId=jkssleeky&logNo=220795556640&proxyReferer=https%3A%2F%2Fwww.google.co.kr%2F




2. CentOS Xwindow 설치 


% 참고 사이트 


http://www.itzgeek.com/how-tos/linux/centos-how-tos/install-gnome-gui-on-centos-7-rhel-7.html    


   yum update && yum upgrade


   yum groupinstall "GNOME Desktop" "Graphical Administration Tools"


   ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target




3. CentsOS Java 설치


  http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html


  yum install  jre-8u91-linux-x64.rpm 


  rpm -Uvh jre-8u91-linux-x64.rpm


 


[Elasticsearch 설치]


1. elastic site에서 최신버젼 다운로드


wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.0.rpm


2. rpm 자동설치 및 실행


$>rpm -ivh elasticsearch-6.1.0.rpm 


$> systemctl enable elasticsearch


$> systemctl start elasticsearch


$> systemctl status elasticsearch


$> systemctl stop elasticsearch


%binary 확인 (/usr/share/elasticsearch/bin) 


%default 저장소 




[Kibana 설치]


1. elastic site에서 최신버젼 다운로드


$> wget https://artifacts.elastic.co/downloads/kibana/kibana-6.1.0-x86_64.rpm


$> rpm -ivh kibana-6.1.0-x86_64.rpm


$> systemctl enable kibana


$> systemctl start kibana


$> systemctl status kibana


$> systemctl stop kibana


%binary 확인 (/usr/share/kibana/bin) 




2.  브라우저에서 Kibana UI 확인 


http://localhost:5601 



이때 접속이 안될 경우 Centos 방확벽  해제 및 kibana Ip Config 수정 (0.0.0.0)


$> systemctl status firewalld 


$> systemctl stop firewalld


$> systemctl disable firewalld 




[logstash 설치]


1. elastic site에서 최신버젼 다운로드


$> wget https://artifacts.elastic.co/downloads/logstash/logstash-6.1.0.rpm


$> rpm -ivh logstash-6.1.0.rpm


$> systemctl enable logstash


$> systemctl start logstash


$> systemctl status logstash


$> systemctl stop logstash


%binary 확인 (/usr/share/logstash/bin) 


%conf.d 및 Data file Path 확인 (/etc/logstash/logstash.yml 참조) 


'→[ELK]' 카테고리의 다른 글

Mariadb & Logstash 연동  (0) 2018.02.02
© 2015 asoka in [ASHOKA]
Designed by DH / Powered by Tistory
/ /