2016-04-06 11 views
1

私はElasticsearchでTitan 1.0.0を使用しています。私はTitan(DynamoDBバックエンド付き)をEC2マシンで動作させています。Titan:別のマシンからElasticsearchに接続

私の主な目標は、Javaを使用して別のEC2マシンを介してTitanインスタンスに接続することです。

残念ながら私はこのマシンに接続できません。

My Titanインスタンスは、プロパティファイルを使用して設定されます。ここでElasticsearch構成の抜粋です:

# elasticsearch config 
index.search.backend=elasticsearch 
index.search.directory=/path/to/elasticsearch 
index.search.elasticsearch.interface=NODE 
index.search.elasticsearch.ext.node.data=true 
index.search.elasticsearch.ext.node.client=false 
index.search.elasticsearch.ext.node.local=false 

これは、データを保持する完全なノードを開始します。

他のマシンからこのノードのElasticsearchに接続します。私の設定このためのファイルがある:

storage.backend= com.amazon.titan.diskstorage.dynamodb.DynamoDBStoreManager 
storage.hostname=10.0.0.249 
storage.port=8182 

index.search.backend=elasticsearch 
index.search.elasticsearch.interface=TRANSPORT_CLIENT 
index.search.elasticsearch.ext.node.data=false 
index.search.elasticsearch.ext.node.client=true 
index.search.hostname=10.0.0.249:9200 


storage.dynamodb.client.endpoint=https://dynamodb.us-east-1.amazonaws.com 

## DynamoDB client configuration: credentials 
storage.dynamodb.client.credentials.class-name=com.amazonaws.auth.DefaultAWSCredentialsProviderChain 
storage.dynamodb.client.credentials.constructor-args= 

私はこのラインを通じてJavaを使用して接続しようとすると:

graph=TitanFactory.open("conf/dynamodb_remote.properties") 

私はというエラーを取得:

java.lang.IllegalArgumentException: Could not instantiate implementation: com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex 
    at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:55) 
    at com.thinkaurelius.titan.diskstorage.Backend.getImplementationClass(Backend.java:473) 
    at com.thinkaurelius.titan.diskstorage.Backend.getIndexes(Backend.java:460) 
    at com.thinkaurelius.titan.diskstorage.Backend.<init>(Backend.java:147) 
    at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.getBackend(GraphDatabaseConfiguration.java:1805) 
    at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.<init>(StandardTitanGraph.java:123) 
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94) 
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:62) 
    at com.thinkaurelius.titan.core.TitanFactory$open.call(Unknown Source) 
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) 
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110) 
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:122) 
    at groovysh_evaluate.run(groovysh_evaluate:3) 
    at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215) 
    at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:69) 
    at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:185) 
    at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:119) 
    at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:94) 
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) 
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324) 
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207) 
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:130) 
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:150) 
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:123) 
    at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:58) 
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) 
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324) 
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207) 
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:130) 
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:150) 
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:82) 
    at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215) 
    at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:144) 
    at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215) 
    at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:303) 
Caused by: java.lang.reflect.InvocationTargetException 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
    at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:44) 
    ... 44 more 
Caused by: org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [] 
    at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:279) 
    at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:198) 
    at org.elasticsearch.client.transport.support.InternalTransportClusterAdminClient.execute(InternalTransportClusterAdminClient.java:86) 
    at org.elasticsearch.client.support.AbstractClusterAdminClient.health(AbstractClusterAdminClient.java:127) 
    at org.elasticsearch.action.admin.cluster.health.ClusterHealthRequestBuilder.doExecute(ClusterHealthRequestBuilder.java:92) 
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:91) 
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:65) 
    at com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex.<init>(ElasticSearchIndex.java:201) 
    ... 49 more 

私はwgetを使用してチェックし、ポート9200と9201は動作していますが、9300は動作していないようです。おそらくそれが問題の原因です。

助けが必要ですか?タイタンの構成に基づいて

答えて

1

カップルの提案documentation

  1. index.search.hostnameはちょうどホスト名またはIPアドレスでなければなりません。ポートを含むべきではありません。
  2. index.search.portこれを指定する場合は、転送TCPポートに9300またはElasticsearchの値を使用する必要があります。
  3. index.search.elasticsearch.cluster-nameは、Elasticsearch設定のcluster.nameと一致する必要があります。

更新:これは私のために働いていたようです。私は接頭index.search.elasticsearch.ext...と、これらのプロパティを指定しようとしました

cluster.name: TitanElasticsearch 
network.name: u1401 
network.host: 192.168.14.101 
discovery.zen.ping.multicast.enabled: false 
discovery.zen.ping.unicast.hosts: ["192.168.14.101"] 
discovery.zen.minimum_master_nodes: 1 
node.name: u1401 
node.master: true 
node.data: true 
http.port: 9200 
transport.tcp.port: 9300 
path.data: ./db/mytitan/elasticsearch 

、交通:

storage.backend=berkeleyje 
storage.directory=../db/mytitan/berkeleyje 
index.search.backend=elasticsearch 
index.search.index-name=mytitan 
index.search.elasticsearch.interface=NODE 
index.search.conf-file=mytitan-elasticsearch.yml 

そして$TITAN_HOME/conf/mytitan-elasticsearch.ymlは正確に通常のES構成のようになります。$TITAN_HOME/conf/mytitan.propertiesで、私はこのようなインデックスのバックエンドを構成し前に注意したようにTCPポートが起動しませんでした。

+0

問題は、ポート「9300」が開かれていないことです。私はgremlin-serverマシン上で 'netstat'をチェックしましたが、開いていません。 「9200」と「9201」のみ。 –

+0

デフォルトでは9300-9400のポート範囲です。 'netstat -plent'を実行し、どのポートを使用しているのか把握するときに、ES javaプロセスをpidとマッチさせます。 –

+0

ESは2つのポート「9200」と「9201」を待ち受けています。彼らは両方ともHTTPリクエストを聞いています。私はこれがgremlin-serverを設定した方法と関係していると思います。どう思いますか? –

関連する問題