#!/bin/sh
bin=/Users/yan/bp/elasticsearch-2.3.2/bin
lib=/Users/yan/bp/elasticsearch-2.3.2/lib
echo '
{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://115.28.56.21/beta_camus_sys?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull",
"user" : "beta",
"password" : "bp2015beta",
"sql" : "select * from org_org",
"index" : "index-bp",
"type" : "org_org",
"elasticsearch" : {
"cluster" : "bp",
"host" : "localhost",
"port" : 9200
}
}
}
' | java \
-cp "${lib}/*" \
-Dlog4j.configurationFile=${bin}/log4j2.xml \
org.xbib.tools.Runner \
org.xbib.tools.JDBCImporter
上面是Elasticsearch-jDBC的sh配置文件,运行后出现错误
错误: 找不到或无法加载主类 org.xbib.tools.Runner
bin=/Users/yan/bp/elasticsearch-2.3.2/bin
lib=/Users/yan/bp/elasticsearch-2.3.2/lib
echo '
{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://115.28.56.21/beta_camus_sys?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull",
"user" : "beta",
"password" : "bp2015beta",
"sql" : "select * from org_org",
"index" : "index-bp",
"type" : "org_org",
"elasticsearch" : {
"cluster" : "bp",
"host" : "localhost",
"port" : 9200
}
}
}
' | java \
-cp "${lib}/*" \
-Dlog4j.configurationFile=${bin}/log4j2.xml \
org.xbib.tools.Runner \
org.xbib.tools.JDBCImporter
上面是Elasticsearch-jDBC的sh配置文件,运行后出现错误
错误: 找不到或无法加载主类 org.xbib.tools.Runner
4 个回复
EnglishVillage - ES
赞同来自:
lib=/Users/yan/bp/elasticsearch-2.3.2/lib
z这个并不是es的路径,改成jdbc的路径,就OK了.
但是还是会出现另外一个问题,就是数据好像不能导入到es中...
elsnewer
赞同来自:
Error: Could not find or load main class org.xbib.tools.Runner
JennyJoker - 90后IT菜鸟
赞同来自:
JennyJoker - 90后IT菜鸟
赞同来自: