本篇内容介绍了“用curl方式操作elasticsearch的常用方法有哪些”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
当elasticsearch集群启动后,可以通过一些API来获取集群的状态信息,通过这些信息可以监控集群的异常情况,以及方便修改集群的参数配置等。
Elasticsearch对于文档操作,提供了以下几种API:
查看集群健康状态信息:
curl http://192.168.1.10:9200/_cluster/health?pretty
{
"cluster_name" : "es-test",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 3,
"number_of_data_nodes" : 3,
"active_primary_shards" : 61,
"active_shards" : 131,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 100.0
}
查看集群完整的状态信息:
curl http://192.168.1.10:9200/_cluster/state?pretty
{
"cluster_name" : "es-test",
"compressed_size_in_bytes" : 22620,
"cluster_uuid" : "6Y5qf-JgTuC1AO4MqLf79w",
"version" : 520,
"state_uuid" : "zUD5N33ySL2LHvWoPZbFIw",
"master_node" : "53Zy2Hh5SrOaoVqEOhBxXA",
"blocks" : { },
"nodes" : {
"sumu-ytEQ2OqspomZDWrwA" : {
"name" : "node-2111",
"ephemeral_id" : "XncNMiy0T5qTHxy-Fl9w6w",
"transport_address" : "192.168.1.11:9300",
"attributes" : {
"ml.machine_memory" : "8252583936",
"ml.max_open_jobs" : "20",
"xpack.installed" : "true",
"ml.enabled" : "true"
}
},
"TkItEB4QRkWn_-EZ3XpS1A" : {
"name" : "node-2112",
"ephemeral_id" : "2zcpDCzSQJyTi2N6AJI9MA",
"transport_address" : "192.168.1.12:9300",
"attributes" : {
"ml.machine_memory" : "8252583936",
"ml.max_open_jobs" : "20",
"xpack.installed" : "true",
"ml.enabled" : "true"
}
},
"53Zy2Hh5SrOaoVqEOhBxXA" : {
"name" : "node-2110",
"ephemeral_id" : "DSZ_MeS8QC6QtqokTI-RAw",
"transport_address" : "192.168.1.10:9300",
"attributes" : {
"ml.machine_memory" : "8252583936",
"xpack.installed" : "true",
"ml.max_open_jobs" : "20",
"ml.enabled" : "true"
}
}
},
"metadata" : {
"cluster_uuid" : "6Y5qf-JgTuC1AO4MqLf79w",
"templates" : {
".monitoring-kibana" : {
"index_patterns" : [
".monitoring-kibana-6-*"
],
"order" : 0,
"settings" : {
"index" : {
"format" : "6",
"codec" : "best_compression",
"number_of_shards" : "1",
"auto_expand_replicas" : "0-1",
"number_of_replicas" : "0"
}
},
"mappings" : {
"doc" : {
"dynamic" : false,
"properties" : {
"interval_ms" : {
"type" : "long"
},
"cluster_uuid" : {
"type" : "keyword"
},
"source_node" : {
"properties" : {
"transport_address" : {
"type" : "keyword"
},
"ip" : {
"type" : "keyword"
},
"host" : {
"type" : "keyword"
},
"name" : {
"type" : "keyword"
},
"uuid" : {
"type" : "keyword"
},
"timestamp" : {
"format" : "date_time",
"type" : "date"
}
}
},
"type" : {
"type" : "keyword"
},
.....................................................................................
.....................................................................................
.....................................................................................
.....................................................................................
.....................................................................................
查看集群索引的状态信息:
# curl http://192.168.1.10:9200/_cluster/state/test?pretty
{
"cluster_name" : "es-test",
"compressed_size_in_bytes" : 22620,
"cluster_uuid" : "6Y5qf-JgTuC1AO4MqLf79w"
}
查看集群的配置信息:
# curl http://192.168.1.10:9200/_cluster/settings?pretty
{
"persistent" : {
"xpack" : {
"monitoring" : {
"collection" : {
"enabled" : "true"
}
}
}
},
"transient" : { }
}
# curl http://192.168.1.10:9200/_nodes/state?pretty
{
"_nodes" : {
"total" : 0,
"successful" : 0,
"failed" : 0
},
"cluster_name" : "es-test",
"nodes" : { }
}
查看集群节点状态信息:
curl http://192.168.1.10:9200/_nodes?pretty
{
"_nodes" : {
"total" : 3,
"successful" : 3,
"failed" : 0
},
"cluster_name" : "es-test",
"nodes" : {
"sumu-ytEQ2OqspomZDWrwA" : {
"name" : "node-2111",
"transport_address" : "192.168.1.11:9300",
"host" : "node-2111",
"ip" : "192.168.1.11",
"version" : "6.4.2",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "04711c2",
"total_indexing_buffer" : 103887667,
"roles" : [
"master",
"data",
"ingest"
],
"attributes" : {
"ml.machine_memory" : "8252583936",
"ml.max_open_jobs" : "20",
"xpack.installed" : "true",
"ml.enabled" : "true"
},
"settings" : {
"cluster" : {
"name" : "es-yanpan"
},
"node" : {
"attr" : {
"xpack" : {
"installed" : "true"
},
"ml" : {
"machine_memory" : "8252583936",
"max_open_jobs" : "20",
"enabled" : "true"
}
},
"name" : "node-2111"
},
"path" : {
"data" : [
"/usr/local/elasticsearch/data"
],
"logs" : "/usr/local/elasticsearch/logs",
"home" : "/usr/local/elasticsearch"
},
"discovery" : {
"zen" : {
"minimum_master_nodes" : "2",
"ping" : {
"unicast" : {
"hosts" : [
"192.168.1.10",
"192.168.1.11",
"192.168.1.12"
]
}
},
"ping_timeout" : "10s"
}
},
"action" : {
"destructive_requires_name" : "false"
},
"client" : {
"type" : "node"
},
"http" : {
"cors" : {
"allow-origin" : "*",
"enabled" : "true"
},
"type" : "security4",
"port" : "9200",
"enabled" : "true",
"type.default" : "netty4"
},
"bootstrap" : {
"memory_lock" : "true",
"system_call_filter" : "false"
},
"transport" : {
"tcp" : {
"port" : "9300"
},
"features" : {
"x-pack" : "true"
},
"type" : "security4",
"type.default" : "netty4"
},
"network" : {
"host" : "node-2111"
}
},
"os" : {
"refresh_interval_in_millis" : 1000,
"name" : "Linux",
"arch" : "amd64",
"version" : "2.6.32-642.el6.x86_64",
"available_processors" : 4,
"allocated_processors" : 4
},
.....................................................................................
.....................................................................................
.....................................................................................
.....................................................................................
.....................................................................................
查看某个索引的配置信息:
# curl http://192.168.1.10:9200/test/_settings?pretty
{
"test" : {
"settings" : {
"index" : {
"creation_date" : "1539742043394",
"number_of_shards" : "3",
"number_of_replicas" : "2",
"uuid" : "OGkJNlMLTE2C5qIS4MQi3w",
"version" : {
"created" : "6040299"
},
"provided_name" : "test"
}
}
}
}
查看索引的字段映射信息:
# curl -XGET http://192.168.1.10:9200/test/_mapping?pretty
{
"test" : {
"mappings" : {
"test" : {
"properties" : {
"city" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"date" : {
"type" : "date"
},
"desc" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"salary" : {
"type" : "long"
},
"title" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
}
}
}
查看集群的所有索引信息:
# curl http://192.168.1.10:9200/_cat/indices?pretty
green open .monitoring-kibana-6-2018.11.12 glzunUhqRROEmCSgKQ4Sdw 1 1 588 0 343.3kb 171.6kb
green open .monitoring-es-6-2018.11.06 c4_8Toh_RqOldM_mL1cvaA 1 1 281095 1156 341.7mb 169.4mb
green open .monitoring-es-6-2018.11.05 4D13EScmQoyDc8S-pl5nGA 1 1 281640 1292 340.3mb 168.3mb
green open .monitoring-kibana-6-2018.11.08 qoIZPWkPRm-VHBFhmvIiEQ 1 1 8639 0 4.1mb 2mb
green open .monitoring-kibana-6-2018.11.10 DBEjCCW9S6OHOTO9eWw_zg 1 1 8639 0 4mb 2mb
green open .monitoring-es-6-2018.11.11 qyQX5zYhTX2obh3jy2ljQA 1 1 280309 1271 338.1mb 170.3mb
green open demo W-6fGeVQTrOQmiPmREoAZQ 5 1 1 0 9.9kb 4.9kb
green open bank eGkD5E8oS1ug9ey4nivunQ 5 1 1000 0 966.3kb 475.1kb
green open .kibana g6NyiSBeS6qvYFvIy62Vrw 1 1 1 0 8kb 4kb
green open .monitoring-es-6-2018.11.09 qhaxi8-eThyo-y4-hKDDsg 1 1 280466 1282 340.6mb 169.1mb
green open .monitoring-kibana-6-2018.11.11 B-AKVAZYStGInI-IDKhr_A 1 1 8639 0 3.9mb 1.9mb
green open customer hOfkTIiERNKO1m8BObT5QA 5 1 1 0 9.2kb 4.6kb
green open .monitoring-es-6-2018.11.10 _N_R5IuRSQq8YBzcnUx5Hw 1 1 280338 1282 338.7mb 171.2mb
green open .monitoring-es-6-2018.11.07 WvXZsJGCRhqOMF8iFqFfBg 1 1 280466 1155 339.8mb 168.6mb
green open megacorp iVre--bqSySfcd8SQG1mfg 5 1 3 0 35.1kb 17.5kb
green open website q45C_fwZSPStu2WnMhQnBw 5 1 6 1 46.1kb 23kb
green open test OGkJNlMLTE2C5qIS4MQi3w 3 2 0 0 2.2kb 781b
green open .monitoring-kibana-6-2018.11.06 rlUrBWHRTGq6LfYx9Jhyvw 1 1 8640 0 4mb 2mb
green open language sLotCsV8T4qmD6yDUxAEwA 5 1 5 0 64.5kb 32.2kb
green open twitter RM3h6qh-TvyQl-AnbmwhSQ 5 1 3 0 25.9kb 12.9kb
green open .monitoring-kibana-6-2018.11.05 GTTS2LdySfOf7WBYcWM4pA 1 1 8639 0 4mb 2mb
green open net_info Ff-mOdBoRwW_m_vVD-m7cg 3 2 2782 46 32.4mb 10.9mb
green open .monitoring-kibana-6-2018.11.07 0tMWdYhASdetcUQNGxy9MA 1 1 8639 0 4mb 2mb
green open blogs i1dugfJDRfGo7wfJk036_g 3 2 0 0 2.2kb 783b
green open .monitoring-es-6-2018.11.12 5VBImaPeT6m7q5Xne-vyew 1 1 19691 393 24.8mb 12.5mb
green open .monitoring-es-6-2018.11.08 pHo83IiSSyWqnlQYX_vTqQ 1 1 280465 1227 336.3mb 170.9mb
green open .monitoring-kibana-6-2018.11.09 D0LeHkgZQUiRIrCv7sLkBw 1 1 8639 0 4.1mb 2mb
查看指定的索引状态信息:
# curl http://192.168.1.10:9200/_cat/indices/test
green open test OGkJNlMLTE2C5qIS4MQi3w 3 2 0 0 2.2kb 781b
查看每个集群节点的分片信息:
# curl http://192.168.1.10:9200/_cat/allocation?pretty
44 887.4mb 9gb 78.8gb 87.8gb 10 node-2110 192.168.1.10 node-2110
43 1gb 10.5gb 77.3gb 87.8gb 11 node-2111 192.168.1.11 node-2111
44 544.4mb 8.9gb 78.8gb 87.8gb 10 node-2112 192.168.1.12 node-2112
查看集群每个分片的详细信息:
# curl http://192.168.1.10:9200/_cat/shards?pretty
blogs 2 r STARTED 0 261b 192.168.1.12 node-2112
blogs 2 p STARTED 0 261b 192.168.1.10 node-2110
blogs 2 r STARTED 0 261b 192.168.1.11 node-2111
blogs 1 p STARTED 0 261b 192.168.1.12 node-2112
blogs 1 r STARTED 0 261b 192.168.1.10 node-2110
blogs 1 r STARTED 0 261b 192.168.1.11 node-2111
blogs 0 r STARTED 0 261b 192.168.1.12 node-2112
blogs 0 p STARTED 0 261b 192.168.1.10 node-2110
blogs 0 r STARTED 0 261b 192.168.1.11 node-2111
.monitoring-kibana-6-2018.11.11 0 p STARTED 8639 1.9mb 192.168.1.12 node-2112
.monitoring-kibana-6-2018.11.11 0 r STARTED 8639 1.9mb 192.168.1.10 node-2110
.monitoring-kibana-6-2018.11.10 0 p STARTED 8639 2mb 192.168.1.12 node-2112
.monitoring-kibana-6-2018.11.10 0 r STARTED 8639 2mb 192.168.1.10 node-2110
.monitoring-es-6-2018.11.09 0 p STARTED 280466 169.1mb 192.168.1.12 node-2112
.monitoring-es-6-2018.11.09 0 r STARTED 280466 171.5mb 192.168.1.11 node-2111
.kibana 0 p STARTED 1 4kb 192.168.1.12 node-2112
.kibana 0 r STARTED 1 4kb 192.168.1.10 node-2110
.monitoring-es-6-2018.11.12 0 p STARTED 20221 12.8mb 192.168.1.12 node-2112
.monitoring-es-6-2018.11.12 0 r STARTED 20221 12.6mb 192.168.1.10 node-2110
.monitoring-kibana-6-2018.11.09 0 p STARTED 8639 2mb 192.168.1.12 node-2112
.monitoring-kibana-6-2018.11.09 0 r STARTED 8639 2mb 192.168.1.10 node-2110
.monitoring-kibana-6-2018.11.05 0 p STARTED 8639 2mb 192.168.1.10 node-2110
.monitoring-kibana-6-2018.11.05 0 r STARTED 8639 2mb 192.168.1.11 node-2111
website 2 r STARTED 1 3.6kb 192.168.1.12 node-2112
website 2 p STARTED 1 3.6kb 192.168.1.10 node-2110
website 3 r STARTED 2 8.5kb 192.168.1.10 node-2110
website 3 p STARTED 2 8.5kb 192.168.1.11 node-2111
website 1 p STARTED 0 261b 192.168.1.12 node-2112
website 1 r STARTED 0 261b 192.168.1.11 node-2111
website 4 p STARTED 1 3.6kb 192.168.1.12 node-2112
website 4 r STARTED 1 3.6kb 192.168.1.11 node-2111
website 0 r STARTED 2 7.1kb 192.168.1.10 node-2110
website 0 p STARTED 2 7kb 192.168.1.11 node-2111
language 2 p STARTED 2 10.8kb 192.168.1.12 node-2112
language 2 r STARTED 2 10.8kb 192.168.1.11 node-2111
language 3 p STARTED 1 6.7kb 192.168.1.10 node-2110
language 3 r STARTED 1 6.7kb 192.168.1.11 node-2111
language 4 r STARTED 1 7.5kb 192.168.1.12 node-2112
language 4 p STARTED 1 7.5kb 192.168.1.11 node-2111
language 1 r STARTED 1 6.9kb 192.168.1.10 node-2110
language 1 p STARTED 1 6.9kb 192.168.1.11 node-2111
language 0 r STARTED 0 261b 192.168.1.12 node-2112
language 0 p STARTED 0 261b 192.168.1.10 node-2110
.monitoring-kibana-6-2018.11.12 0 p STARTED 605 147.4kb 192.168.1.12 node-2112
.monitoring-kibana-6-2018.11.12 0 r STARTED 605 147.4kb 192.168.1.10 node-2110
customer 2 r STARTED 0 259b 192.168.1.12 node-2112
customer 2 p STARTED 0 259b 192.168.1.11 node-2111
customer 3 p STARTED 1 3.5kb 192.168.1.12 node-2112
customer 3 r STARTED 1 3.5kb 192.168.1.11 node-2111
customer 1 r STARTED 0 261b 192.168.1.12 node-2112
customer 1 p STARTED 0 261b 192.168.1.10 node-2110
customer 4 p STARTED 0 261b 192.168.1.10 node-2110
customer 4 r STARTED 0 261b 192.168.1.11 node-2111
customer 0 p STARTED 0 261b 192.168.1.10 node-2110
customer 0 r STARTED 0 261b 192.168.1.11 node-2111
.monitoring-es-6-2018.11.07 0 p STARTED 280466 168.6mb 192.168.1.10 node-2110
.monitoring-es-6-2018.11.07 0 r STARTED 280466 171.2mb 192.168.1.11 node-2111
test 2 r STARTED 0 259b 192.168.1.12 node-2112
test 2 r STARTED 0 259b 192.168.1.10 node-2110
test 2 p STARTED 0 259b 192.168.1.11 node-2111
test 1 r STARTED 0 261b 192.168.1.12 node-2112
test 1 p STARTED 0 261b 192.168.1.10 node-2110
test 1 r STARTED 0 261b 192.168.1.11 node-2111
test 0 r STARTED 0 261b 192.168.1.12 node-2112
test 0 p STARTED 0 261b 192.168.1.10 node-2110
test 0 r STARTED 0 261b 192.168.1.11 node-2111
.monitoring-es-6-2018.11.10 0 p STARTED 280338 171.2mb 192.168.1.10 node-2110
.monitoring-es-6-2018.11.10 0 r STARTED 280338 167.5mb 192.168.1.11 node-2111
.monitoring-kibana-6-2018.11.08 0 p STARTED 8639 2mb 192.168.1.12 node-2112
.monitoring-kibana-6-2018.11.08 0 r STARTED 8639 2mb 192.168.1.10 node-2110
.monitoring-kibana-6-2018.11.07 0 p STARTED 8639 2mb 192.168.1.12 node-2112
.monitoring-kibana-6-2018.11.07 0 r STARTED 8639 2mb 192.168.1.10 node-2110
demo 2 p STARTED 0 261b 192.168.1.12 node-2112
demo 2 r STARTED 0 261b 192.168.1.11 node-2111
demo 3 p STARTED 1 3.9kb 192.168.1.10 node-2110
demo 3 r STARTED 1 3.9kb 192.168.1.11 node-2111
demo 1 r STARTED 0 261b 192.168.1.12 node-2112
demo 1 p STARTED 0 261b 192.168.1.11 node-2111
demo 4 r STARTED 0 261b 192.168.1.10 node-2110
demo 4 p STARTED 0 261b 192.168.1.11 node-2111
demo 0 r STARTED 0 261b 192.168.1.12 node-2112
demo 0 p STARTED 0 261b 192.168.1.10 node-2110
.monitoring-es-6-2018.11.06 0 p STARTED 281095 169.4mb 192.168.1.10 node-2110
.monitoring-es-6-2018.11.06 0 r STARTED 281095 172.3mb 192.168.1.11 node-2111
twitter 2 r STARTED 1 3.6kb 192.168.1.12 node-2112
twitter 2 p STARTED 1 3.6kb 192.168.1.11 node-2111
twitter 3 p STARTED 1 5kb 192.168.1.12 node-2112
twitter 3 r STARTED 1 5kb 192.168.1.11 node-2111
twitter 4 r STARTED 1 3.6kb 192.168.1.12 node-2112
twitter 4 p STARTED 1 3.6kb 192.168.1.10 node-2110
twitter 1 p STARTED 0 261b 192.168.1.10 node-2110
twitter 1 r STARTED 0 261b 192.168.1.11 node-2111
twitter 0 p STARTED 0 261b 192.168.1.10 node-2110
twitter 0 r STARTED 0 261b 192.168.1.11 node-2111
.monitoring-es-6-2018.11.08 0 p STARTED 280465 170.9mb 192.168.1.12 node-2112
.monitoring-es-6-2018.11.08 0 r STARTED 280465 165.4mb 192.168.1.11 node-2111
.monitoring-es-6-2018.11.05 0 p STARTED 281640 168.3mb 192.168.1.12 node-2112
.monitoring-es-6-2018.11.05 0 r STARTED 281640 171.9mb 192.168.1.10 node-2110
.monitoring-es-6-2018.11.11 0 p STARTED 280309 170.3mb 192.168.1.10 node-2110
.monitoring-es-6-2018.11.11 0 r STARTED 280309 167.7mb 192.168.1.11 node-2111
.monitoring-kibana-6-2018.11.06 0 r STARTED 8640 2mb 192.168.1.12 node-2112
.monitoring-kibana-6-2018.11.06 0 p STARTED 8640 2mb 192.168.1.11 node-2111
bank 2 r STARTED 211 99.4kb 192.168.1.10 node-2110
bank 2 p STARTED 211 99.4kb 192.168.1.11 node-2111
bank 3 p STARTED 200 95kb 192.168.1.12 node-2112
bank 3 r STARTED 200 103kb 192.168.1.11 node-2111
bank 1 r STARTED 191 91.2kb 192.168.1.12 node-2112
bank 1 p STARTED 191 91.2kb 192.168.1.10 node-2110
bank 4 r STARTED 201 95.4kb 192.168.1.12 node-2112
bank 4 p STARTED 201 95.4kb 192.168.1.10 node-2110
bank 0 p STARTED 197 94kb 192.168.1.12 node-2112
bank 0 r STARTED 197 101.9kb 192.168.1.11 node-2111
net_info 2 r STARTED 942 3.4mb 192.168.1.12 node-2112
net_info 2 p STARTED 942 3.4mb 192.168.1.10 node-2110
net_info 2 r STARTED 942 3.4mb 192.168.1.11 node-2111
net_info 1 p STARTED 917 4.1mb 192.168.1.12 node-2112
net_info 1 r STARTED 917 4.1mb 192.168.1.10 node-2110
net_info 1 r STARTED 917 4.1mb 192.168.1.11 node-2111
net_info 0 r STARTED 923 3.1mb 192.168.1.12 node-2112
net_info 0 r STARTED 923 3.2mb 192.168.1.10 node-2110
net_info 0 p STARTED 923 3.2mb 192.168.1.11 node-2111
megacorp 2 r STARTED 1 5.6kb 192.168.1.12 node-2112
megacorp 2 p STARTED 1 5.6kb 192.168.1.11 node-2111
megacorp 3 p STARTED 1 5.7kb 192.168.1.12 node-2112
megacorp 3 r STARTED 1 5.7kb 192.168.1.11 node-2111
megacorp 1 r STARTED 0 261b 192.168.1.12 node-2112
megacorp 1 p STARTED 0 261b 192.168.1.10 node-2110
megacorp 4 p STARTED 1 5.6kb 192.168.1.10 node-2110
megacorp 4 r STARTED 1 5.6kb 192.168.1.11 node-2111
megacorp 0 p STARTED 0 261b 192.168.1.12 node-2112
megacorp 0 r STARTED 0 261b 192.168.1.10 node-2110
查看集群当前数据节点上正在被fielddata使用的堆空间大小:
# curl http://192.168.1.10:9200/_cat/fielddata?pretty
53Zy2Hh5SrOaoVqEOhBxXA node-2110 192.168.1.10 node-2110 gender 964b
53Zy2Hh5SrOaoVqEOhBxXA node-2110 192.168.1.10 node-2110 cluster_uuid 1.3kb
53Zy2Hh5SrOaoVqEOhBxXA node-2110 192.168.1.10 node-2110 kibana_stats.kibana.status 0b
53Zy2Hh5SrOaoVqEOhBxXA node-2110 192.168.1.10 node-2110 interests 284b
53Zy2Hh5SrOaoVqEOhBxXA node-2110 192.168.1.10 node-2110 state 1.7kb
53Zy2Hh5SrOaoVqEOhBxXA node-2110 192.168.1.10 node-2110 kibana_stats.kibana.uuid 0b
sumu-ytEQ2OqspomZDWrwA node-2111 192.168.1.11 node-2111 gender.keyword 704b
sumu-ytEQ2OqspomZDWrwA node-2111 192.168.1.11 node-2111 kibana_stats.kibana.uuid 0b
sumu-ytEQ2OqspomZDWrwA node-2111 192.168.1.11 node-2111 cluster_uuid 1.4kb
sumu-ytEQ2OqspomZDWrwA node-2111 192.168.1.11 node-2111 state.keyword 1kb
sumu-ytEQ2OqspomZDWrwA node-2111 192.168.1.11 node-2111 interests 560b
sumu-ytEQ2OqspomZDWrwA node-2111 192.168.1.11 node-2111 state 3.3kb
sumu-ytEQ2OqspomZDWrwA node-2111 192.168.1.11 node-2111 kibana_stats.kibana.status 0b
sumu-ytEQ2OqspomZDWrwA node-2111 192.168.1.11 node-2111 gender 2.1kb
TkItEB4QRkWn_-EZ3XpS1A node-2112 192.168.1.12 node-2112 interests 276b
TkItEB4QRkWn_-EZ3XpS1A node-2112 192.168.1.12 node-2112 gender 1.2kb
TkItEB4QRkWn_-EZ3XpS1A node-2112 192.168.1.12 node-2112 cluster_uuid 1016b
TkItEB4QRkWn_-EZ3XpS1A node-2112 192.168.1.12 node-2112 state 2.2kb
查看集群的各线程状态:
# curl http://192.168.1.10:9200/_cat/thread_pool?pretty
node-2111 analyze 0 0 0
node-2111 fetch_shard_started 0 0 0
node-2111 fetch_shard_store 0 0 0
node-2111 flush 0 0 0
node-2111 force_merge 0 0 0
node-2111 generic 0 0 0
node-2111 get 0 0 0
node-2111 index 0 0 0
node-2111 listener 0 0 0
node-2111 management 1 0 0
node-2111 ml_autodetect 0 0 0
node-2111 ml_datafeed 0 0 0
node-2111 ml_utility 0 0 0
node-2111 refresh 0 0 0
node-2111 rollup_indexing 0 0 0
node-2111 search 0 0 0
node-2111 security-token-key 0 0 0
node-2111 snapshot 0 0 0
node-2111 warmer 0 0 0
node-2111 watcher 0 0 0
node-2111 write 0 0 0
node-2112 analyze 0 0 0
node-2112 fetch_shard_started 0 0 0
node-2112 fetch_shard_store 0 0 0
node-2112 flush 0 0 0
node-2112 force_merge 0 0 0
node-2112 generic 0 0 0
node-2112 get 0 0 0
node-2112 index 0 0 0
node-2112 listener 0 0 0
node-2112 management 1 0 0
node-2112 ml_autodetect 0 0 0
node-2112 ml_datafeed 0 0 0
node-2112 ml_utility 0 0 0
node-2112 refresh 0 0 0
node-2112 rollup_indexing 0 0 0
node-2112 search 0 0 0
node-2112 security-token-key 0 0 0
node-2112 snapshot 0 0 0
node-2112 warmer 0 0 0
node-2112 watcher 0 0 0
node-2112 write 0 0 0
node-2110 analyze 0 0 0
node-2110 fetch_shard_started 0 0 0
node-2110 fetch_shard_store 0 0 0
node-2110 flush 0 0 0
node-2110 force_merge 0 0 0
node-2110 generic 0 0 0
node-2110 get 0 0 0
node-2110 index 0 0 0
node-2110 listener 0 0 0
node-2110 management 1 0 0
node-2110 ml_autodetect 0 0 0
node-2110 ml_datafeed 0 0 0
node-2110 ml_utility 0 0 0
node-2110 refresh 0 0 0
node-2110 rollup_indexing 0 0 0
node-2110 search 0 0 0
node-2110 security-token-key 0 0 0
node-2110 snapshot 0 0 0
node-2110 warmer 0 0 0
node-2110 watcher 0 0 0
node-2110 write 0 0 0
查看集群正在等待的任务:
curl http://192.168.1.10:9200/_cat/pending_tasks?pretty
删除一个索引(test):
curl -XDELETE 'http://192.168.1.10:/9200/test'
关闭索引:
curl -XDELETE 'http://192.168.1.10:/9200/test/_close'
开启索引:
curl -XDELETE 'http://192.168.1.10:/9200/test/_open'
“用curl方式操作elasticsearch的常用方法有哪些”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。