网站开发 发表文章/国际站seo优化是什么意思

网站开发 发表文章,国际站seo优化是什么意思,网页设计与制作教程 第2版 张兵义,需求网站建设Easysearch 可以使用 AWS S3 作为远程存储库,进行索引的快照(Snapshot)备份和恢复。同时,Easysearch 内置了 S3 插件,无需额外安装。以下是完整的配置和操作步骤。 1. 在 AWS S3 上创建存储桶 登录 AWS 控制台&#x…

Easysearch 可以使用 AWS S3 作为远程存储库,进行索引的快照(Snapshot)备份和恢复。同时,Easysearch 内置了 S3 插件,无需额外安装。以下是完整的配置和操作步骤。


1. 在 AWS S3 上创建存储桶

  1. 登录 AWS 控制台,进入 S3 服务。
  2. 创建一个新存储桶(例如 easysearch-backups)。
  3. 启用版本控制(可选,但推荐)。
  4. 权限配置:确保 IAM 角色具有访问 S3 的权限。
{
"Version": "2012-10-17",
"Statement": [{"Action": ["s3:ListBucket"],"Effect": "Allow","Resource": ["arn:aws:s3:::s3-bucket-name"]},{"Action": ["s3:GetObject","s3:PutObject","s3:DeleteObject"],"Effect": "Allow","Resource": ["arn:aws:s3:::s3-bucket-name/*"]}
]
}

2. 在 Console 上注册 S3 作为快照存储库

使用 Console DevTools 或 API

在 Easysearch 的 DevTools 执行:

PUT _snapshot/my_s3_repository
{"type": "s3","settings": {"bucket": "easysearch-backups","base_path": ""}
}

注意

  • bucket 需要填写你的 S3 存储桶名称。
  • region 需要替换成你的 AWS S3 所在区域,SDK 默认美东区。
  • 如果 Bucket 在中国区,还需添加 endpoint: https://s3.<region>.amazonaws.com.cn 参数。

3. 创建快照

一旦 my_s3_repository 注册完成,就可以创建快照:

PUT _snapshot/my_s3_repository/my_snapshot_001
{"indices": "my_index","include_global_state": false
}

查看当前存储的快照:

GET _snapshot/my_s3_repository/_all

image-20250309161102887

4. 从 AWS S3 还原快照

当你需要恢复索引时:

POST _snapshot/my_s3_repository/my_snapshot_001/_restore
{"indices": "my_index","rename_pattern": "my_index","rename_replacement": "restored_my_index"
}

说明:这会从 my_snapshot_001 还原 my_index,但以 restored_my_index 命名,避免与现有索引冲突。

如果要直接覆盖原索引(确保 my_index 为空或已删除):

POST _snapshot/my_s3_repository/my_snapshot_001/_restore
{"indices": "my_index","ignore_unavailable": true,"include_global_state": false
}

5. 可能的错误与解决方案

错误信息可能原因解决方案
repository_s3 plugin not installed没有安装 repository-s3 插件运行 bin/elasticsearch-plugin install repository-s3 并重启
NoSuchBucketS3 存储桶不存在确保 S3 存储桶名称正确
AccessDenied权限不足确保 S3 存储桶策略正确,检查 IAM 角色
index_closed_exception目标索引已关闭POST my_index/_open 再恢复
index_already_exists_exception目标索引已存在DELETE my_index 再恢复

6. 快照恢复常见错误排查

报错 1:无法连接到 S3


{"error": {"root_cause": [{"type": "repository_verification_exception","reason": "[my_s3_repository] path [/] is not accessible on master node"}],"type": "repository_verification_exception","reason": "[my_s3_repository] path [/] is not accessible on master node","caused_by": {"type": "i_o_exception","reason": "Unable to upload object [//tests-sXkmh3q5ThCCIX2VJp609g/master.dat] using a single upload","caused_by": {"type": "sdk_client_exception","reason": "Failed to connect to service endpoint: ","caused_by": {"type": "socket_timeout_exception","reason": "Connect timed out"}}}},"status": 500
}
解决方案
  1. 在 keystore 中添加 AWS 凭证:
    sudo ./bin/easysearch-keystore add s3.client.default.access_key
    sudo ./bin/easysearch-keystore add s3.client.default.secret_key
    
  2. 如果运行在 EC2 上,确保实例挂载了 IAM Role。
{"error": {"root_cause": [{"type": "repository_verification_exception","reason": "[my_s3_repositor1] path  is not accessible on master node"}],"type": "repository_verification_exception","reason": "[my_s3_repositor1] path  is not accessible on master node","caused_by": {"type": "i_o_exception","reason": "Unable to upload object [tests-sUUzs-mTSZeYw1qk372DkQ/master.dat] using a single upload","caused_by": {"type": "sdk_client_exception","reason": "The requested metadata is not found at http://169.254.169.254/latest/meta-data/iam/security-credentials/"}}},"status": 500
}

报错 2:索引已存在,无法恢复

{"error": {"root_cause": [{"type": "snapshot_restore_exception","reason": "[my_s3_repository:1/9gIDCgSySwKzQqEYvaGM_w] cannot restore index [my_index] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name"}],"type": "snapshot_restore_exception","reason": "[my_s3_repository:1/9gIDCgSySwKzQqEYvaGM_w] cannot restore index [my_index] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name"},"status": 500
}
解决方案
  1. 删除现有索引后恢复
    DELETE /my_index
    
  2. 关闭索引后恢复
    POST /my_index/_close
    
  3. 恢复为新的索引名称
    POST _snapshot/my_s3_repository/1/_restore
    {"indices": "my_index","rename_pattern": "my_index","rename_replacement": "restored_my_index"
    }
    

报错 3:权限错误

{"error": {"root_cause": [{"type": "security_exception","reason": "no permissions for [] and User [name=admin, external_roles=[admin]]"}],"type": "security_exception","reason": "no permissions for [] and User [name=admin, external_roles=[admin]]"},"status": 403
}
解决方案
  1. 确保用户有 manage_snapshots 角色权限
  2. 排除 .security 索引或全局状态,否则无法恢复。

在这里插入图片描述

POST _snapshot/my_s3_repositor1/snapshot_002/_restore
{"indices": "-.security","ignore_unavailable": true,"include_global_state": false
}

📌 存储库(Repository)管理 API

存储库用于存储快照,Elasticsearch 支持 AWS S3、GCS、本地等存储。

1️⃣ 查看所有已注册的存储库

GET _snapshot/_all

示例返回

{"my_s3_repository": {"type": "s3","settings": {"bucket": "es-snapshots-bucket","region": "us-east-1"}}
}

2️⃣ 查看特定存储库信息

GET _snapshot/my_s3_repository

3️⃣ 创建存储库(AWS S3 示例)

PUT _snapshot/my_s3_repository
{"type": "s3","settings": {"bucket": "es-snapshots-bucket",}
}

4️⃣ 删除存储库

DELETE _snapshot/my_s3_repository

⚠ 删除存储库不会删除快照,需要手动删除快照!


📌 快照(Snapshot)管理 API

快照用于备份和恢复索引数据。

1️⃣ 创建快照

备份特定索引

PUT _snapshot/my_s3_repository/snapshot_001
{"indices": "my_index","include_global_state": false
}

备份所有索引

PUT _snapshot/my_s3_repository/snapshot_002
{"include_global_state": true
}

2️⃣ 查看所有快照

GET _snapshot/my_s3_repository/_all

3️⃣ 查看特定快照信息

GET _snapshot/my_s3_repository/snapshot_001

4️⃣ 删除快照

DELETE _snapshot/my_s3_repository/snapshot_001

📌 快照恢复(Restore)API

恢复已备份的索引。

1️⃣ 还原单个索引

POST _snapshot/my_s3_repository/snapshot_001/_restore
{"indices": "my_index","ignore_unavailable": true,"include_global_state": false
}

2️⃣ 还原索引并重命名

POST _snapshot/my_s3_repository/snapshot_001/_restore
{"indices": "my_index","rename_pattern": "my_index","rename_replacement": "restored_my_index"
}

3️⃣ 还原所有索引

POST _snapshot/my_s3_repository/snapshot_002/_restore

📌 快照状态 API

查询快照的执行状态。

1️⃣ 查看当前快照任务

GET _snapshot/_status

2️⃣ 查看特定快照状态

GET _snapshot/my_s3_repository/snapshot_001/_status

API用途
GET _snapshot/_all查看所有存储库
GET _snapshot/my_s3_repository查看特定存储库
PUT _snapshot/my_s3_repository创建存储库
DELETE _snapshot/my_s3_repository删除存储库
PUT _snapshot/my_s3_repository/snapshot_001创建快照
GET _snapshot/my_s3_repository/_all查看所有快照
GET _snapshot/my_s3_repository/snapshot_001查看快照详情
DELETE _snapshot/my_s3_repository/snapshot_001删除快照
POST _snapshot/my_s3_repository/snapshot_001/_restore还原快照
GET _snapshot/_status查看快照状态

🚀 通过本文,你可以高效地使用 AWS S3 进行 Easysearch 快照备份和恢复,并排查可能的错误,确保集群数据安全无忧!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/897655.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

探索高性能AI识别和边缘计算 | NVIDIA Jetson Orin Nano 8GB 开发套件的全面测评

随着边缘计算和人工智能技术的迅速发展&#xff0c;性能强大的嵌入式AI开发板成为开发者和企业关注的焦点。NVIDIA近期推出的Jetson Orin Nano 8GB开发套件&#xff0c;凭借其40 TOPS算力、高效的Ampere架构GPU以及出色的边缘AI能力&#xff0c;引起了广泛关注。本文将从配置性…

开源免费日志服务ELK Syack代替syslog

一、ELK Stack 采集 syslog 日志的主要方式 通常&#xff0c;ELK Stack 使用 Logstash 或者 Filebeat 来采集 syslog 日志。 Beats 通常更轻量级&#xff0c;适合作为代理部署在各个日志源服务器上&#xff0c;而 Logstash 则功能更强大&#xff0c;可以进行更复杂的日志处理和…

C#+AForge 实现视频录制

C#AForge 实现视频录制 ​ 在C#中&#xff0c;使用AForge 库实现视频录制功能是一个比较直接的过程。AForge 是一个开源的.NET框架&#xff0c;提供了许多用于处理图像和视频的类库。 开发步骤 安装AForge库 ​ 首先&#xff0c;确保你的项目中已经安装了 AForge.Video和AFo…

PHP框架加载不上.env文件中的变量

以lumen5.5框架为例&#xff0c;根目录中bootstrap文件夹下的app.php文件中 (new Dotenv\Dotenv(__DIR__./../))->load(); 是读取所有.env中的文件的&#xff0c;这个是正常的&#xff0c;但是在代码中的任何位置或者在config目录下的databases.php里&#xff0c;代码如…

21.Linux 线程库的使用与封装

在linux内核中并没有线程的概念&#xff0c;只有轻量级进程LWP的概念&#xff0c;linux下的线程都是是由LWP进行模拟实现的。因此linux操作系统中不会提供线程的相关接口&#xff0c;只会提供轻量级线程的接口&#xff08;如vfork&#xff0c;clone等&#xff09;。但是在我们的…

Aliyun CTF 2025 web 复现

文章目录 ezoj打卡OKoffens1veFakejump server ezoj 进来一看是算法题&#xff0c;先做了试试看,gpt写了一个高效代码通过了 通过后没看见啥&#xff0c;根据页面底部提示去/source看到源代码&#xff0c;没啥思路&#xff0c;直接看wp吧&#xff0c;跟算法题没啥关系,关键是去…

Git使用(一)--如何在 Windows 上安装 Git:详细步骤指南

如果你想在 Windows 机器上安装 Git&#xff0c;可以按照以下详细指南进行操作。 第一步&#xff1a;下载 Git 可通过官网下载 适用于 Windows 的 Git 最新版本。 如果下载速度较慢&#xff0c;可以通过下面提供的百度网盘 链接下载安装包&#xff0c; https://git-scm.com/d…

本地Git仓库搭建(DevStar)与Git基本命令

本地Git仓库搭建&#xff08;DevStar&#xff09;与Git基本命令 实验环境搭建平台Git基本命令的使用本地仓库的创建代码提交代码合并版本发布 总结 实验环境 搭建平台 按照DevStar的Github仓库要求&#xff0c;在终端中执行下列命令&#xff0c;即可成功安装DevStar到本地部署…

stm32 蓝桥杯 物联网 独立键盘的使用

