--- title: Elasticsearch-oss 節點角色 tags: Elasticsearch description: View the slide with "Slide Mode". --- # Elasticsearch-oss 節點角色 <!-- Put the link to this slide here so people can follow --> This is a <font color=blue>four-node</font> cluster that has one dedicated master node, one dedicated coordinating node, and two data nodes that are master-eligible and also used for ingesting data. | Node type| Description | Best practices for production | | -------- | -------- | -------- | | Master | Manages the <font color=blue>overall operation of a cluster</font> and keeps track of the cluster state. This includes<font color=blue> creating and deleting indices</font>, keeping track of the nodes that join and leave the cluster, checking the health of each node in the cluster (by running ping requests), and allocating shards to nodes. | <font color=blue>Three dedicated master nodes</font> in three different zones is the right approach for almost all production use cases. This makes sure your cluster never loses quorum. Two nodes will be idle for most of the time except when one node goes down or needs some maintenance. | | Master-eligible | Elects one node among them as the master node through a voting process. | For production clusters, make sure you have dedicated master nodes. The way to achieve a dedicated node type is to mark all other node types as false. In this case, you have to mark all the other nodes as not master-eligible. | |Data|<font color=blue>Stores and searches data.</font> Performs all data-related operations (indexing, searching, aggregating)<font color=blue> on local shards.</font> These are the worker nodes of your cluster and need more disk space than any other node type.|As you add data nodes, keep them balanced between zones. For example, if you have three zones, add data nodes in multiples of three, one for each zone. We recommend using storage and RAM-heavy nodes.| |Ingest|<font color=blue>Preprocesses data</font> before storing it in the cluster. Runs an ingest pipeline that transforms your data before adding it to an index. |If you plan to ingest a lot of data and run complex ingest pipelines, we recommend you use dedicated ingest nodes. <font color=blue>You can also optionally offload your indexing from the data nodes so that your data nodes are used exclusively for searching and aggregating.</font> | |Coordinating|Delegates client requests to the shards on the data nodes, <font color=blue>collects and aggregates the results into one final result</font>, and sends this result back to the client.|A couple of dedicated coordinating-only nodes is appropriate to prevent bottlenecks for search-heavy workloads. We recommend using <font color=blue>CPUs</font> with as many cores as you can.| >[name=昱齊] master跟Master-eligible差在哪 >[name=昱齊] zones是什麼 --- <font color=blue>By default, each node is a master-eligible, data, ingest, and coordinating node.</font> Deciding on the number of nodes, assigning node types, and choosing the hardware for each node type depends on your use case. You must take into account factors like <font color=blue>the amount of time you want to hold on to your data, the average size of your documents, your typical workload (indexing, searches, aggregations), your expected price-performance ratio, your risk tolerance, and so on.</font> After you assess all these requirements, <font color=blue>we recommend you use a benchmark testing tool like Rally to provision a small sample cluster and run tests with varying workloads and configurations.</font> Compare and analyze the system and query metrics for these tests to design an optimum architecture. To get started with Rally, see the [Rally documentation](ttps://esrally.readthedocs.io/en/stable/). This page demonstrates how to work with the different node types. It assumes that you have a four-node cluster similar to the preceding illustration.