日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ES备份工具elasticdump

發(fā)布時間:2025/3/8 编程问答 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ES备份工具elasticdump 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

安裝

下載node下載 | Node.js 中文網(wǎng)

tar ?xvf node-v16.5.0-linux-x64.tar.xz?

ln -s /app/temp/node-v16.5.0-linux-x64/bin/node /usr/bin/node
ln -s /app/temp/node-v16.5.0-linux-x64/bin/npm /usr/bin/npm

?npm install elasticdump -g

npm config get cache

npm install --cache /root/.npm --optional --cache-min 99999999999 --shrinkwrap false elasticdump

strings /lib64/libc.so.6 |grep GLIBC_
tar zxvf glibc-2.17.tar.gz

cd glibc-2.17

mkdir build

? cd build/
?

../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin

make && make install
ln -s /usr/lib64/libstdc++.so.6.0.17 /usr/lib64/libstdc++.so.6


/app/node_modules/elasticdump/bin/elasticdump --input=http://*******/auth_all --output=/app/msy_index_mappingss1.json --type=mapping

elasticdump \--input=http://production.es.com:9200/my_index \--output=$ \| gzip > /data/my_index.json.gz

elasticdump \--input=http://*********/my_index \--output=$ \| gzip > /data/my_index.json.gz# 把一個查詢結(jié)果備份到文件中 elasticdump \--input=http://************/my_index \--output=query.json \--searchBody '{"query":{"term":{"username": "admin"}}}' #!/bin/bash esdir=/app/es/bakdir opdt_index=opdt_all auth_index=auth_all datat_type=data mapping_type=mapping datefile=`date +"%Y%m%d"` IP=***** PORT=***** baktype=$1 if [ ! -d ${esdir} ];thenmkdir -p ${esdir} fiif [ ! -d ${esdir}/${datefile} ];thenmkdir -p ${esdir}/${datefile} fielasticdumpbak () {index=$1baktype=$2/app/node_modules/elasticdump/bin/elasticdump --input=http://${IP}:${PORT}/${index} \--output=${esdir}/${datefile}/${index}-${baktype}-${datefile}.json --type=$baktype if [ $? -eq 0 ];thencd ${esdir}/${datefile}/tar czf ${index}-${baktype}-${datefile}.tar.gz ${index}-${baktype}-${datefile}.jsonrm -rf ${index}-${baktype}-${datefile}.jsonelseecho "${index}-${baktype}未備份成功">${esdir}/${index}-${baktype}.logfi }elasticdumpbak $opdt_index $datat_type elasticdumpbak $auth_index $datat_type elasticdumpbak $opdt_index $mapping_type elasticdumpbak $auth_index $mapping_type

總結(jié)

以上是生活随笔為你收集整理的ES备份工具elasticdump的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。