Recently in the know to see this problem, oneself also engaged half semester of Elasticsearch, so want to use oneself know shallow knowledge to answer this question.
Cluster contains multiple node,indices that should not be understood as a verb index , indices can be understood as databases,indices in a relational database can contain multiple indexes, The index corresponds to the database in relational databases, which is used to store related documents.
The analogy correspondence between Elasticsearch and relational data is as follows:
Relational Db⇒databases⇒tables⇒rows⇒columns
elasticsearch⇒indices⇒types⇒documents⇒ Fields
The document here can be understood as a JSON sequence object. Each document can contain more than one field.
Again, Shard, each index (corresponding database) contains multiple Shard, the default is 5, scattered on different node, but there will not be two identical shard exist on a node, so there is no meaning of backup. The Shard is a minimal Lucene index unit.
When a document is coming, Elasticsearch determines which shard it is placed on by hashing the docid, and then stores the index on the Shard.
Replicas is a backup,Elasticsearch uses the Push replication mode , when you index a document above the Master Master Shard, The Shard copies the document To all the remaining replica replica shards, these shards will also index this document. I personally think this model is very nice, sometimes the index of a document may produce a large index file, will be very much bandwidth, and only transfer the original file is much better.
When the query is, if the query is provided docid,elasticsearch through the hash to know which Doc exists shard above, and then through the routing table query will know which node above, let go to node above to fetch it. If DocId is not provided, Elasticsearch performs a search alert on all node (indics) shards, and then returns the search results, which are returned to the user after coordinating node gather.
Configuration needs to grasp what kind of principle, should go to see an ES optimization information, recommended two book
ElasticSearch Server (watercress), mastering ElasticSearch (watercress)
What is the relationship between clusters (Cluster), nodes (node), shards (Shard), Indices (indexes), replicas (backups) in Elasticsearch?