内存分析: MAT工具
查看所有索引
`curl -u username:password "$es/_cat/indices?v"`
删除索引
curl -XDELETE -u username:password "$es/active-logs-1"
查看集群状态
`curl -XGET "$es/_cluster/health?pretty"`
查看线程池和请求拒绝情况
curl '192.168.11.228:9200/_cat/thread_pool/?v&h=id,name,active,rejected,completed,size,type&pretty&s=type'
查看单个index的状态
`curl -XGET "/_cluster/health/goods_id?pretty"`
查看线程池情况
`curl -XGET http://es:9200/_cat/GET /_cat/thread_pool/?v&h=id,name,active,rejected,completed,size,type&pretty&s=type`
查看哪个线程CPU利用率最高
`curl -XGET http://es:9200/_nodes/hot_threads`
查看es配置
`curl -XGET -u elastic:paaaword 'es-cn-i7m2ro5fb000sl33h.elasticsearch.aliyuncs.com:9200/_settings/_all?pretty'`
查看节点上分片情况
curl "$es/_cat/allocation?v"
查询指定索引的mapping
curl -u 'elastic:password' -X GET 'http://$es:9288/index_test1/_mapping'
创建指定索引和mapping
curl -u 'elastic:password' -X PUT 'http://$es:9288/index_test1' -H 'Content-Type: application/json' -d '{
"mappings" : {
"properties" : {
"adzoneId" : {
"type" : "keyword"
},
"adzoneName" : {
"type" : "keyword"
},
"alimamaRate" : {
"type" : "float"
}}
}
添加一条mapping字段
curl -X PUT 'http://{es}:9288/test_yxd/_mapping' -H 'Content-Type: application/json' -d '
{
"properties": {
"sign": {
"type": "keyword"
},
"clickTime" : {
"type" : "date",
"format" : "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis",
"ignore_malformed" : true
}
}
}'
在索引名为test_yxd的mapping中添加一个名为sign的字段,类型为keyword