elasticsearch-jdbc icon indicating copy to clipboard operation
elasticsearch-jdbc copied to clipboard

The script won't start

Open hanlu09 opened this issue 8 years ago • 2 comments

eg: DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" bin=/usr/local/elasticsearch-jdbc-2.3.4.1/bin lib=/usr/local/elasticsearch-jdbc-2.3.4.1/lib echo '{ "type" : "jdbc", "jdbc" : { "url" : "jdbc:mysql://192.168.30.149:3306/test", "user" : "root", "password" : "root", "sql" : "select * from person_info", "index" : "myindex", "type" : "mytype", "elasticsearch" : { "cluster":"hanlu-application" "host":"192.168.30.219", "port":"9300" } } }' | java
-cp "${lib}/*"
-Dlog4j.configurationFile=${bin}/log4j2.xml
org.xbib.tools.Runner
org.xbib.tools.JDBCImporter

issues:./mysql-import-es.sh: line 20: -cp: command not found /log4j2.xml: 没有那个文件或目录-Dlog4j.configurationFile=/usr/local/elasticsearch-jdbc-2.3.4.1/bin ./mysql-import-es.sh: line 22: org.xbib.tools.Runner: command not found : command not foundh: line 23: org.xbib.tools.JDBCImporter

hanlu09 avatar Mar 27 '17 05:03 hanlu09

I have the same issue. Did you solve it?

PizeZhou avatar Mar 30 '17 09:03 PizeZhou

You are missing a \ after java command.

Something like

 /opt/jdk1.8.0_101/bin/java \
    -cp "${lib}/*" \

sanaulla123 avatar Apr 10 '17 10:04 sanaulla123