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
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
is: int (primary + 3 replicas)/2) + 1 = 3
However, if you only have two nodes, you cannot index or delete any documents because the number of active parts is not enough.
Note: The new index has one copy part by default, which means ** requires ** two active parts to meet the quorum requirements. Of course, this default setting will prevent us from performing operations in a single node cluster. To avoid this problem, the specified quantity takes effe
elasticsearch Cluster Server configurationFirst, installationElasticsearch is based on lence, and Lence is an open source library written in Java that relies on the Java runtime environment. The Elasticsearch version currently in use is 1.6, which requires jdk1.7 or more versions.This article uses the Linux system, the installation of a good Java environment, the
automatically built into a cluster named elasticsearch.
3. Plug-in Installation
After the cluster is successfully installed, you need to check the index data and running status of the Cluster. You need to install some plug-ins for the index. To do a good job, you must first sharpen the tool. The following describes so
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
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
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
-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": 18,"Relocating_shards": 0,"Initializing_shard
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), pro
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
ElasticSearch cluster creation instance
I started to research and search, and set up a simple ElasticSearch search cluster on my own virtual machine. I hope it will be helpful.
Operating System Environment: Red Hat 4.8.2-16
Elasticsearch:
-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-
Distributed search ElasticSearch cluster creation and simple search instance applications
ElasticSearch is not introduced. Distributed ElasticSearch cluster construction method.
1. Create an embedded elasticsearch Node in the prog
ES can automatically organize nodes of the same cluster name into the cluster by setting "node name" and "Cluster Name", and make many technologies transparent to users.
If the user wants to manage the status of the view cluster, it can be done through some rest APIs.
Other ES document translation reference:
with any node in the cluster, including the master node. Each node knows where each document resides and forwards our query requests directly to the node where the data is stored. The node then returns the response directly to the client. All of this is managed by Elasticsearch itself.2. Cluster health statusCurl Http
A script for monitoring the Elasticsearch index was found in the Nagios community, and then modified to use the listening IP that is normally used for incoming elasticsearch for using a script that monitors the Elasticsearch health state in Nagios#!/bin/bash#check_elasticsearch_health.sh#memofornagiosoutputsstate_ok=0s
Next month began to search again, a few months did not move this piece fortunately did not fall. Set up a simple search cluster at night on your own virtual machine to share.Operating system environment: Red Hat 4.8.2-16Elasticsearch: elasticsearch-1.4.1Cluster Setup: 2 nodes on a single virtual machine.cluster storage path:/export/search/elasticsearch-clusterReq
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.