安装logstash-input-jdbc插件
发表于:2024-09-24 作者:千家信息网编辑
千家信息网最后更新 2024年09月24日,安装logstash-input-jdbc插件,实现数据的插入1.安装gemyum install gem -y2.替换ruby库(两种国内源+淘宝源)2.1.1替换为国内源gem sources -
千家信息网最后更新 2024年09月24日安装logstash-input-jdbc插件
安装logstash-input-jdbc插件,实现数据的插入
1.安装gem
yum install gem -y
2.替换ruby库(两种国内源+淘宝源)
2.1.1替换为国内源
gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/gem sources -l
2.1.2修改配置文件
cd /opt/inst/logstash722/vi Gemfile#修改Gemfile文件#source https://rubygems.org/httpsvi Gemfile.lockgems.ruby-china.com/vi Gemfile.lock#remote: https://rubygems.org/https://gems.ruby-china.com/
2.2 同上替换ruby为淘宝源(如果上述替换国内源不成功,可以换此方法)
gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/gem sources -l
由于修改ruby镜像库为淘宝库并没有成功,这里就需要修改Gemfile文件里面的数据源:
cd /opt/inst/logstash722/vi Gemfile#修改Gemfile文件#source https://rubygems.org/source "https://ruby.taobao.org"#remote: https://rubygems.org/remote: https://ruby.taobao.org
3.安装logstash-input-jdbc
3.1 到logstash的bin目录下运行下面的命令,查看可用的插件
cd bin./logstash-plugin list --verbose
3.2 上述操作看到可以使用的logstash-input-jdbc版本是4.3.3,安装JDBC
unzip logstash-input-jdbc-4.3.3.zipmv logstash-input-jdbc-4.3.3 /opt/inst/log_jdbc433cd log_jdbc433/
3.3 配置Gemfile文件
vi Gemfilesource 'https://gems.ruby-china.com/'
4.测试是否成功
4.1 提供数据
需要一个mysql驱动包,sql文件,以及conf配置文件
input { jdbc { # mysql jdbc connection string to our backup databse jdbc_connection_string => "jdbc:mysql://169.254.211.100:3306/test" # the user we wish to excute our statement as jdbc_user => "root" jdbc_password => "root" # the path to our downloaded jdbc driver jdbc_driver_library => "/opt/inst/logstash722/sql/mysql-connector-java-5.1.40-bin.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 => "/opt/inst/logstash722/sql/logs_20171206.sql" schedule => "*/1 * * * *" type => "jdbc" }}filter { json { source => "message" remove_field => ["message"] }}output { elasticsearch { hosts => "169.254.211.100:9200" index => "logs_20171206" document_id => "%{id}" } stdout { codec => json_lines }}
4.2 实现logstash把文件写进mysq数据库l中
cd /opt/inst/logstash722/bin./logstash -f /opt/logfiter/mysql.conf
http://169.254.211.100:5601/app/kibana#/dashboard/1e4f4310-c638-11e9-9ea7-f9ef9537f0f4?_g=(refreshInterval%3A(display%3AOff%2Cpause%3A!f%2Cvalue%3A0)%2Ctime%3A(from%3Anow-1y%2Cmode%3Aquick%2Cto%3Anow))
1566580763148
文件
数据
成功
配置
插件
淘宝
命令
宝库
数据库
数据源
此方法
版本
目录
镜像
面的
测试
运行
驱动
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
验证码识别服务器
深圳企多多网络技术有限公司
武警部队网络安全的体会
网络安全员工电脑带回家病毒
DBC2000改数据库
医院物流软件开发实践报告
用于直接复制数据库数据
为什么会弹出来音频服务器
数据库会话数
有关于网络安全的小品
末日豪劫3怎么入侵服务器
接口机能提高网络安全吗
sql数据库连接池
数据库实体定义
阿里商用服务器叫什么
db2导出数据库 导入
邮件服务器 加密
泉州创众互联网科技有限公司
国家网络安全专家组成员
四川互联网软件开发大概要多少钱
网络安全保护制度是哪种
北京美智多谋网络技术有限公司
宝山区营销软件开发优化价格
网络技术基础练习题
长沙新华网络技术学校
手机网络安全使用辨析
安宁网络安全委员会
盱眙天气预报软件开发
小鸟云服务器如何放行安全组
网络安全目标是什么_