假设我有一个包含符合主节点的节点,数据节点和协调节点的集群。当我初始化REST客户端时,我应该包括上述哪种节点类型?所有节点,只有数据节点,只有协调节点,或它们的某种组合?
例如:
RestClient restClient = RestClient.builder(
new HttpHost("master-eligible-node-1", 9200, "http"),
new HttpHost("master-eligible-node-2", 9200, "http"),
new HttpHost("master-eligible-node-3", 9200, "http")).build();
,或者
RestClient restClient = RestClient.builder(
new HttpHost("master-eligible-node-1", 9200, "http"),
new HttpHost("master-eligible-node-2", 9200, "http"),
...
new HttpHost("master-eligible-node-n", 9200, "http"),
new HttpHost("data-node-1", 9200, "http"),
new HttpHost("data-node-2", 9200, "http"),
...
new HttpHost("data-node-n", 9200, "http"),
new HttpHost("coord-node-1", 9200, "http"),
new HttpHost("coord-node-2", 9200, "http"),
...
new HttpHost("coord-node-n", 9200, "http")).build();
作为第二部分,是否可以仅将REST客户端初始化为协调节点,或仅初始化为数据节点?我想如果我想隔离查询操作和索引操作,我可能想要这样做。
谢谢!
答案 0 :(得分:0)
经验法则是: