[英]How to connect multiple nodes located on different server with the elasticsearch java api?
這是我為群集“ elasticsearch”設置2個節點的方式:-節點1存儲在ip 10.80.10.183端口9200上-節點2存儲在ip 10.80.10.184端口9200上
我想知道我必須在方法addTransportAdress中使用端口9300指定的地址,因為我希望如果節點1斷開,則節點2仍可訪問。
您應該在傳輸客戶端中指定所有節點,如下所示:
TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)
.addTransportAddress(new TransportAddress(InetAddress.getByName("10.80.10.183"), 9300))
.addTransportAddress(new TransportAddress(InetAddress.getByName("10.80.10.184"), 9300));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.