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

长沙网站开发推荐网站上做旅游卖家要学什么条件

长沙网站开发推荐,网站上做旅游卖家要学什么条件,做网站怎么推广,企业注册登记信息查询ElasticSearch 数据迁移工具elasticdump Elasticdump 是一个用于导入和导出 Elasticsearch 数据的命令行工具。它提供了一种方便的方式来在不同的 Elasticsearch 实例之间传输数据#xff0c;或者进行数据备份和恢复。 使用 Elasticdump#xff0c;你可以将 Elasticsearch …ElasticSearch 数据迁移工具elasticdump Elasticdump 是一个用于导入和导出 Elasticsearch 数据的命令行工具。它提供了一种方便的方式来在不同的 Elasticsearch 实例之间传输数据或者进行数据备份和恢复。 使用 Elasticdump你可以将 Elasticsearch 索引中的数据导出为 JSON 文件或者将 JSON 文件中的数据导入到 Elasticsearch 索引中。它支持各种选项和过滤器用于指定源和目标包括索引模式、文档类型、查询过滤器等等。 主要特征包括 支持在Elasticsearch实例或者集群之间传输和备份数据。可以将数据从一个集群复制到另一个集群。支持不同格式的数据传输,包括JSON、NDJSON、CSV、备份文件等。可以通过命令行或者程序化的方式使用。命令行方式提供了便捷的操作接口。支持增量式同步,只复制目标集群中不存在的文档。支持各种认证方式连接Elasticsearch,如basic auth、Amazon IAM等。支持多线程操作,可以加快数据迁移的速度。开源免费,代码托管在GitHub上。 一、安装node 首先获取安装包 wget https://nodejs.org/dist/v16.14.0/node-v16.14.0-linux-x64.tar.xz tar axf node-v16.14.0-linux-x64.tar.xz -C /usr/local/ mv /usr/local/node-v16.14.0-linux-x64 /usr/local/node然后配置环境变量 vim /etc/profile export NODE_HOME/usr/local/node export PATH$NODE_HOME/bin:$PATH接下来刷新环境变量然后测试一下安装是否完成 source /etc/profilenode -vnpm -v如果是mac 的话可以使用brew 安装 brew install node16二、在线安装elasticdump 执行下面的命令安装 npm install elasticdump -g使用下面的命令查看安装目录 npm root -g我的位置在这里/opt/homebrew/lib/node_modules 三、离装elasticdump 这里的原理是将node安装包和elasticdump安装报复制到需要离线安装的服务器。 获取node 的离线安装包进行安装即可参考第一步获取elasticdump的安装包安装所以我们首选需要一个打包工具 npm install -g npm-pack-all然后我们切换到上面elasticdump的安装路打包elasticdump会在当前目录生成elasticdump-6.103.0.tgz 这样一个压缩包这就是我们离线安装需要的包 cd /opt/homebrew/lib/node_modules/elasticdump/ npm-pack-all到这里我们看到离线包已经生成好了接下来我们复制到我们之前已经安装好node 的机器上,执行下面的命令 npm install elasticdump-6.103.0.tgz后面为了方便使用我们可以配置一下elasticdump的环境变量 vim ~/.bashrc # 追加以下内容 #node export DUMP_HOME/opt/homebrew/lib/node_modules/elasticdump/ export PATH$DUMP_HOME/bin:$PATH # 刷新 source ~/.bashrc四、使用elasticdump 这里的使用主要分为两种一种是数据备份一种是数据迁移 备份主要指的是生成备份的数据文件在需要的时候进行还原数据迁移是指将原来索引里的数据迁移到新的索引 其实数据备份也能达到数据迁移的目的但是在两个环境的网络不通的时候我们只能使用数据备份 我们安装成功后在elasticdump的bin目录下其实有两个工具一个是elasticdump 另外一个是multielasticdump 数据迁移 迁移索引 elasticdump \--inputhttp://192.168.1.140:9200/source_index \--outputhttp://192.168.1.141:9200/target_index \--typemapping迁移数据 elasticdump \--inputhttp://192.168.1.140:9200/source_index \--outputhttp://192.168.1.141:9200/target_index \--typedata \--limit2000 # 每次操作的objects数量默认100数据量大的话可以调大加快迁移速度这个命令会将源 Elasticsearch 实例中的 “my_index” 索引的所有数据导出并保存到 “/path/to/output.json” 的 JSON 文件中。 --input指定输入的 Elasticsearch 实例和索引。可以是一个 URL也可以是本地 Elasticsearch 实例的路径。--output指定输出的文件路径数据将保存为一个 JSON 文件。--type指定要导出的数据类型通常为 “data” 表示文档数据。 你还可以使用其他选项来进一步控制导出过程如 --query, --size, --limit, --filter 等具体取决于你的需求。可以通过运行 elasticdump --help 命令来 数据备份 导出索引和数据 elasticdump \--inputhttp://192.168.1.140:9200/source_index \--output/data/source_index_mapping.json \--typemapping elasticdump \--inputhttp://192.168.1.140:9200/source_index \--output/data/source_index.json \--typedata \--limit2000导入索引和数据 elasticdump \--input/data/source_index_mapping.json \--outputhttp://192.168.1.141:9200/source_index \--typemapping elasticdump \--input/data/source_index.json \--outputhttp://192.168.1.141:9200/source_index \--typedata \--limit2000 其他用法 还有其他使用的细节例如压缩指定query 什么的我们可以参考下面的例子 # 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\}}}# Specify searchBody from a file elasticdump \--inputhttp://production.es.com:9200/my_index \--outputquery.json \--searchBody/data/searchbody.json # Copy a single shard data: elasticdump \--inputhttp://es.com:9200/api \--outputhttp://es.com:9200/api2 \--input-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# Import data from MINIO (s3 compatible) 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--s3ForcePathStyle true--s3Endpoint https://production.minio.co# Export ES data to MINIO (s3 compatible) (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--s3ForcePathStyle true--s3Endpoint https://production.minio.co# Import data from CSV file into ES (using csvurls) elasticdump \# csv:// prefix must be included to allow parsing of csv files# --input csv://${file_path}.csv \--input csv:///data/cars.csv--outputhttp://production.es.com:9200/my_index \--csvSkipRows 1 # used to skip parsed rows (this does not include the headers row)--csvDelimiter ; # default csvDelimiter is , 常用参数 --direction dump/load 导出/导入 --ignoreType 被忽略的类型data,mapping,analyzer,alias,settings,template --includeType 包含的类型data,mapping,analyzer,alias,settings,template --suffix 加前缀es6-${index} --prefix 加后缀${index}-backup-2018-03-13总结 elasticdump是ElasticSearch提供的一个工具我们主要可以用来完成 数据备份数据迁移 这一节我们主要介绍了elasticdump的安装和使用还有就是Elasticdump 是一个第三方工具不是官方的 Elasticsearch 产品。虽然它对某些用例很有帮助但在使用之前确保与你的 Elasticsearch 版本兼容并查阅工具的文档以了解任何特定的注意事项或限制。 总体来说,elasticdump是一个非常实用的数据迁移和备份工具。它可以帮助我们轻松地在不同Elasticsearch集群之间进行数据迁移,实现集群之间的无缝数据同步。
http://www.yutouwan.com/news/28536/

相关文章:

  • 西安做网站云速网络什么网站做h5
  • 制作微信公众号的网站开发网页在线短网址生成器
  • 网站热区图专业的手机网站建设公司哪家好
  • 网站建设可信赖东莞网络推广教程
  • 衡阳市网站建设公司移动端h5网站开发服务
  • 建设网站能赚钱品牌营销公司
  • 东营网站建设推广外接硬盘做创建立网站
  • 我想在阿里巴巴网站开店 怎么做旅游网络营销如何做
  • 网站建设与维护怎么学网站建设的风险预测
  • 金融网站策划方案烟台html5网站建设
  • 自己的网站怎么做进销存dw网站建设框架大小设定
  • 网站如何做伪静态发稿什么意思
  • 有哪些tp5做的网站用老域名做新网站
  • 山西省住房和城乡建设厅官方网站请多记几个本站域名防止失联
  • 免费的黄冈网站有哪些平台?济南建设局官网
  • 花都建设网站网络营销工具中最基本最重要的是
  • dede个人网站h5网站开发培训机构
  • 阿里云服务器安装网站深圳推广公司哪家好
  • 怎么选择徐州网站开发杭州网站设计步骤
  • 网站建设网站徒手整形培训网站的总体方案与功能设计
  • 网站建设实施方式桐城网站开发
  • php做的网站处理速度怎么样网站建设设置分享功能
  • 网站建设-纵横网络免费推广网站工具
  • 上海网站怎么备案表办公室设计方案
  • 王建设个人网站网络营销的目的和意义
  • 做高仿鞋子在什么网站卖好前十强排名家装公司
  • 站长工具如何使用wordpress 站内搜索代码
  • 东北建站网络服务中心
  • 拓者室内设计网站服务器可以吧网站做跳转吗
  • 广州黄埔建网站网页版梦幻西游是网易的吗