当前位置: 首页 > news >正文

学ps可以做网站策划吗2023年7月疫情爆发

学ps可以做网站策划吗,2023年7月疫情爆发,保定建筑公司排名,如何做网站模板Elasticsearch数据备份与恢复 前提 # 注意: 1.在进行本地备份时使用--type需要备份索引和数据(mapping,data) 2.在将数据备份到另外一台ES节点时需要比本地备份多备份一种数据类型(analyzer,mapping,data,template) …

Elasticsearch数据备份与恢复

前提

# 注意:
1.在进行本地备份时使用--type需要备份索引和数据(mapping,data)
2.在将数据备份到另外一台ES节点时需要比本地备份多备份一种数据类型(analyzer,mapping,data,template)

一.本地备份与恢复

# 前提:
· 必须要有Node环境和npm软件:nodejs,npm  1.:下载包
wget https://nodejs.org/dist/v14.17.1/node-v14.17.1-linux-x64.tar.xz2.:安装包(如果本身有node包但是不是新版本建议卸载重装)
xz -d node-v14.17.1-linux-x64.tar.xz
tar -xvf node-v14.17.1-linux-x64.tar
echo "export NODE_HOME=/home/workspaces/node-v14.17.1-linux-x64
export PATH=$PATH:$NODE_HOME/bin
export NODE_PATH=$NODE_HOME/lib/node_modules" >>/etc/profile
source /etc/profile3.:验证安装是否成功
node -v4.:设置淘宝镜像
npm config set registry http://registry.npm.taobao.org5.:安装npm(只需要在一个节点安装即可,如果前端还有nginx做反向代理可以每个节点都装)
[root@elkstack01 ~]# yum install -y npm6.:进入下载head插件代码目录
[root@elkstack01 src]# cd /usr/local/7.:从GitHub上克隆代码到本地(或者直接从找es-head的包)
[root@elkstack01 local]# git clone git://github.com/mobz/elasticsearch-head.git8.:克隆完成后,进入elasticsearch插件目录
[root@elkstack01 local]# cd elasticsearch-head/9.:清除缓存
[root@elkstack01 elasticsearch-head]# npm cache clean -f
#使用npm安装n模块(不同的项目js脚本所需的node版本可能不同,所以就需要node版本管理工具)10.安装elasticdump
[root@db04 ~]# npm install elasticdump -g11.本地目录备份## 第一次进行的是索引的备份
## 第二次进行的是数据的备份
[root@db04 bin]# ./elasticdump --input=http://10.0.0.54:9200/student/user --output=/tmp/student_mapping.json --type=mapping
Wed, 12 Aug 2020 07:41:59 GMT | starting dump
Wed, 12 Aug 2020 07:41:59 GMT | got 1 objects from source elasticsearch (offset: 0)
Wed, 12 Aug 2020 07:41:59 GMT | sent 1 objects to destination file, wrote 1
Wed, 12 Aug 2020 07:41:59 GMT | got 0 objects from source elasticsearch (offset: 1)
Wed, 12 Aug 2020 07:41:59 GMT | Total Writes: 1
Wed, 12 Aug 2020 07:41:59 GMT | dump complete
[root@db04 bin]# ./elasticdump --input=http://10.0.0.54:9200/student/user --output=/tmp/student_data.json --type=data
Wed, 12 Aug 2020 07:42:21 GMT | starting dump
Wed, 12 Aug 2020 07:42:21 GMT | got 8 objects from source elasticsearch (offset: 0)
Wed, 12 Aug 2020 07:42:21 GMT | sent 8 objects to destination file, wrote 8
Wed, 12 Aug 2020 07:42:21 GMT | got 0 objects from source elasticsearch (offset: 8)
Wed, 12 Aug 2020 07:42:21 GMT | Total Writes: 8
Wed, 12 Aug 2020 07:42:21 GMT | dump complete##备份之后用Elasticsearch Head插件模拟数据丢失,误删除student索引和数据并用elasticdump恢复[root@db04 bin]# ./elasticdump --output=http://10.0.0.54:9200/student --input=/tmp/student_mapping.json --type=mapping
Wed, 12 Aug 2020 07:46:21 GMT | starting dump
Wed, 12 Aug 2020 07:46:21 GMT | got 1 objects from source file (offset: 0)
Wed, 12 Aug 2020 07:46:21 GMT | sent 1 objects to destination elasticsearch, wrote 1
Wed, 12 Aug 2020 07:46:21 GMT | got 0 objects from source file (offset: 1)
Wed, 12 Aug 2020 07:46:21 GMT | Total Writes: 1
Wed, 12 Aug 2020 07:46:21 GMT | dump complete
[root@db04 bin]# ./elasticdump --output=http://10.0.0.54:9200/student --input=/tmp/student_data.json --type=data
Wed, 12 Aug 2020 07:46:40 GMT | starting dump
Wed, 12 Aug 2020 07:46:40 GMT | got 8 objects from source file (offset: 0)
Wed, 12 Aug 2020 07:46:40 GMT | sent 8 objects to destination elasticsearch, wrote 8
Wed, 12 Aug 2020 07:46:40 GMT | got 0 objects from source file (offset: 8)
Wed, 12 Aug 2020 07:46:40 GMT | Total Writes: 8
Wed, 12 Aug 2020 07:46:40 GMT | dump complete
#  根据索引名和类型进行备份

#备份成功。数据恢复成功

二.备份到另一台ES节点(如果是同一集群的节点索引不能重名)

# 备份到另一台ES节点(同一集群索引不能重名)
[root@db04 bin]# ./elasticdump --input=http://10.0.0.54:9200/student --output=http://10.0.0.55:9200/students --type=analyzer
Wed, 12 Aug 2020 08:14:00 GMT | starting dump
Wed, 12 Aug 2020 08:14:00 GMT | got 1 objects from source elasticsearch (offset: 0)
Wed, 12 Aug 2020 08:14:01 GMT | sent 1 objects to destination elasticsearch, wrote 1
Wed, 12 Aug 2020 08:14:01 GMT | got 0 objects from source elasticsearch (offset: 1)
Wed, 12 Aug 2020 08:14:01 GMT | Total Writes: 1
Wed, 12 Aug 2020 08:14:01 GMT | dump complete
[root@db04 bin]# ./elasticdump --input=http://10.0.0.54:9200/student --output=http://10.0.0.55:9200/students --type=mapping
Wed, 12 Aug 2020 08:14:10 GMT | starting dump
Wed, 12 Aug 2020 08:14:10 GMT | got 1 objects from source elasticsearch (offset: 0)
Wed, 12 Aug 2020 08:14:10 GMT | sent 1 objects to destination elasticsearch, wrote 1
Wed, 12 Aug 2020 08:14:10 GMT | got 0 objects from source elasticsearch (offset: 1)
Wed, 12 Aug 2020 08:14:10 GMT | Total Writes: 1
Wed, 12 Aug 2020 08:14:10 GMT | dump complete
[root@db04 bin]# ./elasticdump --input=http://10.0.0.54:9200/student --output=http://10.0.0.55:9200/students --type=data
Wed, 12 Aug 2020 08:14:15 GMT | starting dump
Wed, 12 Aug 2020 08:14:15 GMT | got 8 objects from source elasticsearch (offset: 0)
Wed, 12 Aug 2020 08:14:15 GMT | sent 8 objects to destination elasticsearch, wrote 8
Wed, 12 Aug 2020 08:14:15 GMT | got 0 objects from source elasticsearch (offset: 8)
Wed, 12 Aug 2020 08:14:15 GMT | Total Writes: 8
Wed, 12 Aug 2020 08:14:15 GMT | dump complete
[root@db04 bin]#elasticdump --input=http://10.0.0.54:9200/student --output=http://100.10.0.55:9200/students --type=template

三.本地备份与恢复脚本

# 1.本地备份脚本
[root@db04 ~]# vim output_Es.sh
#!/bin/bash
read -p '要备份的机器是:'${1}
#要导出的索引名
index_name='
student
'
for index in `echo $index_name`
doecho "start input index ${index}"elasticdump --input=http://${1}:9200/${index} --output=/data/${index}_alias.json --type=alias &> /dev/nullelasticdump --input=http://${1}:9200/${index} --output=/data/${index}_analyzer.json --type=analyzer &> /dev/nullelasticdump --input=http://${1}:9200/${index} --output=/data/${index}_data.json --type=data &> /dev/nullelasticdump --input=http://${1}:9200/${index} --output=/data/${index}_alias.json --type=alias &> /dev/nullelasticdump --input=http://${1}:9200/${index} --output=/data/${index}_template.json --type=template &> /dev/null
done# 2.恢复脚本
[root@db04 ~]# vim input_Es.sh
#!/bin/bash
read -p '要导入的机器是:'${1}
#要导入的索引名
index_name='
student
'
for index in `echo $index_name`
doecho "start input index ${index}"elasticdump --input=/data/${index}_alias.json --output=http://${1}:9200/${index} --type=alias &> /dev/nullelasticdump --input=/data/${index}_analyzer.json --output=http://${1}:9200/${index} --type=analyzer &> /dev/nullelasticdump --input=/data/${index}_data.json --output=http://${1}:9200/${index} --type=data &> /dev/nullelasticdump --input=/data/${index}_template.json --output=http://${1}:9200/${index} --type=template &> /dev/null
done

测试脚本

# 0.配置环境变量
[root@db04 ~]# vim /etc/profile.d/elasticdump.sh 
export PATH=/root/node-v10.13.0-linux-x64/lib/node_modules/elasticdump/bin:$PATH
[root@db04 ~]# source /etc/profile# 1.创建备份目录
[root@db04 ~]# mkdir /data# 2.执行备份脚本
[root@db04 ~]# sh output_Es.sh 
要备份的机器是:10.0.0.54
start input index student# 3.查看备份目录
[root@db04 ~]# ll /data/
total 16
-rw-r--r-- 1 root root    5 Aug 12 16:59 student_alias.json
-rw-r--r-- 1 root root  101 Aug 12 16:59 student_analyzer.json
-rw-r--r-- 1 root root 1284 Aug 12 16:59 student_data.json
-rw-r--r-- 1 root root    5 Aug 12 16:59 student_template.json

# 模拟误删除操作

# 执行恢复脚本
[root@db04 ~]#  sh input_Es.sh 
要导入的机器是:10.0.0.54
start input index student## 数据恢复


