elasticsearch-jdbc
elasticsearch-jdbc copied to clipboard
The script won't start
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
I have the same issue. Did you solve it?
You are missing a \ after java command.
Something like
/opt/jdk1.8.0_101/bin/java \
-cp "${lib}/*" \