jprante / elasticsearch-jdbc

JDBC importer for Elasticsearch
Apache License 2.0
2.84k stars 710 forks source link

Connecting to mysql on windows #799

Open tenderwinner opened 8 years ago

tenderwinner commented 8 years ago

Hello,

I'm trying to import data into elasticsearch 2.2 on windows 7. I have XAMPP installed. elasticsearch-jdbc-2.2.0.1 My code in script.bat looks like: `@echo off

set LIB="E:\elastic\elasticsearch-jdbc-2.2.0.1\lib*" set BIN="E:\elastic\elasticsearch-jdbc-2.2.0.1\bin"

REM ??? echo {^ "type" : "jdbc",^ "jdbc" : {^ "url" : "jdbc:mysql://localhost:3306/lyricsyii2",^ "user" : "root",^ "password" : "",^ "sql" : "select artistid as _id, artist_name, short_artist_name from artists",^ "treat_binary_as_string" : true,^ "elasticsearch" : {^ "cluster" : "elasticsearch",^ "host" : "localhost",^ "port" : 9300^ },^ "index" : "artists",^ "type" : "artist"^ }^ } "%JAVA_HOME%\bin\java" -cp "%LIB%" -Dlog4j.configurationFile="%BIN%\log4j2.xml" "org.xbib.tools.Runner" "org.xbib.tools.JDBCImporter"`

but when I run it nothing appears in index and it just continue running with no result till i stop the script with ctrl+c

Log is empty

Please advise what is wrong with script or where should I look to find the reason of such behaviour

tenderwinner commented 8 years ago

forgot to put "|" between text and java

chsnake commented 8 years ago

I encounter the same problem,do you solve it?

tenderwinner commented 8 years ago

Hi, yes, I had syntax error, you should put "|" between } and %JAVA_HOME%

chsnake commented 8 years ago

yes,this is the root cause of the problem.Thanks.