Skip to content

Instantly share code, notes, and snippets.

@matt212
Last active July 11, 2017 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matt212/57e9d17b7afb98baadfca738d3173bd7 to your computer and use it in GitHub Desktop.
Save matt212/57e9d17b7afb98baadfca738d3173bd7 to your computer and use it in GitHub Desktop.
#!/bin/sh
DIR="/cygdrive/C/elasticsearch-jdbc-2.3.4.1/"
bin=${DIR}/../bin
lib=${DIR}/../lib
echo '{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:postgresql://localhost:5432/demodb?loglevel=0",
"user" : "postgres",
"password" : "abc123",
"sql" : "select * from srt",
"index_settings" : {
"index" : {
"number_of_shards" : 10
},
"elasticsearch" : {
"cluster" : "elasticsearch",
"host" : "localhost",
"port" : 9200
}
}
}
}
' | java \
-cp "C:\elasticsearch-jdbc-2.3.4.1\lib\*" \
-Dlog4j.configurationFile="C:\elasticsearch-jdbc-2.3.4.1\bin\log4j2.xml" org.xbib.tools.Runner org.xbib.tools.JDBCImporter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment