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

郓城县网站建设合肥包河区最新消息

郓城县网站建设,合肥包河区最新消息,怎样在手机上面建设网站,南京网站seo服务本文使用 elasticdump 做数据迁移#xff0c;支持在线和离线俩种方式#xff0c;适用于数据量比较小的情况。 1、Node 安装 由于elasticdump 依赖于 node#xff0c;首先需要安装下node。 1.1、 Linux 安装 $ wget https://nodejs.org/dist/v10.15.0/node-v10.15.0-linu… 本文使用 elasticdump 做数据迁移支持在线和离线俩种方式适用于数据量比较小的情况。 1、Node 安装 由于elasticdump 依赖于 node首先需要安装下node。 1.1、 Linux 安装 $ wget https://nodejs.org/dist/v10.15.0/node-v10.15.0-linux-x64.tar.xz $ tar -xf node-v10.15.0-linux-x64.tar.xz #配置相关的环境变量 $ vim /etc/profilePATH$PATH:/software/node-v10.15.0-linux-x64/bin $ source /etc/profile1.2、Windows安装 选择对应的windows版本一路下一步即可以下是64位的安装包标注 2、安装 elasticdump linux和windows基本相同建议全局安装下 #本地安装和全局安装的区别在于它是否自动给你设置环境变量其他的没有区别 # 本地安装 $ npm install elasticdump $ ./bin/elasticdump # 全局安装 $ npm install elasticdump -g $ elasticdump3、数据迁移 ES索引的迁移需要一个个的迁移并且分analyzer、mapping、data三部分。 备注 http://production.es.com:9200/my_index 为源索引 http://staging.es.com:9200/my_index 为目标索引 “” 为换行符一行可以不用写 如果es是有用户密码做为鉴权的则需要修改下URL # 注意 elasticdump 提供给了--httpAuthFile 参数来做认证 --httpAuthFile When using http auth provide credentials in ini file in formuserusernamepasswordpassword# 只需要写一个ini文件 文件中写入用户名和密码就可以了# 这里其实还有另外一个好的方法# 在--input参数和--output参数的的url中添加账号密码# 例如 elasticdump \--inputhttp://prod-username:prod-passowrdproduction.es.com:9200/my_index \--outputhttp://stage-username:stage-passwordstaging.es.com:9200/my_index \--typedata3.1、在线迁移 #拷贝analyzer分词 elasticdump \--inputhttp://production.es.com:9200/my_index \--outputhttp://staging.es.com:9200/my_index \--typeanalyzer #拷贝映射 elasticdump \--inputhttp://production.es.com:9200/my_index \--outputhttp://staging.es.com:9200/my_index \--typemapping #拷贝数据 elasticdump \--inputhttp://production.es.com:9200/my_index \--outputhttp://staging.es.com:9200/my_index \--typedata3.2、离线迁移 3.2.1 备份 # 备份索引数据到文件里: elasticdump \--inputhttp://production.es.com:9200/my_index \--output/data/my_index_mapping.json \--typemapping elasticdump \--inputhttp://production.es.com:9200/my_index \--output/data/my_index.json \--typedata# 备份到标准输出且进行压缩这里有一个需要注意的地方我查询索引信息有6.4G用下面的方式备份后得到一个789M的压缩文件这个压缩文件解压后有19G: elasticdump \--inputhttp://production.es.com:9200/my_index \--output$ \| gzip /data/my_index.json.gz# 把一个查询结果备份到文件中 elasticdump \--inputhttp://production.es.com:9200/my_index \--outputquery.json \--searchBody {query:{term:{username: admin}}}3.2.2 恢复 # 将备份文件的数据导入ES elasticdump \--input./data.json \--outputhttp://es.com:9200 4、Docker 环境下ES迁移 # 镜像下载 $ docker pull taskrabbit/elasticsearch-dump # 下面还是例子通过镜像导出数据到本地 # 创建一个文件夹用于保存导出数据 $ mkdir -p /root/data # 下面需要对路径进行映射并执行命令导出mapping $ docker run --rm -ti -v /data:/tmp taskrabbit/elasticsearch-dump \--inputhttp://production.es.com:9200/my_index \--output/tmp/my_index_mapping.json \--typemapping # 导出data $ docker run --rm -ti -v /root/data:/tmp taskrabbit/elasticsearch-dump \--inputhttp://192.168.56.104:9200/test_index \--output/tmp/elasticdump_export.json \--typedata----------------------------------------------------------------------------- # 以下内容为ES - ES的数据迁移例子 $ docker run --rm -ti taskrabbit/elasticsearch-dump \--inputhttp://production.es.com:9200/my_index \--outputhttp://staging.es.com:9200/my_index \--typemapping $ docker run --rm -ti taskrabbit/elasticsearch-dump \--inputhttp://production.es.com:9200/my_index \--outputhttp://staging.es.com:9200/my_index \--typedata 5、附录 # Copy an index from production to staging with analyzer and mapping: elasticdump \--inputhttp://production.es.com:9200/my_index \--outputhttp://staging.es.com:9200/my_index \--typeanalyzer elasticdump \--inputhttp://production.es.com:9200/my_index \--outputhttp://staging.es.com:9200/my_index \--typemapping elasticdump \--inputhttp://production.es.com:9200/my_index \--outputhttp://staging.es.com:9200/my_index \--typedata# Backup index data to a file: elasticdump \--inputhttp://production.es.com:9200/my_index \--output/data/my_index_mapping.json \--typemapping elasticdump \--inputhttp://production.es.com:9200/my_index \--output/data/my_index.json \--typedata# Backup and index to a gzip using stdout: elasticdump \--inputhttp://production.es.com:9200/my_index \--output$ \| gzip /data/my_index.json.gz# Backup the results of a query to a file elasticdump \--inputhttp://production.es.com:9200/my_index \--outputquery.json \--searchBody{query:{term:{username: admin}}}# Copy a single shard data: elasticdump \--inputhttp://es.com:9200/api \--outputhttp://es.com:9200/api2 \--params{preference : _shards:0}# Backup aliases to a file elasticdump \--inputhttp://es.com:9200/index-name/alias-filter \--outputalias.json \--typealias# Import aliases into ES elasticdump \--input./alias.json \--outputhttp://es.com:9200 \--typealias# Backup templates to a file elasticdump \--inputhttp://es.com:9200/template-filter \--outputtemplates.json \--typetemplate# Import templates into ES elasticdump \--input./templates.json \--outputhttp://es.com:9200 \--typetemplate# Split files into multiple parts elasticdump \--inputhttp://production.es.com:9200/my_index \--output/data/my_index.json \--fileSize10mb# Import data from S3 into ES (using s3urls) elasticdump \--s3AccessKeyId ${access_key_id} \--s3SecretAccessKey ${access_key_secret} \--input s3://${bucket_name}/${file_name}.json \--outputhttp://production.es.com:9200/my_index# Export ES data to S3 (using s3urls) elasticdump \--s3AccessKeyId ${access_key_id} \--s3SecretAccessKey ${access_key_secret} \--inputhttp://production.es.com:9200/my_index \--output s3://${bucket_name}/${file_name}.json
http://www.hkea.cn/news/14472165/

相关文章:

  • wordpress站内搜索统计代理备案 网站 安全吗
  • 营销平台网站建设本地wordpress站点上传文件
  • 建设部网标准下载网站做西班牙语网站
  • 网站站点怎么做淄博网络公司做网站的电话
  • 自己开网站怎么开谷歌在线浏览器免费入口
  • 网站建立需要多少钱php网站开发框架
  • 百度有哪些网站可免费做软件推广国外大气网站欣赏
  • 长春建站程序杭州定制网站制作
  • net建站系统宝安区建设工程交易服务中心
  • 电子商务网站建设作用建个什么网站好呢
  • 哈密市建设局网站洛可可
  • 懒人手机网站模板wordpress淘宝组件插件
  • 网页设计做一个介绍自己的的网站wordpress 表单
  • 铝合金做网站做企业官网用什么开发
  • 网站是做推广好还是优化好百度总部公司地址在哪里
  • 网站引导页怎么做自己做静态网站的步骤
  • 公司网站制作专业公司合租网站设计
  • 提高网站公信力 单仁北京手机软件开发公司
  • 橘子建站网站设置gif禁用
  • 门户网站 商城系统常用的网络营销推广方法有哪些
  • 买软件的网站建设国外免费wordpress主题
  • 专做男装的网站pc和移动版网站
  • 招远网站制作网站被黑了你会怎么想你该怎么做
  • 一个网站空间可以做多少个网站广西互联网营销公司
  • 苏州外贸网站制作成都网页编辑器开发
  • 沧州网站建设公司翼马公司做网站的价格
  • 佛山市南海区水利投资建设有限公司网站wordpress 会议主题
  • 网站里的活动专题栏怎么做域名解析网站登录
  • 做网站需要哪些人手网页制作与网站建设完全学习手册pdf
  • 营销型网站建设广州常州网络推广网站