ElasticSearch - Node

elasticSearch node 的配置如下:

# Every node can be configured to allow or deny being eligible as the master,
# and to allow or deny to store the data.
#
# Allow this node to be eligible as a master node (enabled by default):
#
#node.master: true
#
# Allow this node to store data (enabled by default):
#
#node.data: true

# You can exploit these settings to design advanced cluster topologies.
#
# 1. You want this node to never become a master node, only to hold data.
# This will be the "workhorse" of your cluster.

#node.master: false
#node.data: true
#
# 2. You want this node to only serve as a master: to not store any data and
# to have free resources. This will be the "coordinator" of your cluster.
#
#node.master: true
#node.data: false
#
# 3. You want this node to be neither master nor data node, but
# to act as a "search load balancer" (fetching data from nodes,
# aggregating results, etc.)
#
#node.master: false
#node.data: false

node.master node.data                                      remark                             
true true default
true false coordinator
false true workhorse
false false search load balancer


对于Node的配置,还需要注意几点:

1.用来做请求分发和结果合并的节点如何配置?(search、fetching...)

2.不同类型的节点通信方式怎么配置比较合理?(Tcp、Http)

elasticsearch allows to configure a node to either be allowed to store data locally or not. Storing data locally basically means that shards of different indices are allowed to be allocated on that node. By default, each node is considered to be a data node, and it can be turned off by setting node.data to false.

This is a powerful setting allowing to simply create smart load balancers that take part in some of different API processing. Lets take an example:

We can start a whole cluster of data nodes which do not even start an HTTP transport by setting http.enabled to false. Such nodes will communicate with one another using the transportmodule. In front of the cluster we can start one or more "non data" nodes which will start with HTTP enabled. All HTTP communication will be performed through these "non data" nodes.

The benefit of using that is first the ability to create smart load balancers. These "non data" nodes are still part of the cluster, and they redirect operations exactly to the node that holds the relevant data. The other benefit is the fact that for scatter / gather based operations (such as search), these nodes will take part of the processing since they will start the scatter process, and perform the actual gather processing.

This relieves the data nodes to do the heavy duty of indexing and searching, without needing to process HTTP requests (parsing), overload the network, or perform the gather processing.

---

我们可以将整个机器分成两部分,data nodes和non data nodes。data nodes的通信协议采用tcp(http.enabled设置成false),主要负责搜索引擎的“运算”(indexing、searching)。non data nodes采用http进行通信,主要负责请求的分发(scatter)、结果的合并(gather)等。

如图:

ElasticSearch - Node

时间: 2024-11-06 03:28:10

ElasticSearch - Node的相关文章

elasticsearch failed to obtain node locks

0x00 事件 重启服务器后,启动 elasticsearch 失败,在日志中观察到以下错误: [2019-10-25T17:29:54,639][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [test-machine] uncaught exception in thread [main] org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateExcep

亿级规模的Elasticsearch优化实战

本次分享主要包含两个方面的实战经验:索引性能和查询性能. 一. 索引性能(Index Performance) 首先要考虑的是,索引性能是否有必要做优化? 索引速度提高与否?主要是看瓶颈在什么地方,若是 Read DB(产生DOC)的速度比较慢,那瓶颈不在 ElasticSearch 时,优化就没那么大的动力.实际上 Elasticsearch 的索引速度还是非常快的. 我们有一次遇到 Elasticsearch 升级后索引速度很慢,查下来是新版 IK 分词的问题,修改分词插件后得到解决. 如果

Elasticsearch Java API简要总汇

3.1 集群的连接 3.1.1 作为Elasticsearch节点 [html] view plain copy 代码: import static org.elasticsearch.node.NodeBuilder.nodeBuilder; import org.elasticsearch.client.Client; import org.elasticsearch.node.Node; Node node = nodeBuilder().clusterName("escluster2&q

elasticsearch 2种客户端的区别

Java连接ElasticSearch详解 Java连接ES有两种连接方式(即获得ES的Client) 1.创建一个node,加入集群中,通过这个node获得client. 2.通过TransportClient来连接集群. 区别 第一种方式,相当于额外启动了一个es的node节点,只是这个node是由我们编码控制的,可以设置成这个node是不存数据的节点(没有特殊原因你就应该这么设置),这个节点的配置和其他的节点没有什么区别,也是通过elasticsearch.yml文件来配置,配置文件放在c

elasticsearch java 增删改查的简单实例

既然是开发篇,主要以代码为主,辅助一些说明.所有的内容都是代码实际应该验证过的. 引入的头文件: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 import static org.elasticsearch.node.NodeBuilder.nodeBuilder; import java.io.IOException; import java.net.InetAddress; import java.util.Date;

ElasticSearch的基本用法与集群搭建

ElasticSearch的基本用法与集群搭建 一.简介 ElasticSearch和Solr都是基于Lucene的搜索引擎,不过ElasticSearch天生支持分布式,而Solr是4.0版本后的SolrCloud才是分布式版本,Solr的分布式支持需要ZooKeeper的支持. 这里有一个详细的ElasticSearch和Solr的对比:http://solr-vs-elasticsearch.com/ 二.基本用法 Elasticsearch集群可以包含多个索引(indices),每一个索

Elasticsearch: Indexing SQL databases. The easy way

Elasticsearchis a great search engine, flexible, fast and fun. So how can I get started with it? This post will go through how to get contents from a SQL database into Elasticsearch. Elasticsearch has a set of pluggable services called rivers. A rive

ElasticSearch的javaAPI之Client

翻译的原文:http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html#node-client 翻译ElasticSearch的javaAPI之Client 本节描述了elasticsearch提供的Java API,所有elasticsearch操作使用client对象执行. 所有的操作在本质上是完全asynchronous(接受一个listener,或返回一个future).

org.elasticsearch.bootstrap : JNA not found. native methods will be disabled

在pom.xml中添加以下依赖,解决elasticsearch的WARN: <dependency> <groupId>com.sun.jna</groupId> <artifactId>jna</artifactId> <version>3.0.9</version> </dependency> 2016-09-11 18:38:10.097 WARN 5760 --- [ main] org.elastic