标签:backup rar aging search mfile mys node.js stdin type
官网下载:https://www.elastic.co/downloads/elasticsearch
github地址:https://github.com/mobz/elasticsearch-head,按照github上的说明执行命令可以完成安装(需要安装node.js环境)
下载地址:https://www.elastic.co/cn/downloads/logstash。解压后修改logstash 文件夹下Gemfile文件,将source改为:https://gems.ruby-china.org
进入logstash/bin,执行logstash-plugin install logstash-input-jdbc。
在bin目录下创建lib目录,放入mysql-connector-java.jar
在bin目录中新建jdbc.sql文件,加入和同步数据相关的sql语句
在config目录中新建logstash.conf文件,内容如下:
input {
stdin {
}
jdbc {
# mysql jdbc connection string to our backup databse
jdbc_connection_string => "jdbc:mysql://192.168.0.113:3306/telecom?characterEncoding=utf8"
# the user we wish to excute our statement as
jdbc_user => "root"
jdbc_password => "****"
# the path to our downloaded jdbc driver
jdbc_driver_library => "lib\mysql-connector-java-5.1.38.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_filepath => "jdbc.sql"
schedule => "* * * * *"
}
}
output {
elasticsearch {
hosts => ["192.168.0.113:9200"]
index => "索引名"
document_type => "索引类型名"
}
stdout {
codec => json_lines
}
}
进入bin目录,执行logstash.bat -f ../config/logstash.conf
搭建Elasticsearch服务环境并实现将与mysql数据的同步
标签:backup rar aging search mfile mys node.js stdin type
原文地址:https://www.cnblogs.com/DreamSeekerming/p/9314466.html