elasticsearch-river-jdbc

整理下elasticsearch-river-jdbc插件的用法,希望对大家有帮助。

环境:window + mysql 

首先从介绍安装开始

1.1:es version 0.20+ (使用0.20+以上版本的) 

cd D:\elasticsearch-0.20.5\bin

plugin -url http://bit.ly/Yp2Drj -install river-jdbc
1.2:es version  0.90.0 Beta1+ 
cd D:\elasticsearch-0.20.5\bin

plugin -url http://bit.ly/145e9Ly -install river-jdbc


经测试,以上命令无效。只有自己下载jar包 https://bintray.com/pkg/show/general/jprante/elasticsearch-plugins/elasticsearch-river-jdbc

2:放一个mysql-jdbc连接jar包到lib目录下

3:创建_river

http://localhost:9200/_river/my_jdbc_river/_meta

{
"type": "jdbc",
  "jdbc":{
     "strategy":"simple",
     "driver":"com.mysql.jdbc.Driver",
    "url":"jdbc:mysql://localhost:3306/yb_kw",
     "user":"",
     "password":"",
     "sql":"select * from sort",
     "sqlparams":null,
     "poll" : "1h",
     "rounding" : null,
     "scale" : 0,
     "autocommit" : false,
     "fetchsize" : 10,
     "max_rows" : 0,
     "max_retries" : 3,
     "max_retries_wait":"10s",
     "locale" : Locale.getDefault().toLanguageTag(),
     "digesting" : true,
     "acksql" : null,
     "acksqlparams" : null
     
   },
  "index": {
     "index" : "gindex",
     "type" : "gindex",
     "bulk_size" : 100,
     "max_bulk_requests" : 30,
     "index_settings" : null,
     "type_mapping" : null,
     "versioning" : false,
     "acknowledge" : false
   }

}


本文出自: https://github.com/jprante/elasticsearch-river-jdbc/wiki/JDBC-River-parameters

待续……

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值