ES学习(三)使用JDBC importer

ES学习(三)使用JDBC importer

批量导入的方式我所知道的有bulk api,还有插件river,以及以下需要提到的JDBC importer

JDBC importer 是第三方并不是个插件

一.下载

从https://github.com/jprante/elasticsearch-jdbc下载对应es的版本,本例里面使用的版本为2.3.3.1

命令:

wget http://xbib.org/repository/org/xbib/elasticsearch/importer/elasticsearch-jdbc/2.3.3.1/elasticsearch-jdbc-2.3.3.1-dist.zip

ES学习(三)使用JDBC importer_第1张图片

二.解压

命令:unzip elasticsearch-jdbc-2.3.3.1-dist.zip

三.配置环境变量

vim /etc/profile
添加export JDBC_IMPORTER_HOME=/home/judy/Desktop/elasticsearch-jdbc-2.3.3.1


ES学习(三)使用JDBC importer_第2张图片


使环境生效

命令:

source /etc/profile


四.下载驱动sql server的驱动到 lib下

下载地址:https://www.microsoft.com/zh-CN/download/details.aspx?id=11774

五.建立.sh

ES学习(三)使用JDBC importer_第3张图片

执行即可

More:https://github.com/jprante/elasticsearch-jdbc

你可能感兴趣的:(ES学习(三)使用JDBC importer)