標籤:pat protoc www download log jar pass iba test
1.下載es
https://www.elastic.co/downloads/elasticsearch
修改 config 下elasticsearch.yml ip和連接埠等配置
2.下載kibana
https://www.elastic.co/downloads/kibana
修改 config 下kibana.yml ip和連接埠es等配置
3.下載logstash
https://www.elastic.co/downloads/logstash
下載jar mysql-connector-java-5.1.47.jar
config下添加檔案jdbc.conf
input { stdin { } jdbc { # mysql jdbc connection string to our backup databse jdbc_connection_string => "jdbc:mysql://localhost:3306/testguize" # the user we wish to excute our statement as jdbc_user => "chai" jdbc_password => "chai" # the path to our downloaded jdbc driver jdbc_driver_library => "E:\elasticsearch6.1\mysql-connector-java-5.1.26.jar" # the name of the driver class for mysql jdbc_driver_class => "com.mysql.jdbc.Driver" jdbc_paging_enabled => "true" jdbc_page_size => "50000" statement => "select * from user" # statement_filepath => "F:\FullText\logstash-6.3.2\config\jdbc.sql" schedule => "* * * * *" type => "lxuser" }}filter { json { source => "message" remove_field => ["message"] }}output { elasticsearch { hosts => "192.168.0.61:9200" # port => "9200" # protocol => "http" index => "mysql" document_id => "%{id}" # cluster => "fulltext-application" } stdout { codec => json_lines }}
4.啟動es
elasticsearch 下載目錄bin目錄下elasticsearch.bat
5. logstash bin目錄下
執行命令 logstash.bat -f ..\config\jdbc.conf6.啟動 kibana 測試es串連
es同步mysql同步