Carry の Blog Carry の Blog
首页
  • Nginx
  • Prometheus
  • Iptables
  • Systemd
  • Firewalld
  • Docker
  • Sshd
  • DBA工作笔记
  • MySQL
  • Redis
  • TiDB
  • Elasticsearch
  • Python
  • Shell
  • MySQL8-SOP手册
  • 分类
  • 标签
  • 归档
GitHub (opens new window)

Carry の Blog

好记性不如烂键盘
首页
  • Nginx
  • Prometheus
  • Iptables
  • Systemd
  • Firewalld
  • Docker
  • Sshd
  • DBA工作笔记
  • MySQL
  • Redis
  • TiDB
  • Elasticsearch
  • Python
  • Shell
  • MySQL8-SOP手册
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • Shell

    • 每多少行添加一行文字
    • Telegram Bot 自动发送消息和文件脚本
    • esm全量迁移es数据
  • 蹩脚编程
  • Shell
Carry の Blog
2022-02-26

esm全量迁移es数据

curl -s -uelastic:mypassword123 http://192.168.11.63:9200/_cat/indices|awk '{print $3}'|egrep -v '^\.'  >log_index_list
1

if test $# -ne 2; then
  echo -e "Usage: $(basename $0)  \033[1;33mbegin_day  end_day\033[m"
  echo -e "Example1: $(basename $0)  \033[1;33m2022-01-05 2022-01-07\033[m"
  exit 1
fi
begin_day=`date -d "$1" +%s000`
end_day=`date -d "$2" +%s000`
while IFS= read -r line; do
        /usr/local/esm/esm -s http://192.168.11.63:19200  -d http://192.168.11.181:19200 -x ${line} -m elastic:'mypassword123' -n elastic:'mypassword123'  -w 10  -t 5m -b 10 -q "createdAt:[$begin_day TO $end_day]" --copy_settings   --copy_mappings
        sleep 1
done < ./log_index_list

1
2
3
4
5
6
7
8
9
10
11
12
13

使用方法:

[carry@localhost esm]# bash esm.sh
Usage: esm.sh  begin_day  end_day
Example1: esm.sh  2022-01-05 2022-01-07
1
2
3
上次更新: 4/24/2025

← Telegram Bot 自动发送消息和文件脚本

最近更新
01
tidb fast ddl
04-04
02
TiDB配置文件调优 原创
04-03
03
如何移除TiDB中的表分区 原创
04-03
更多文章>
Theme by Vdoing
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式