当前位置:网站首页>elastic常用高频命令
elastic常用高频命令
2022-07-28 05:27:00 【opreator.ke】
1.查看单个节点信息
curl http://127.0.0.1:92002.查看集群信息
curl http://127.0.0.1:9200/_cat/nodes?v3.查看单节点索引信息
curl -X GET '127.0.0.1:9200/_cat/indices?v'4.查看集群健康检查
curl -XGET 'http://127.0.0.1:9200/_cluster/health?pretty=true'5.处理index read-only/ allow delete
curl -XPUT -H "Content-Type: application/json" http://127.0.0.1:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'6.kibana 自动创建索引配置
curl -f -XPOST -H 'Content-Type: application/json' -H 'kbn-xsrf: anything' \
"http://127.0.0.1:5601/api/saved_objects/index-pattern/logname-{$date}" -d"{\"attributes\":{\"title\":\"logname*\",\"timeFieldName\":\"@timestamp\"}}"
7.批量调整索引yellow,设置副本集为0
curl -XPUT "http://localhost:9200/_settings" -H 'Content-Type: application/json' -d'
{
"index" : {
"number_of_replicas" : 0
}
}'8.恢复副本集为1
curl -XPUT "http://localhost:9200/_settings" -H 'Content-Type: application/json' -d'
{
"index" : {
"number_of_replicas" : 1
}
}'9.kibana 创建索引,$index 为需要创建的索引
curl -f -XPOST -H 'Content-Type: application/json' -H 'kbn-xsrf: anything' "http://127.0.0.1:5601/api/saved_objects/index-pattern/$index-{$date}" -d"{\"attributes\":{\"title\":\"$index*\",\"timeFieldName\":\"@timestamp\"}}"10. kibana 批量创建索引
file=demo.txt
#获取索引文件行数
num=`wc -l ${file} | awk '{print $1}'`
echo $num
#开始循环创建索引
for((i=1;i<=${num};i++));
do
echo "for循环--$i"
index=`sed -n "${i}p" $file | awk '{print $1}'`
echo "索引名称: "$index
curl -f -XPOST -H 'Content-Type: application/json' -H 'kbn-xsrf: anything' \
"http://127.0.0.1:5601/api/saved_objects/index-pattern/${index}-{$date}" -d"{\"attributes\":{\"title\":\"${index}*\",\"timeFieldName\":\"@timestamp\"}}"
done边栏推荐
- Leetcode 刷题日记 剑指 Offer II 048. 序列化与反序列化二叉树
- 图形管线基础(二)
- Pyppeteer is recognized to bypass detection
- [hash table basics]
- 【二叉树基础知识】
- Bug experience related to IAP jump of stm32
- 图形管线基础(番外篇)
- 【详解如何一步步实现三子棋】
- Leetcode brush question diary sword finger offer II 053. Medium order successor in binary search tree
- Leetcode brush question diary sword finger offer II 048. serialization and deserialization binary tree
猜你喜欢
随机推荐
OJ 1253 点菜问题
Project compilation nosuch*** error problem
Treasure plan TPC system development DAPP construction
What are the open earphones? Four types of air conduction earphones with excellent sound quality are recommended
Execjs call
SSAO by computer shader (I)
项目编译NoSuch***Error问题
OJ 1507 deletion problem
动态规划--简单题型之爬楼梯
Water bottle effect production
订单交易简析
Battle plague Cup -- strange shape
Fermat's theorem
【C笔记】数据类型及存储
Leetcode brush questions diary sword finger offer II 047. Binary tree pruning
STM32的IAP跳转相关bug经历
OJ 1451 digital games
What is the best and most cost-effective open headset recommended
OJ 1131 美丽数
Two dimensional array practice: spiral matrix





![[C note] data type and storage](/img/3d/6b7a848dff5a8c0ccd0a54c19bce46.png)
![[PTA----树的遍历]](/img/d8/260317b30d624f8e518f8758706ab9.png)