在蓝桥杯物联网平台里面&#xff0c;有5个外接设备&#xff0c;其中有一个就是6个独立按键。首先&#xff0c;我们先看一下按键有关的电路图。 电路图与cubemx设定 由图可见&#xff0c;独立键盘组由两行三列构成&#xff0c;我们通过行列来锁定要访问的独立按键在哪。ROW1挂…

工作记录 2017-01-06

工作记录 2017-01-06 序号 工作 相关人员 1 协助BPO进行Billing的工作。 修改CSV、EDI837的导入。 修改邮件上的问题。 更新RD服务器。 郝 修改的问题&#xff1a; 1、 In “Full Job Summary” (patient info.), sometime, the Visit->Facility is missed, then …

Python Selenium库入门使用,图文详细。附网页爬虫、web自动化操作等实战操作。

文章目录 前言1 创建conda环境安装Selenium库2 浏览器驱动下载&#xff08;以Chrome和Edge为例&#xff09;3 基础使用&#xff08;以Chrome为例演示&#xff09;3.1 与浏览器相关的操作3.1.1 打开/关闭浏览器3.1.2 访问指定域名的网页3.1.3 控制浏览器的窗口大小3.1.4 前进/后…

SpringMVC 基本概念与代码示例

1. SpringMVC 简介 SpringMVC 是 Spring 框架中的一个 Web 层框架&#xff0c;基于 MVC&#xff08;Model-View-Controller&#xff09; 设计模式&#xff0c;提供了清晰的分层结构&#xff0c;适用于 Web 应用开发 SpringMVC 主要组件 DispatcherServlet&#xff08;前端控…

DeepSeek结合Mermaid绘图(流程图、时序图、类图、状态图、甘特图、饼图)转载

思维速览&#xff1a; 本文将详细介绍如何利用DeepSeek结合Mermaid语法绘制各类专业图表&#xff0c;帮助你提高工作效率和文档质量。 ▍DeepSeek入门使用请看&#xff1a;deepseek保姆级入门教程&#xff08;网页端使用 本地客户端部署 使用技巧&#xff09; DeepSeek官网…

上下分层、左右分离的驱动设计思想

之前了解了最简单的驱动程序、但是不易扩展、现在继续学习、上下分层、左右分离的驱动设计思想。 1、led_dev.c函数 上层函数&#xff0c;①定义一个结构体&#xff0c;存储函数用来接应app的函数。②定义一个入口函数&#xff0c;将我们接应的函数告诉内核&#xff0c;给这个…

《历史代码分析》5、动态控制列表的列

​​ 本系列《历史代码分析》为工作中遇到具有代表性的代码。今天我们讲一下&#xff0c;动态展示列表的列&#xff0c;因为找不到代码了&#xff0c;所有本篇用图展示。 举个栗子 ​​ 我们希望能够动态的控制列表的列&#xff0c;例如&#xff0c;英语老师只想知道自己学…

Windows HD Video Converter Factory PRO-v27.9.0-

Windows HD Video Converter Factory PRO 链接&#xff1a;https://pan.xunlei.com/s/VOL9TaiuS7rXbu-1kEDndoceA1?pwd7qch# 支持300多种视频格式转换&#xff0c;在保留视频质量的同时&#xff0c;压缩率可达80%&#xff0c;转换速度可达50X速率&#xff01; 支持画面剪切、片…

##Hive安装-初始化元数据报错 *** schemaTool failed ***

报错&#xff1a; org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version. Underlying cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException : Communications link failure 解决方案&#xff1a; 尝试一&#xff1a;javax.jdo.o…

远程手机遥控开关原理及应用

远程手机遥控开关的工作原理主要是通过互联网传递无线信号&#xff0c;控制用电器的一种智能家居产品。 远程手机遥控开关的基本套件包括&#xff1a;手机APP、网线、家用WIFI中转无服务器或者是工厂提供的自带网线端口的中转服务器、连接用电器的接收器。使用时&#xff0c;手…

Mac java全栈开发环境配置

前言 由于最近手中的windows本子坏了,所以搞了一台m系列的macbookpro 作为一个开发者 面对新设备最先考虑的应该就是各种sdk、中间件服务、环境变量配置和工具了吧!!! 本文将带你手把手学习Mac搭建属于自己的本地开发环境 安装brew 什么是brew? ‌Brew(全称Homebrew)…

HTMLCSS绘制三角形

1.代码&#xff1a; <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>01triangle</title><s…