2017-06-22 267 views
0

我試圖用YCSB加載一些數據到彈性搜索使用YCSB,但我經常會得到一個錯誤NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{gdVShcjUToSDe3eJkHJNxw}{192.168.3.87}{192.168.3.87:9300}]]上彈性搜索

這裏是我的彈性搜索節點配置。

cluster.name: my-application 
node.name: reconf-6 
network.host: 192.168.3.87 
http.port: 9200 
transport.tcp.port: 9300 
transport.host: 0.0.0.0 
discovery.zen.ping.unicast.hosts: ["elasticsearch-1"] 
path.data: data_mount/es 
path.logs: data_mount/es 

我首先啓動了10個這樣的節點,通過curl -XGET 'http://elasticsearch-1:9200/_cluster/state?pretty'我可以看到10個節點在集羣中。

然後我試着在遠程模式下運行YCSB。然後,它報道的例外:

Exception in thread "Thread-3" NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{gdVShcjUToSDe3eJkHJNxw}{192.168.3.87}{192.168.3.87:9300}]] 
     at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:344) 
     at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:242) 
     at org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:59) 
     at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:356) 
     at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:403) 
     at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:392) 
     at org.elasticsearch.client.support.AbstractClient$IndicesAdmin.execute(AbstractClient.java:1220) 
     at org.elasticsearch.client.support.AbstractClient$IndicesAdmin.exists(AbstractClient.java:1242) 
     at com.yahoo.ycsb.db.elasticsearch5.ElasticsearchClient.init(ElasticsearchClient.java:142) 
     at com.yahoo.ycsb.DBWrapper.init(DBWrapper.java:85) 
     at com.yahoo.ycsb.ClientThread.run(Client.java:415) 
     at java.lang.Thread.run(Thread.java:748) 

在YCSB代碼啓動客戶端的部分如下:

if (remoteMode) { 
    settings.put("client.transport.sniff", true) 
     .put("client.transport.ignore_cluster_name", false) 
     .put("client.transport.ping_timeout", "30s") 
     .put("client.transport.nodes_sampler_interval", "30s"); 
    // Default it to localhost:9300 
    String[] nodeList = props.getProperty("es.hosts.list", DEFAULT_REMOTE_HOST).split(","); 
    System.out.println("Elasticsearch Remote Hosts = " + props.getProperty("es.hosts.list", DEFAULT_REMOTE_HOST)); 
    TransportClient tClient = new PreBuiltTransportClient(settings.build()); 
    for (String h : nodeList) { 
    String[] nodes = h.split(":"); 
    try { 
     tClient.addTransportAddress(new InetSocketTransportAddress(
      InetAddress.getByName(nodes[0]), 
      Integer.parseInt(nodes[1]) 
    )); 
    } catch (NumberFormatException e) { 
     throw new IllegalArgumentException("Unable to parse port number.", e); 
    } catch (UnknownHostException e) { 
     throw new IllegalArgumentException("Unable to Identify host.", e); 
    } 
    } 
    client = tClient; 
} 

回答

0

你有沒有試過在ES配置文件註釋掉transport.host?它將傳輸層綁定到本地主機,並且您已通過network.host指定了本機的IP。 (您需要重新啓動節點)

要測試哪個版本的ES?我看到你也對他們的github留下了評論,所以你已經知道它不適用於ES 5.x.x.原因是ES 5.x.x拒絕與以前版本的驅動程序連接。

我設法使它與version of risdenk一起工作。