elasticsearch
peng_zhi_hui
这个作者很懒,什么都没留下…
展开
-
脚本index.sh——控制频率往es写数据
脚本技术要点: 1、切割文件 2、http接口写es #!/bin/bash es_server=127.0.0.1 #for i in `ls esCrash.data*` for i in `ls *data* |grep -v "\-D\-"` do line_num=$(wc -l $i |awk '{print $1}') if [原创 2017-11-17 10:18:20 · 704 阅读 · 0 评论 -
脚本——根据昨天es索引的大小,提前创建明天的索引
脚本主要用到的技术点有: 1、date命令格式化输出 2、for循环 3、grep -E 用法 4、bc计算 5、es通过http接口检查索引存在方法,es通过http接口数据写入方法,es通过http创建索引方法原创 2017-11-16 10:26:17 · 1127 阅读 · 0 评论 -
es索引管理工具——curator
curator_run.sh脚本 ================================================== #!/bin/bash CURATOR_PROG="/usr/bin/curator" CURATOR_PATH="/data/disk/sda1/software/scripts/curator" CURATOR_CONF="${CURATOR_P原创 2017-11-16 10:48:18 · 1214 阅读 · 0 评论 -
自动迁移关闭es聚合索引
脚本技术要点 curator工具使用 脚本内容如下: ======================================================================== #!/bin/bash if [ -z "$(which curator 2>/dev/null)" ];then echo no tool curat原创 2017-12-21 15:53:41 · 1048 阅读 · 0 评论 -
节点重启后分片不恢复,日志也没有什么错误提示,最终手动恢复
手动恢复方法: 通过以下脚本生成恢复unassigned分片的脚本 #!/bin/sh for index in $(curl -s 'http://localhost:9200/_cat/shards' | grep UNASSIGNED | awk '{print $1}' | sort | uniq); do for shard in原创 2017-12-31 13:05:08 · 287 阅读 · 0 评论 -
elasticsearch索引备份恢复、跨集群迁移
参考链接: https://www.elastic.co/guide/en/elasticsearch/guide/current/backing-up-your-cluster.html# 坑或者是注意事项 indices属于某种node.box_type,恢复索引的目标机群需要有这种type的节点,不然会恢复不了。 indices需要open。 步骤: 1、创建原创 2017-12-31 16:22:41 · 2072 阅读 · 0 评论 -
elasticsearch调优经验
es节点重启注意点:1、暂停数据写入程序 (如果条件允许,正式环境一般不会允许,我们是es写如果有问题数据会落地回头再写入es,所以也可以允许!!!!! 这种情况基本不会出现 需要重启整个es集群)2、关闭集群shard allocation3、手动执行POST /_flush/synced4、重启结点5、重新开启集群shard allocation 6、等待recovery完成,集群healt原创 2017-11-14 13:10:04 · 2861 阅读 · 0 评论