Elasticsearch-cluster principle, elasticsearch-Cluster
Elasticsearch version: 6.0
I. ES Clusters
It is composed of one or more nodes with the same cluster. name to jointly bear the pressure on data and load.
The elected master
Introduction: Mainly on the three Linux servers, cluster installation elasticsearch.6.2.1, and its ES plug-ins, a variety of management software 1. cluster installation es 1.1 environment
Domain IP
biluos.com 192.168.10.173
biluos1.com 192.168.10.174
biluos2.com 192.168.10.175
The latest version of JDK is installed on 1.2 machines
[Root@bi
using the-I parameter, open stdin for console interactionWhen using the-t parameter, assign a TTY device that can support terminal logons, default to False
$ docker exec-it 66ca0270ef44/bin/bash
bash-4.3#
3.9 View cluster status
Curl Http://ip:port/_cat/health?v, you can also use Health?prettyWe saw that the cluster had 5 nodes joined, and the experiment was
result:
News Title: What are the efficacy of the main components of novogene?
Set Properties to enable the client to sniff the status of the entire cluster
You can set client. transport. sniff to true to enable the client to sniff the status of the entire cluster.
/*** You can set client. transport. sniff to true to e
measure a lot of information, but only one is the most important, cluster health ). Elasticsearch uses three color states: green, yellow, and red.
Green: All primary and replica shards are available.
Yellow: All primary shards are available, but not all replica shards are available.
Red: not all primary fragments are available;
1. Create a single cluster node
Ou
7.1 Node DiscoveryStart Elasticsearch, the node will look for the same cluster name and courseware of the master node, if there is joined, did not become the master node, responsible for the discovery of the module two purposesSelecting the master node and discovering the new node of the clusterTypes of 7.1.1 DiscoveriesElasticsearch allows the use of Zen discovery, in the config inside the elasticsearch.ym
HTTP.MAX_CONTENT_LENGTH:100MB #设置http内容的最大大小Http.enabled:true #是否开启http服务对外提供服务Discovery.zen.minimum_master_nodes:2 #设置这个参数来保证集群中的节点可以知道其它N个有master资格的节点. The default is 1, for large clusters, you can set a larger value (2-4)Discovery.zen.ping.timeout:120s #设置集群中自动发现其他节点时ping连接的超时时间Discovery.zen.ping.multicast.enabled:true #设置是否打开多播发现节点discovery.zen.ping.unicast.hosts:["10.0.0.209:9300", "10.0.0.206:9300", "10.0.0.208:9300"] #设置集群中的Master节点的初始列表, You can use these nodes to automatically discover
soft connection for the Directory ln-s elasticsearch-1.0.1 elasticsearch. After completion, the directory structure is as follows:
(2) Configure es. Here only do the simplest configuration, modify the ES_HOME/config/elasticsearch. yml file, set the value of node. name to "test-node1", indicating that the current es service node name is test-node1.
(3) Start ES.
Elasticsearch-head is an interface of the cluster operations and management tools, he is written through HTML5, can be a fool of the cluster operation.
Installation
There are two ways to install:
1, through the Elasticseach to bring the plugin command
Plugin-install Aconex/elasticsearch-headCan see
--Installing M
what is restful? REST (representational state transfer representational status transfer) is a design and development approach to network applications that reduces the complexity of development and increases the scalability of the system. Rest has design concepts and guidelines that are restful in the applications that follow these guidelines. In a rest-style structure, all requests must be made on an object that has a specific address set by the URL.
-node-1"In fact, to ensure that there is a common cluster.nameStart the 10.253.1.71 ES service, and then view the status of the next node cluster:
Curl-xpost "Http://10.253.1.70:9200/_cluster/health"{"Cluster_Name": "Elasticsearch_ryan","Status": "Green","Timed_out": false,"Number_of_nodes": 2,"Number_of_data_nodes": 2,"Active_primary_shards": 9,"Active_shards":
at that time should be the same ):
[Email protected]:/usr/local/kencery/elasticsearch-head # NPM start
> [Email protected] Start/usr/local/kencery/elasticsearch-head> Grunt Server
Grunt-CLI: The grunt command line interface (v1.2.0)
Fatal error: unable to find local grunt.
If you're seeing this message, grunt hasn' t been installed locallyYour project. For more information about installing and proces
the same content request Elasticsearch server again.
5. Provide active health detection (nginx plus only), constantly detect the back-end Elasticsearch server is normal, and actively switch. (When an ES hangs, Nginx does not distribute the request to this node, when the node is back to normal, auto-homing)
6. Report Rich monitoring metrics (nginx plus only), providing monitoring and management.
7. Security
Rest interface
Now that we have a functioning node (and cluster), the next step is to understand how to communicate with it. Fortunately, Elasticsearch provides a very comprehensive and powerful rest API that allows you to interact with your cluster using this REST API. Here are a few things you can do with this API:
1, check your
-5.6.2-9203,Then create the Data folder (.. /es-cluster/data) Log storage folder (.. /es-cluster/log) Modify the profile in the ES node service (.. /ES-CLUSTER/ELASTICSEARCH-5.6.2-9201/CONFIG/ELASTICSEARCH.YML), example Reference (src/resources/config/es/*), starting node 9201, performing (.. /es-
master node nor the node of the data node, only responsible for the distribution of the request, summary, and so on, that is to say the role of the coordination node. This kind of work, in fact, any one node can be completed, a separate increase of such nodes is more for load balancing.node.=falsenode.data=false4. Coordination nodes (coordinating node)?? The coordination node is a role, not a real elasticsearch node, and you have no way to configure
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.