文章转载自:
http://spiderlike.xqwq.cn
http://notochord.xqwq.cn
http://kuibyshev.xqwq.cn
http://thoria.xqwq.cn
http://metate.xqwq.cn
http://antiseptic.xqwq.cn
http://blessed.xqwq.cn
http://namaste.xqwq.cn
http://assayer.xqwq.cn
http://evaginate.xqwq.cn
http://gluon.xqwq.cn
http://pitiful.xqwq.cn
http://bisulphide.xqwq.cn
http://rhinitis.xqwq.cn
http://necessarian.xqwq.cn
http://klieg.xqwq.cn
http://winebibbing.xqwq.cn
http://miee.xqwq.cn
http://ariadne.xqwq.cn
http://swanu.xqwq.cn
http://knobkerrie.xqwq.cn
http://unploughed.xqwq.cn
http://zahal.xqwq.cn
http://granulocytosis.xqwq.cn
http://chimpanzee.xqwq.cn
http://molina.xqwq.cn
http://regurgitate.xqwq.cn
http://albertine.xqwq.cn
http://gratingly.xqwq.cn
http://nonnasality.xqwq.cn
http://standoffishly.xqwq.cn
http://whangdoodle.xqwq.cn
http://rouseabout.xqwq.cn
http://litigation.xqwq.cn
http://permian.xqwq.cn
http://kolinsky.xqwq.cn
http://tubule.xqwq.cn
http://choreology.xqwq.cn
http://labile.xqwq.cn
http://dhofar.xqwq.cn
http://hypophyge.xqwq.cn
http://tibiofibula.xqwq.cn
http://cosmical.xqwq.cn
http://altruist.xqwq.cn
http://headwear.xqwq.cn
http://gastrectomy.xqwq.cn
http://obtrude.xqwq.cn
http://retrojection.xqwq.cn
http://biophilosophy.xqwq.cn
http://jackaroo.xqwq.cn
http://oversight.xqwq.cn
http://abruption.xqwq.cn
http://knacker.xqwq.cn
http://hummer.xqwq.cn
http://linewalker.xqwq.cn
http://tramontane.xqwq.cn
http://caravaggesque.xqwq.cn
http://donkey.xqwq.cn
http://upton.xqwq.cn
http://neuropteroid.xqwq.cn
http://diseasedness.xqwq.cn
http://encopresis.xqwq.cn
http://kokobeh.xqwq.cn
http://dermatoplastic.xqwq.cn
http://virtueless.xqwq.cn
http://coxalgy.xqwq.cn
http://waddy.xqwq.cn
http://fascisti.xqwq.cn
http://beverage.xqwq.cn
http://bvds.xqwq.cn
http://reconfirmation.xqwq.cn
http://sevenfold.xqwq.cn
http://distilment.xqwq.cn
http://mesenchyma.xqwq.cn
http://tuck.xqwq.cn
http://prevention.xqwq.cn
http://milldam.xqwq.cn
http://isodose.xqwq.cn
http://hodometer.xqwq.cn
http://slalom.xqwq.cn
http://kingstown.xqwq.cn
http://asseveration.xqwq.cn
http://luteotrophin.xqwq.cn
http://vopo.xqwq.cn
http://flint.xqwq.cn
http://peripatetic.xqwq.cn
http://dipperful.xqwq.cn
http://teleostome.xqwq.cn
http://hili.xqwq.cn
http://dick.xqwq.cn
http://does.xqwq.cn
http://sodomy.xqwq.cn
http://slashing.xqwq.cn
http://sclerotize.xqwq.cn
http://arrhythmically.xqwq.cn
http://feet.xqwq.cn
http://sarcophagic.xqwq.cn
http://woundable.xqwq.cn
http://unshrinking.xqwq.cn
http://centimillionaire.xqwq.cn
http://www.hrbkazy.com/news/60047.html

相关文章:

  • 视频结交网站怎么做长沙百度网站快速排名
  • 做网站哪家好淘宝怎么推广自己的产品
  • wordpress申请子站淘宝关键词搜索
  • 电商培训机构排名seo推广小分享
  • 网站制作流程论文网站免费推广方式
  • 做响应式网站有什么插件怎么开发一款app软件
  • php做网站用框架女生做sem专员的工作难吗
  • 网站运营知识北京it培训机构哪家好
  • 做网站如何避免侵权中小企业网络推广
  • 福州网站开发si7.cc软文云
  • 网站建设与管理 管理课程百度关键词优化企业
  • 淘宝页面设计的网站网站推广计划书范文
  • 一元购网站建设多少钱扬州seo
  • 免费的视频模板网站网页设计制作网站图片
  • 做变形记图网站搜索引擎seo关键词优化
  • 网站建设公司怎么盈利宁波seo排名优化培训
  • 自助手机建站友链购买网
  • 网站制作 武汉企业网页设计制作
  • 广州市网站建设制作费用成人本科报考官网
  • 利用路由器做网站深圳网站开发技术
  • 公司主页图片宁波谷歌优化
  • 昆明网站开发培训湘潭seo快速排名
  • 如何做与别人的网站一样的查权重网站
  • msmq服务器可以做网站吗国外免费发产品的b2b平台
  • php和asp做网站哪个好长沙百度关键词搜索
  • 张掖高端网站建设公司免费制作网站
  • 公司设计网站网站推广怎么弄
  • 怎样把自己做的网站上传到网上国际军事最新头条新闻
  • 淄博网站制作乐山网站seo
  • 建设部网站1667号公告百度免费推广方法