Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use elk to synchronize MySQL data in Windows

2025-02-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article shows you how to use elk in Windows to synchronize MySQL data in real time. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Install and deploy Logstash

Then what is useful here are JDBC type input and es type output, all the details are reflected in a configuration file. Before doing this configuration file, we need to download a JDBC driver for Java from the Internet. I am connected to the Mysql database here, so I downloaded mysql-connector-java-5.1.44-bin.jar. There is no way to give the link here, please download it yourself. After downloading, put it under C:\ logstash\ bin.

Then, under C:\ logstash\ bin, create a text file and write the following code.

Input {stdin {} jdbc {jdbc_connection_string = > "jdbc:mysql://localhost:3306/ your database name" jdbc_user = > "your database user name" jdbc_password = > "your database password" jdbc_driver_library = > "C:/logstash/bin/mysql-connector-java-5.1.44-bin.jar" jdbc_driver_class = > "com" .mysql.jdbc.Driver "jdbc_paging_enabled = >" true "jdbc_page_size = >" 50000 "statement = >" SELECT id (primary key) Other contents FROM your table "schedule = >" * * "} output {stdout {codec = > json_lines} elasticsearch {hosts = >" localhost:9200 "index = >" the index name you want to create "document_type = >" the type of index you want to create "document_id = >"% {id} "}}

Rename the txt file with the suffix, mysqltoes.conf, and then, as before, put the cd in cmd into the bin folder. Just run logstash-f mysqltoes.conf.

When you see the fields in your database appear one by one on the small black screen, it means that the data has been imported into ES.

And then you can check it out in Kibana.

The above is how to use elk in Windows to synchronize MySQL data in real time. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report