After studying at the time, see the direct material online, there will always be problems, it could be a problem of differences in versions, it may have been a problem, so, learning for a long time, I decided to documents from the official website Learn.
Where the 7.2 version of the document is: https://www.elastic.co/guide/en/elasticsearch/reference/7.2/docs.html
A: Front small study
1. Health Cluster
GET /_cat/health?v
effect:
State my-application cluster bit yellow.
2. The list of nodes
3. Check all index
GET /_cat/indices?v
4. New Index
New Index a customer, and then view the index.
Wherein, pretty mean response is returned to Json format.
View all indexes:
About customer index, there is a main fragment, a copy of 0 documents.
Health status is yellow, because the copy has not been assigned, by default creates a copy of the index, but only one node running, so, then there is only one node in the cluster will be added to the allocation of a copy of a copy once is assigned to the second node, the state index will become green.
About the cluster, then the latter will be deployed to test.
Two: Documentation Learn
1. New Index
JSON API index added or updated document in a particular index, making it searchable. The following example JSON document ID is inserted into the "twitter" index 1:
1 PUT twitter/_doc/1 2 { 3 "user" : "kimchy", 4 "post_date" : "2009-11-15T14:12:12", 5 "message" : "trying out Elasticsearch" 6 }
截图:
说明:
The _shards
header provides information about the replication process of the index operation:
_shards头提供有关索引操作的复制过程的信息
-
total
- Indicates how many shard copies (primary and replica shards) the index operation should be executed on.
- 主与副本分片,需要执行的总个数。
-
successful
- Indicates the number of shard copies the index operation succeeded on.
-
failed
- An array that contains replication-related errors in the case an index operation failed on a replica shard.