• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

将-ES-的快照备份到-Windows-共享目录qbit

linux 搞代码 3年前 (2022-03-03) 13次浏览 已收录 0个评论
文章目录[隐藏]

前言

  • 环境
Elasticsearch 7.10.1
ES 所在服务器操作系统为 Ubuntu 20.04
Windows 服务器版本为 Windows Server 2019
  • 已将 Windows//172.31.19.143/es_snapshot 共享目录挂载到 ES 服务器的 /mnt/winshare 目录
  • Linux 挂载 Windows 共享目录参见: Ubuntu 20.04 读写 Windows 10 共享目录

批改 ES 服务配置

  • elasticsearch.yml 文件中增加如下配置,并重启 ES 服务
<code class="yaml">path.repo:
  - /mnt/winshare

注册快照仓库

PUT /_snapshot/my_backup
{
  "type": "fs",
  "settings": {
    "location": "/mnt/winshare/es_snapshot",
    "max_snapshot_bytes_per_sec": "100mb",   # 调整快照创立的速度,默认 40mb
    "max_restore_bytes_per_sec": "200mb",    # 调整快照复原的速度,默认无限度
  }
}
  • 查看所有注册的快照仓库
GET _snapshot/_all
  • 调整机器复原分片速度和并发数
PUT _cluster/settings
{
  "transient": {
    "indices.recovery.max_bytes_per_sec": "200mb",  # 默认 40mb
    "cluster.routing.allocation.node_concurrent_recoveries": "5"    # 默认 2
  }
}
  • 查看集群配置(包含默认配置)
GET _cluster/settings?flat_settings&include_defaults

创立快照

PUT /_snapshot/my_backup/snapshot_zt
{
  "indices": "zt_product_doc_index_20210223_3"
}
  • 查看一个my_backup仓库下的所有快照
GET _snapshot/my_backup/_all
  • 查看 snapshot_zt 快照的概要状态
GET _snapshot/my_backup/snapshot_zt
  • 查看 snapshot_zt 快照的具体状态
GET _snapshot/my_backup/snapshot_zt/_status

复原快照

POST /_snapshot/my_backup/snapshot_zt/_restore
{
  "indices": "zt_product_doc_index_20210223_3",
  "index_settings": {
    "index.number_of_replicas": 0
  },
  "rename_pattern": "zt_product_doc_index_20210223_3",
  "rename_replacement": "zt_product_doc_index_20210223_3_restore"
}

本文出自 qbit snap


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:将-ES-的快照备份到-Windows-共享目录qbit
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址