es同步mysql同步

來源:互聯網
上載者:User

標籤: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同步

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.