如何设置Elasticsearch客户端节点? [英] How to setup Elasticsearch client nodes?

查看:157
本文介绍了如何设置Elasticsearch客户端节点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个关于客户端节点的弹性搜索问题:


  1. 我可以说:只要打开任何节点HTTP端口,我可以将它们视为客户端节点,因为我们可以通过这个节点进行搜索/索引。


  2. 实际上,我们将节点视为客户端节点当 cluster = false data = false 时,如果我设置了10个客户端节点,我需要在我的客户端,我的意思是,如果我在我的代码中指定了客户端:9200 作为ES门户,那么clientOne 将其他HTTP请求转发给其他客户端节点,否则, clientOne 将处于非常高的压力之下。那么它们是否在客户端节点之间进行通信?


  3. 当我在ES集群中指定客户机节点时,是否应该关闭其他节点的HTTP端口?因为我们只能查询客户端节点。


  4. 你认为有必要在同一台机器上设置数据节点和客户端节点,或者只是设置数据节点作为客户端节点,无论如何,它在同一台机器中?


  5. 如果ES集群在较少搜索的时候会被重/频繁地索引,那么我不会为了一般的搜索/索引目的,我应该使用http端口或tcp港口,客户的看法有什么区别?



解决方案


  1. 是的,您可以通过http发送查询以打开端口9200的任何节点。


  2. 使用node.data:false和node .master:false,您将获得客户端节点一>。这些可用于从数据节点卸载索引和搜索流量。如果你有10个,你需要在它们之前放置一个负载均衡器。


  3. 关闭数据节点的http端口(http.enabled:false )会阻止他们服务于客户端请求(可能很好),尽管它也会阻止您直接用于统计数据等。


  4. 客户端节点有用(见#2),所以我不会将流量直接路由到您的数据节点。无论您是在同一块硬件上同时运行客户端和数据节点都将依赖于该机器的配置(您有足够的RAM等)。


  5. 客户端节点也可用于索引,因为它们知道哪个数据节点应该接收数据进行存储。如果您将索引请求发送到随机数据节点,则可能会将该请求重定向到另一个节点。如果您可以创建客户端节点,那么浪费时间和资源。


  6. 让客户端加入群集可能会让他们访问有关群集的更多信息,但是使用http给他们一个更通用的黑匣子界面。使用http,您也不必将客户端保留在与ES节点相同的版本。


希望这有助于。


I have couple of Elasticsearch questions regarding client node:

  1. Can I say: any nodes as long as they are opening HTTP port, I can treat them as "client" nodes, because we can do search/index through this node.

  2. Actually we treat the node as client node when the cluster=false and data=false, if I set up 10 client nodes, do I need to route in my client side, I mean if I specify clientOne:9200 in my code as ES portal, then would clientOne forward other HTTP requests to other client nodes, otherwise, clientOne would be under very high pressure. i.e do they communicate with each other between client nodes?

  3. When I specify client nodes in ES cluster, should I close other nodes' HTTP port? Because we can only query client nodes.

  4. Do you think it's necessary to set up both data node and client node in the same machine, or just setup data node acts as client node as well, anyways it's in the same machine?

  5. If the ES cluster would be heavily/frequently indexed while less searched, then I don't have to set up client node, because client node good for gathering data, right please?

  6. For general search/index purpose should I use http port or tcp port, what's the difference in clients perspective please?

解决方案

  1. Yes, you can send queries via http to any node that has port 9200 open.

  2. With node.data: false and node.master: false, you get a "client node". These are useful for offloading indexing and search traffic from your data nodes. If you have 10 of them, you would want to put a load balancer in front of them.

  3. Closing the data node's http port (http.enabled: false) would keep them from serving client requests (probably good), though it would also prevent you from curl'ing them directly for stats, etc.

  4. Client nodes are useful (see #2), so I wouldn't route traffic directly to your data nodes. Whether you run both a client and data node on the same piece of hardware would be dependent on the config of that machine (do you have sufficient RAM, etc).

  5. Client node are also useful for indexing, because they know which data node should receive the data for storage. If you sent an indexing request to a random data node instead, the odds would be high that it would have to redirect that request to another node. That's a waste of time and resources, if you can create client nodes.

  6. Having your clients join the cluster might give them access to more information about the cluster, but using http gives them a more generic "black box" interface. With http, you also don't have to keep your clients at the same version as your ES nodes.

Hope that helps.

这篇关于如何设置Elasticsearch客户端节点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