`curl '10.95.32.34:9200/_cat/indices?v'`
創(chuàng)建索引
成都創(chuàng)新互聯(lián)公司專注于定日企業(yè)網(wǎng)站建設(shè),成都響應(yīng)式網(wǎng)站建設(shè)公司,成都做商城網(wǎng)站。定日網(wǎng)站建設(shè)公司,為定日等地區(qū)提供建站服務(wù)。全流程按需定制設(shè)計,專業(yè)設(shè)計,全程項(xiàng)目跟蹤,成都創(chuàng)新互聯(lián)公司專業(yè)和態(tài)度為您提供的服務(wù)
curl -XPUT '10.95.32.34:9200/customer-test?pretty'
插入數(shù)據(jù):
curl -XPUT '10.95.32.34:9200/customer-test/employee/2?pretty' -d '{"name": "John smart"}'
curl -XPUT '10.95.32.34:9200/customer-test/employee/1' -d '{"first_name":"John","last_name":"Smith","age":25,"about":"Ilovetogorockclimbing","interests":["sports","music"]}'
查看數(shù)據(jù):
curl -XPOST '10.95.32.34:9200/customer-test/_search?pretty'
查看健康:
[root@server02 ~]# curl -sXGET 'http://localhost:9200/_cluster/health?pretty'
{
"cluster_name" : "es",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 9,
"number_of_data_nodes" : 9,
"active_primary_shards" : 129,
"active_shards" : 258,
"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 -s "http://localhost:9200/_cat/shards" | grep UNASSIGNED
刪除索引:
curl -XDELETE 'http://localhost:9200/noah_flow_file_20190625'
curl -s 'http://localhost:9200/_cat/shards' | grep UNASSIGNED | awk '{print $1}' | sort | uniq