私はelasticsearch version-6.1.1を使用しています.私は方解石フレームワークプロジェクトをダウンロードし、( https://calcite.apache.org/docs/tutorial.html )のチュートリアルに従って自分のマシンでビルドし、接続しようとしたときにここに示されているように、カルサイトのElasticsearch2adaptorを使用してelasticsearchに接続します( https://calcite.apache.org/docs/elasticsearch_adapter.html )。次のエラーエラーが発生しています :
*E:\calcite\elasticsearch2>sqlline
sqlline version 1.3.0
sqlline> !connect jdbc:calcite:model=target/test-classes/mymodel.json admin admin
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Connecting to jdbc:calcite:model=target/test-classes/mymodel.json
java.lang.RuntimeException: Error instantiating JsonCustomSchema(name=elasticsearch)
at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:275)
at org.apache.calcite.model.JsonCustomSchema.accept(JsonCustomSchema.java:45)
at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:196)
at org.apache.calcite.model.ModelHandler.<init>(ModelHandler.java:88)
at org.apache.calcite.jdbc.Driver$1.onConnectionInit(Driver.java:104)
at org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:139)
at sqlline.DatabaseConnection.connect(DatabaseConnection.java:156)
at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:204)
at sqlline.Commands.connect(Commands.java:1095)
at sqlline.Commands.connect(Commands.java:1001)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:38)
at sqlline.SqlLine.dispatch(SqlLine.java:791)
at sqlline.SqlLine.begin(SqlLine.java:668)
at sqlline.SqlLine.start(SqlLine.java:373)
at sqlline.SqlLine.main(SqlLine.java:265)
Caused by: java.lang.RuntimeException: ***Cannot connect to any elasticsearch nodes***
at org.apache.calcite.adapter.elasticsearch2.Elasticsearch2Schema.open(Elasticsearch2Schema.java:123)
at org.apache.calcite.adapter.elasticsearch2.Elasticsearch2Schema.<init>(Elasticsearch2Schema.java:73)
at org.apache.calcite.adapter.elasticsearch2.Elasticsearch2SchemaFactory.create(Elasticsearch2SchemaFactory.java:56)
at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:270)
... 18 more*
これは mymodel.json ファイルです:
{
"version":"1.0",
"defaultSchema":"elasticsearch",
"schemas": [
{
"type" : "custom",
"name" : "elasticsearch",
"factory" : "org.apache.calcite.adapter.elasticsearch2.Elasticsearch2SchemaFactory",
"operand" : {
"coordinates" : "{'127.0.0.1':9300}",
"userConfig" : "{'bulk.flush.max.actions':10 , 'bulk.flush.max.size.mb': 1}",
"index" : "movies"
}
}
]
}