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
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
2
3
上次更新: 10/2/2024
- 02
- Flink 集群部署指南 原创09-20
- 03
- MongoDB 集群Config Server 复制集的工作原理09-14