完成简体中文翻译 #5
@@ -1,44 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: 重大变更
|
||||
nav_order: 5
|
||||
permalink: /breaking-changes/
|
||||
---
|
||||
|
||||
## 1.x
|
||||
|
||||
### 迁移到 OpenSearch 以及嵌套 JSON 对象数量限制
|
||||
|
||||
从 Elasticsearch OSS 6.8 版本迁移到 OpenSearch 1.x 版本时,如果集群中包含任何文档,且该文档在所有字段中的嵌套 JSON 对象超过 10,000 个,迁移将失败。Elasticsearch 7.0 版本引入了 `index.mapping.nested_objects.limit` 设置以防止内存溢出错误,并将默认值设为 `10000`。OpenSearch 从诞生之初就采用了此设置,并强制执行嵌套 JSON 对象的限制。但是,由于此设置在 Elasticsearch 6.8 中不存在且不被该版本识别,当任何文档中的嵌套 JSON 对象数量超过默认限制时,迁移到 OpenSearch 1.x 可能导致兼容性问题,阻止 Elasticsearch 6.8 和 OpenSearch 1.x 版本之间的分片重新分配。
|
||||
|
||||
因此,我们建议在尝试从 Elasticsearch 6.8 迁移之前评估你的数据是否符合这些限制。
|
||||
|
||||
|
||||
## 2.0.0
|
||||
|
||||
### 移除映射类型参数
|
||||
|
||||
`type` 参数已从所有 OpenSearch API 端点中移除。取而代之的是,索引可以按文档类型进行分类。更多详情请参见问题 [#1940](https://github.com/opensearch-project/opensearch/issues/1940)。
|
||||
|
||||
### 弃用非包容性术语
|
||||
|
||||
非包容性术语在 2.x 版本中已弃用,将在 OpenSearch 3.0 中永久移除。我们使用以下替代术语:
|
||||
|
||||
- "Whitelist"(白名单)现为 "Allow list"(允许列表)
|
||||
- "Blacklist"(黑名单)现为 "Deny list"(拒绝列表)
|
||||
- "Master"(主节点)现为 "Cluster Manager"(集群管理器)
|
||||
|
||||
### 添加 OpenSearch 通知插件
|
||||
|
||||
在 OpenSearch 2.0 中,告警插件现已与新的通知插件集成。如果你想继续使用告警插件中的通知操作,请安装新的后端插件 `notifications-core` 和 `notifications`。如果你想在 OpenSearch Dashboards 中管理通知,请使用新的 `notificationsDashboards` 插件。更多信息请参见 OpenSearch 文档页面上的[通知]({{site.url}}{{site.baseurl}}/observing-your-data/notifications/index/)。
|
||||
|
||||
### 停止支持 JDK 8
|
||||
|
||||
Lucene 升级迫使 OpenSearch 停止支持 JDK 8。因此,[Java 高级 REST 客户端]({{site.url}}{{site.baseurl}}/clients/java-rest-high-level/)不再支持 JDK 8。恢复 JDK 8 支持目前是 `opensearch-java` 提案 [#156](https://github.com/opensearch-project/opensearch-java/issues/156),需要从 Java 客户端中移除 OpenSearch 核心作为依赖项(问题 [#262](https://github.com/opensearch-project/opensearch-java/issues/262))。
|
||||
|
||||
|
||||
## 2.5.0
|
||||
|
||||
### 文本字段通配符查询行为
|
||||
|
||||
OpenSearch 2.5 包含一个错误修复,以纠正文本字段上 `wildcard` 查询的 `case_insensitive` 参数行为。因此,在错误修复之前忽略大小写敏感性并错误返回结果的文本字段通配符查询将不会返回相同的结果。更多信息请参见问题 [#8711](https://github.com/opensearch-project/OpenSearch/issues/8711)。
|
||||
@@ -1,112 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: OpenSearch 简介
|
||||
nav_order: 2
|
||||
permalink: /intro/
|
||||
---
|
||||
|
||||
# OpenSearch 简介
|
||||
|
||||
OpenSearch 是一个基于 [Apache Lucene](https://lucene.apache.org/) 的分布式搜索和分析引擎。将数据添加到 OpenSearch 后,你可以对其执行全文搜索,并使用你可能期望的所有功能:按字段搜索、搜索多个索引、提升字段权重、按分数对结果排名、按字段对结果排序以及聚合结果。
|
||||
|
||||
毫不意外,人们经常使用像 OpenSearch 这样的搜索引擎作为搜索应用程序的后端——想想 [Wikipedia](https://en.wikipedia.org/wiki/Wikipedia:FAQ/Technical#What_software_is_used_to_run_Wikipedia?) 或在线商店。它提供出色的性能,可以随着应用程序需求的增长或缩减而扩展或收缩。
|
||||
|
||||
一个同样流行但不太明显的用例是日志分析,你可以获取应用程序的日志,将它们导入 OpenSearch,并使用丰富的搜索和可视化功能来识别问题。例如,一个故障的 Web 服务器可能在 0.5% 的时间内抛出 500 错误,除非你有一个实时图表显示服务器在过去四小时内抛出的所有 HTTP 状态代码,否则很难注意到这一点。你可以使用 [OpenSearch Dashboards]({{site.url}}{{site.baseurl}}/dashboards/index/) 从 OpenSearch 中的数据构建这类可视化。
|
||||
|
||||
|
||||
## 集群和节点
|
||||
|
||||
其分布式设计意味着你与 OpenSearch *集群*进行交互。每个集群是一个或多个*节点*的集合,节点是存储数据和处理搜索请求的服务器。
|
||||
|
||||
你可以在笔记本电脑上本地运行 OpenSearch——它的系统要求很低——但你也可以将单个集群扩展到数据中心中数百台强大的机器。
|
||||
|
||||
在单节点集群中,例如笔记本电脑,一台机器必须完成所有工作:管理集群状态、索引和搜索数据,以及在索引之前对数据进行任何预处理。然而,随着集群的增长,你可以细分职责。具有快速磁盘和大量 RAM 的节点可能非常适合索引和搜索数据,而具有大量 CPU 能力和小磁盘的节点可以管理集群状态。有关设置节点类型的更多信息,请参见[集群组建]({{site.url}}{{site.baseurl}}/opensearch/cluster/)。
|
||||
|
||||
|
||||
## 索引和文档
|
||||
|
||||
OpenSearch 将数据组织成*索引*。每个索引是 JSON *文档*的集合。如果你有一组原始百科全书文章或日志行想要添加到 OpenSearch,你必须首先将它们转换为 [JSON](https://www.json.org/)。一个简单的电影 JSON 文档可能如下所示:
|
||||
|
||||
```json
|
||||
{
|
||||
"title": "The Wind Rises",
|
||||
"release_date": "2013-07-20"
|
||||
}
|
||||
```
|
||||
|
||||
当你将文档添加到索引时,OpenSearch 会添加一些元数据,例如唯一的文档 *ID*:
|
||||
|
||||
```json
|
||||
{
|
||||
"_index": "<index-name>",
|
||||
"_type": "_doc",
|
||||
"_id": "<document-id>",
|
||||
"_version": 1,
|
||||
"_source": {
|
||||
"title": "The Wind Rises",
|
||||
"release_date": "2013-07-20"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
索引还包含映射和设置:
|
||||
|
||||
- *映射*是索引中文档拥有的*字段*集合。在本例中,这些字段是 `title` 和 `release_date`。
|
||||
- 设置包括索引名称、创建日期和分片数量等数据。
|
||||
|
||||
## 主分片和副本分片
|
||||
|
||||
OpenSearch 将索引拆分为*分片*,以便在集群中的节点之间均匀分布。例如,400 GB 的索引可能对于集群中的任何单个节点来说太大而无法处理,但拆分为十个分片,每个 40 GB,OpenSearch 可以将分片分布在十个节点上,并单独处理每个分片。
|
||||
|
||||
默认情况下,OpenSearch 为每个*主分片*创建一个*副本*分片。例如,如果你将索引拆分为十个分片,OpenSearch 也会创建十个副本分片。这些副本分片在节点故障时充当备份——OpenSearch 将副本分片分布到与其对应主分片不同的节点上——但它们也提高了集群处理搜索请求的速度和频率。你可以为搜索密集型工作负载的索引指定多个副本。
|
||||
|
||||
尽管是 OpenSearch 索引的一部分,每个分片实际上是一个完整的 Lucene 索引——我们知道这很令人困惑。但这个细节很重要,因为每个 Lucene 实例都是一个消耗 CPU 和内存的运行进程。分片越多不一定越好。例如,将 400 GB 的索引拆分为 1,000 个分片会给你的集群带来不必要的压力。一个好的经验法则是将分片大小保持在 10-50 GB 之间。
|
||||
|
||||
|
||||
## REST API
|
||||
|
||||
你使用 REST API 与 OpenSearch 集群进行交互,这提供了很大的灵活性。你可以使用像 [curl](https://curl.se/) 这样的客户端或任何可以发送 HTTP 请求的编程语言。要将 JSON 文档添加到 OpenSearch 索引(即索引文档),你发送一个 HTTP 请求:
|
||||
|
||||
```json
|
||||
PUT https://<host>:<port>/<index-name>/_doc/<document-id>
|
||||
{
|
||||
"title": "The Wind Rises",
|
||||
"release_date": "2013-07-20"
|
||||
}
|
||||
```
|
||||
|
||||
要运行搜索以查找文档:
|
||||
|
||||
```json
|
||||
GET https://<host>:<port>/<index-name>/_search?q=wind
|
||||
```
|
||||
|
||||
要删除文档:
|
||||
|
||||
```json
|
||||
DELETE https://<host>:<port>/<index-name>/_doc/<document-id>
|
||||
```
|
||||
|
||||
你可以使用 REST API 更改大多数 OpenSearch 设置、修改索引、检查集群的健康状况、获取统计信息——几乎所有操作。
|
||||
|
||||
## 高级概念
|
||||
|
||||
以下部分描述了更高级的 OpenSearch 概念。
|
||||
|
||||
### 事务日志
|
||||
|
||||
任何索引更改,例如文档索引或删除,都会在 Lucene 提交期间写入磁盘。但是,Lucene 提交是昂贵的操作,因此不能在每次索引更改后执行。相反,每个分片将每个索引操作记录在称为 _translog_ 的事务日志中。当文档被索引时,它会被添加到内存缓冲区并记录在 translog 中。在进程或主机重启后,内存缓冲区中的任何数据都会丢失。将文档记录在 translog 中确保了持久性,因为 translog 被写入磁盘。
|
||||
|
||||
频繁的刷新操作将内存缓冲区中的文档写入段,然后清除内存缓冲区。定期,[刷写](#刷写)执行 Lucene 提交,包括使用 `fsync` 将段写入磁盘、清除旧的 translog 并启动新的 translog。因此,translog 包含所有尚未刷写的操作。
|
||||
|
||||
### 刷新
|
||||
|
||||
OpenSearch 定期执行 _刷新_ 操作,将文档从内存中的 Lucene 索引写入文件。这些文件不保证是持久的,因为不执行 `fsync`。刷新使文档可供搜索。
|
||||
|
||||
### 刷写
|
||||
|
||||
_刷写_ 操作使用 `fsync` 将文件持久化到磁盘,确保持久性。刷写确保只存储在 translog 中的数据被记录在 Lucene 索引中。OpenSearch 根据需要执行刷写以确保 translog 不会变得太大。
|
||||
|
||||
### 合并
|
||||
|
||||
在 OpenSearch 中,分片是一个 Lucene 索引,由 _段_(或段文件)组成。段存储索引数据且是不可变的。定期,较小的段会合并成较大的段。合并减少每个分片上的总段数,释放磁盘空间,并提高搜索性能。最终,段达到合并策略中指定的最大大小,不再合并成更大的段。合并策略还指定合并执行的频率。
|
||||
@@ -1,165 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: 快速入门
|
||||
nav_order: 3
|
||||
permalink: /quickstart/
|
||||
redirect_from:
|
||||
- /opensearch/install/quickstart/
|
||||
---
|
||||
|
||||
# 快速入门
|
||||
|
||||
通过使用 [Docker](https://www.docker.com/) 部署容器来开始使用 OpenSearch 和 OpenSearch Dashboards。在继续之前,你需要在本地机器上[安装 Docker](https://docs.docker.com/get-docker/) 和 [Docker Compose](https://github.com/docker/compose)。
|
||||
|
||||
本指南中使用的 Docker Compose 命令带有连字符(例如 `docker-compose`)。如果你在机器上安装了 Docker Desktop,它会自动安装捆绑版本的 Docker Compose,那么你应该去掉连字符。例如,将 `docker-compose` 更改为 `docker compose`。
|
||||
{: .note}
|
||||
|
||||
## 启动集群
|
||||
|
||||
你需要一个特殊的文件,称为 Compose 文件,Docker Compose 使用它来定义和创建集群中的容器。OpenSearch 项目提供了一个示例 Compose 文件,你可以用它来入门。通过查看官方 [Compose 规范](https://docs.docker.com/compose/compose-file/)了解更多关于使用 Compose 文件的信息。
|
||||
|
||||
1. 在机器上运行 OpenSearch 之前,你应该禁用主机上的内存分页和交换性能以提高性能,并增加 OpenSearch 可用的内存映射数量。有关更多信息,请参见[重要系统设置]({{site.url}}{{site.baseurl}}/opensearch/install/important-settings/)。
|
||||
```bash
|
||||
# 禁用内存分页和交换。
|
||||
sudo swapoff -a
|
||||
|
||||
# 编辑定义主机最大映射计数的 sysctl 配置文件。
|
||||
sudo vi /etc/sysctl.conf
|
||||
|
||||
# 将最大映射计数设置为推荐值 262144。
|
||||
vm.max_map_count=262144
|
||||
|
||||
# 重新加载内核参数。
|
||||
sudo sysctl -p
|
||||
```
|
||||
1. 将示例 Compose 文件下载到你的主机。你可以使用 `curl` 和 `wget` 等命令行工具下载文件,也可以使用 Web 浏览器手动从 OpenSearch 项目 documentation-website 仓库复制 [docker-compose.yml](https://github.com/opensearch-project/documentation-website/blob/{{site.opensearch_major_minor_version}}/assets/examples/docker-compose.yml)。
|
||||
```bash
|
||||
# 使用 cURL:
|
||||
curl -O https://raw.githubusercontent.com/opensearch-project/documentation-website/{{site.opensearch_major_minor_version}}/assets/examples/docker-compose.yml
|
||||
|
||||
# 使用 wget:
|
||||
wget https://raw.githubusercontent.com/opensearch-project/documentation-website/{{site.opensearch_major_minor_version}}/assets/examples/docker-compose.yml
|
||||
```
|
||||
1. 在终端应用程序中,导航到包含刚下载的 `docker-compose.yml` 文件的目录,然后运行以下命令以作为后台进程创建和启动集群。
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
1. 使用 `docker-compose ps` 命令确认容器正在运行。你应该看到类似以下的输出:
|
||||
```bash
|
||||
$ docker-compose ps
|
||||
NAME COMMAND SERVICE STATUS PORTS
|
||||
opensearch-dashboards "./opensearch-dashbo…" opensearch-dashboards running 0.0.0.0:5601->5601/tcp
|
||||
opensearch-node1 "./opensearch-docker…" opensearch-node1 running 0.0.0.0:9200->9200/tcp, 9300/tcp, 0.0.0.0:9600->9600/tcp, 9650/tcp
|
||||
opensearch-node2 "./opensearch-docker…" opensearch-node2 running 9200/tcp, 9300/tcp, 9600/tcp, 9650/tcp
|
||||
```
|
||||
1. 查询 OpenSearch REST API 以验证服务正在运行。你应该使用 `-k`(也写作 `--insecure`)来禁用主机名检查,因为默认安全配置使用演示证书。使用 `-u` 传递默认用户名和密码(`admin:<custom-admin-password>`)。
|
||||
```bash
|
||||
curl https://localhost:9200 -ku admin:<custom-admin-password>
|
||||
```
|
||||
示例响应:
|
||||
```json
|
||||
{
|
||||
"name" : "opensearch-node1",
|
||||
"cluster_name" : "opensearch-cluster",
|
||||
"cluster_uuid" : "W0B8gPotTAajhMPbC9D4ww",
|
||||
"version" : {
|
||||
"distribution" : "opensearch",
|
||||
"number" : "2.6.0",
|
||||
"build_type" : "tar",
|
||||
"build_hash" : "7203a5af21a8a009aece1474446b437a3c674db6",
|
||||
"build_date" : "2023-02-24T18:58:37.352296474Z",
|
||||
"build_snapshot" : false,
|
||||
"lucene_version" : "9.5.0",
|
||||
"minimum_wire_compatibility_version" : "7.10.0",
|
||||
"minimum_index_compatibility_version" : "7.0.0"
|
||||
},
|
||||
"tagline" : "The OpenSearch Project: https://opensearch.org/"
|
||||
}
|
||||
```
|
||||
1. 通过在运行 OpenSearch 集群的同一主机上的 Web 浏览器中打开 `http://localhost:5601/` 来探索 OpenSearch Dashboards。默认用户名是 `admin`,默认密码在你的 `docker-compose.yml` 文件中的 `OPENSEARCH_INITIAL_ADMIN_PASSWORD=<custom-admin-password>` 设置中设定。
|
||||
|
||||
## 使用示例数据创建索引和字段映射
|
||||
|
||||
使用 OpenSearch 项目提供的数据集创建索引并定义字段映射。相同的虚构电子商务数据也用于 OpenSearch Dashboards 中的示例可视化。要了解更多信息,请参见 [OpenSearch Dashboards 入门]({{site.url}}{{site.baseurl}}/dashboards/index/)。
|
||||
|
||||
1. 下载 [ecommerce-field_mappings.json](https://github.com/opensearch-project/documentation-website/blob/{{site.opensearch_major_minor_version}}/assets/examples/ecommerce-field_mappings.json)。此文件为你将使用的示例数据定义了[映射]({{site.url}}{{site.baseurl}}/opensearch/mappings/)。
|
||||
```bash
|
||||
# 使用 cURL:
|
||||
curl -O https://raw.githubusercontent.com/opensearch-project/documentation-website/{{site.opensearch_major_minor_version}}/assets/examples/ecommerce-field_mappings.json
|
||||
|
||||
# 使用 wget:
|
||||
wget https://raw.githubusercontent.com/opensearch-project/documentation-website/{{site.opensearch_major_minor_version}}/assets/examples/ecommerce-field_mappings.json
|
||||
```
|
||||
1. 下载 [ecommerce.json](https://github.com/opensearch-project/documentation-website/blob/{{site.opensearch_major_minor_version}}/assets/examples/ecommerce.json)。此文件包含格式化的索引数据,以便可以通过批量 API 摄取。要了解更多信息,请参见[索引数据]({{site.url}}{{site.baseurl}}/opensearch/index-data/)和[批量]({{site.url}}{{site.baseurl}}/api-reference/document-apis/bulk/)。
|
||||
```bash
|
||||
# 使用 cURL:
|
||||
curl -O https://raw.githubusercontent.com/opensearch-project/documentation-website/{{site.opensearch_major_minor_version}}/assets/examples/ecommerce.json
|
||||
|
||||
# 使用 wget:
|
||||
wget https://raw.githubusercontent.com/opensearch-project/documentation-website/{{site.opensearch_major_minor_version}}/assets/examples/ecommerce.json
|
||||
```
|
||||
1. 使用映射文件定义字段映射。
|
||||
```bash
|
||||
curl -H "Content-Type: application/x-ndjson" -X PUT "https://localhost:9200/ecommerce" -ku admin:<custom-admin-password> --data-binary "@ecommerce-field_mappings.json"
|
||||
```
|
||||
1. 将索引上传到批量 API。
|
||||
```bash
|
||||
curl -H "Content-Type: application/x-ndjson" -X PUT "https://localhost:9200/ecommerce/_bulk" -ku admin:<custom-admin-password> --data-binary "@ecommerce.json"
|
||||
```
|
||||
1. 使用搜索 API 查询数据。以下命令提交一个查询,将返回 `customer_first_name` 为 `Sonya` 的文档。
|
||||
```bash
|
||||
curl -H 'Content-Type: application/json' -X GET "https://localhost:9200/ecommerce/_search?pretty=true" -ku admin:<custom-admin-password> -d' {"query":{"match":{"customer_first_name":"Sonya"}}}'
|
||||
```
|
||||
提交到 OpenSearch REST API 的查询默认返回扁平的 JSON。对于人类可读的响应体,使用查询参数 `pretty=true`。有关 `pretty` 和其他有用查询参数的更多信息,请参见[常用 REST 参数]({{site.url}}{{site.baseurl}}/opensearch/common-parameters/)。
|
||||
1. 通过在运行 OpenSearch 集群的同一主机上的 Web 浏览器中打开 `http://localhost:5601/` 来访问 OpenSearch Dashboards。默认用户名是 `admin`,密码在你的 `docker-compose.yml` 文件中的 `OPENSEARCH_INITIAL_ADMIN_PASSWORD=<custom-admin-password>` 设置中设定。
|
||||
1. 在顶部菜单栏,转到**管理 > 开发工具**。
|
||||
1. 在控制台的左侧窗格中,输入以下内容:
|
||||
```json
|
||||
GET ecommerce/_search
|
||||
{
|
||||
"query": {
|
||||
"match": {
|
||||
"customer_first_name": "Sonya"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
1. 选择请求右上角的三角形图标以提交查询。你也可以通过按 `Ctrl+Enter`(Mac 用户为 `Cmd+Enter`)来提交请求。要了解更多关于使用 OpenSearch Dashboards 控制台提交查询的信息,请参见[在控制台中运行查询]({{site.url}}{{site.baseurl}}/dashboards/run-queries/)。
|
||||
|
||||
## 下一步
|
||||
|
||||
你成功部署了自己的 OpenSearch 集群和 OpenSearch Dashboards,并添加了一些示例数据。现在你可以更详细地了解配置和功能。以下是一些关于从哪里开始的建议:
|
||||
- [关于安全插件]({{site.url}}{{site.baseurl}}/security/index/)
|
||||
- [OpenSearch 配置]({{site.url}}{{site.baseurl}}/install-and-configure/configuring-opensearch/)
|
||||
- [OpenSearch 插件安装]({{site.url}}{{site.baseurl}}/opensearch/install/plugins/)
|
||||
- [OpenSearch Dashboards 入门]({{site.url}}{{site.baseurl}}/dashboards/index/)
|
||||
- [OpenSearch 工具]({{site.url}}{{site.baseurl}}/tools/index/)
|
||||
- [索引 API]({{site.url}}{{site.baseurl}}/api-reference/index-apis/index/)
|
||||
|
||||
## 常见问题
|
||||
|
||||
如果你的容器无法启动或意外退出,请查看这些常见问题和建议的解决方案。
|
||||
|
||||
### Docker 命令需要提升权限
|
||||
|
||||
通过将你的用户添加到 `docker` 用户组来消除使用 `sudo` 运行 Docker 命令的需要。有关更多信息,请参见 Docker 的 [Linux 安装后步骤](https://docs.docker.com/engine/install/linux-postinstall/)。
|
||||
```bash
|
||||
sudo usermod -aG docker $USER
|
||||
```
|
||||
|
||||
### 错误消息:"-bash: docker-compose: command not found"
|
||||
|
||||
如果你安装了 Docker Desktop,那么 Docker Compose 已经安装在你的机器上。尝试使用 `docker compose`(不带连字符)而不是 `docker-compose`。请参见[使用 Docker Compose](https://docs.docker.com/get-started/08_using_compose/)。
|
||||
|
||||
### 错误消息:"docker: 'compose' is not a docker command."
|
||||
|
||||
如果你安装了 Docker Engine,那么你必须单独安装 Docker Compose,并且你将使用命令 `docker-compose`(带连字符)。请参见 [Docker Compose](https://github.com/docker/compose)。
|
||||
|
||||
### 错误消息:"max virtual memory areas vm.max_map_count [65530] is too low"
|
||||
|
||||
如果你的主机的 `vm.max_map_count` 太低,OpenSearch 将无法启动。如果你在服务日志中看到以下错误,请查看[重要系统设置]({{site.url}}{{site.baseurl}}/opensearch/install/important-settings/)并适当设置 `vm.max_map_count`。
|
||||
```bash
|
||||
opensearch-node1 | ERROR: [1] bootstrap checks failed
|
||||
opensearch-node1 | [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
|
||||
opensearch-node1 | ERROR: OpenSearch did not exit normally - check the logs at /usr/share/opensearch/logs/opensearch-cluster.log
|
||||
```
|
||||
@@ -1,53 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: 版本历史
|
||||
nav_order: 4
|
||||
permalink: /version-history/
|
||||
---
|
||||
|
||||
# 版本历史
|
||||
|
||||
OpenSearch 版本 | 发布亮点 | 发布日期
|
||||
:--- | :--- | :---
|
||||
[2.12.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.12.0.md) | 使并发段搜索和对话式搜索正式可用。提供实验性 OpenSearch Assistant Toolkit,包括代理和工具、工作流自动化以及 OpenSearch Dashboards UI 的 OpenSearch Assistant。添加新的仅匹配文本字段、查询洞察以监控 Top N 查询,以及嵌套字段上的 k-NN 搜索。有关完整的发布亮点列表,请参见发布说明。 | 2024 年 2 月 20 日
|
||||
[2.11.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.11.1.md) | 包括跨集群复制、告警、可观测性、OpenSearch Dashboards、索引管理、机器学习、安全和安全分析的维护更改和错误修复。有关完整的发布亮点列表,请参见发布说明。 | 2023 年 11 月 30 日
|
||||
[2.11.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.11.0.md) | 添加多模态和稀疏神经搜索功能,以及创建引用远程支持存储中数据的浅快照的能力。使搜索比较工具正式可用。包括在安全分析中创建威胁检测器的简化工作流程以及 OpenSearch Dashboards 中改进的安全性。实验性功能包括分布式追踪的新框架和工具集以及对话式搜索的更新。有关完整的发布亮点列表,请参见发布说明。 | 2023 年 10 月 16 日
|
||||
[2.10.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.10.0.md) | 使远程支持存储正式可用。添加混合搜索功能、安全分析的自定义日志类型、IP2Geo 摄取处理器和分隔词频词元过滤器。包括 OpenSearch Dashboards 的新外观和感觉,并更新 Discover 工具。添加通知的 Microsoft Teams Webhook 支持。实验性功能包括并发段搜索和对话式搜索。有关完整的发布亮点列表,请参见发布说明。 | 2023 年 9 月 25 日
|
||||
[2.9.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.9.0.md) | 使搜索管道和神经搜索插件正式可用。添加 ML 模型访问控制以及与外部 ML 工具的集成。实现 k-NN 字节向量和 Faiss 引擎的高效过滤。将告警和异常检测与 OpenSearch Dashboards 集成并添加组合监控器。添加两个新的索引编解码器算法选项。包括安全分析的新摄取模式、地理形状聚合和扩展——扩展 OpenSearch 功能的新机制。有关完整的发布亮点列表,请参见发布说明。 | 2023 年 7 月 24 日
|
||||
[2.8.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.8.0.md) | 添加使用 PPL 的跨集群查询、搜索管道、将段复制作为默认复制类型的选项、改进的可搜索快照性能,以及多数据源的 SigV4 认证支持 Amazon OpenSearch Serverless。包括 OpenSearch Dashboards 中刷写、刷新和清除缓存操作的 UI。有关完整的发布亮点列表,请参见发布说明。 | 2023 年 6 月 6 日
|
||||
[2.7.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.7.0.md) | 包括可搜索快照和段复制,现已正式可用。在 OpenSearch Dashboards 中添加多数据源、可观测性功能、动态租户管理、组件模板和基于形状的地图过滤器。包括扁平对象字段类型、热分片识别和 ML 模型的新自动重新加载机制。有关完整的发布亮点列表,请参见发布说明。 | 2023 年 5 月 2 日
|
||||
[2.6.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.6.0.md) | 包括可观测性的简单模式、索引管理 UI 增强、安全分析增强、协调节点级别的搜索背压,以及向仪表板添加地图的能力。实验性功能包括新的 ML 模型健康仪表板、ML 中新的文本嵌入模型和 Dashboards 中的 SigV4 认证。有关完整的发布亮点列表,请参见发布说明。 | 2023 年 2 月 28 日
|
||||
[2.5.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.5.0.md) | 包括索引管理 UI 增强、多层地图、可观测性的 Jaeger 支持、Debian 发行版、按感知属性返回集群健康、集群管理器任务限流、加权分区搜索请求路由策略和索引汇总中的查询字符串支持。实验性功能包括远程支持存储中的请求级持久性和 ML 节点的 GPU 加速。有关完整的发布亮点列表,请参见发布说明。 | 2023 年 1 月 24 日
|
||||
[2.4.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.4.1.md) | 包括 gradle 检查和索引压力测试的维护更新和错误修复。添加跳过变更日志的支持。 | 2022 年 12 月 13 日
|
||||
[2.4.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.4.0.md) | 包括 Windows 支持、时间点搜索、自定义 k-NN 过滤、笛卡尔坐标的 xy_point 和 xy_shape 字段类型、GeoHex 网格聚合和弹性增强,包括搜索背压。在 OpenSearch Dashboards 中,此版本添加了快照恢复功能、多重认证和已保存对象的聚合视图。此版本包括以下实验性功能:可搜索快照、比较搜索结果、OpenSearch Dashboards 中的多数据源、ML Commons 中的新模型服务框架、支持语义搜索的新神经搜索插件,以及分析安全日志的新安全分析插件。有关完整的发布亮点列表,请参见发布说明。 | 2022 年 11 月 15 日
|
||||
[2.3.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.3.0.md) | 此版本包括以下实验性功能:段复制、远程支持存储和 OpenSearch Dashboards 的拖放功能。实验性功能允许你在 OpenSearch 中测试新功能。由于这些功能仍在开发中,你的测试和反馈可以帮助在正式发布之前塑造功能的开发。我们不建议在生产中使用实验性功能。此外,此版本为 SQL 插件添加了 maketime 和 makedate 日期时间函数。为 OpenSearch Dashboards 创建了新的 [OpenSearch Playground](https://playground.opensearch.org) 演示站点。有关完整的发布亮点列表,请参见发布说明。 | 2022 年 9 月 14 日
|
||||
[2.2.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.2.1.md) | 包括 gradle 更新和 gradle 检查的错误修复。 | 2022 年 9 月 1 日
|
||||
[2.2.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.2.0.md) | 包括 ML Commons 中逻辑回归和 RCF 汇总机器学习算法的支持、用于近似 k-NN 搜索的 Lucene 或基于 C 的 Nmslib 和 Faiss 库、使用 SQL 和 PPL 查询按相关性搜索、可视化的自定义区域地图和汇总增强。有关完整的发布亮点列表,请参见发布说明。 | 2022 年 8 月 11 日
|
||||
[2.1.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.1.0.md) | 包括 ML Commons 插件中专用 ML 节点的支持、SQL 中的相关性搜索和其他功能、多词聚合和快照管理。有关完整的发布亮点列表,请参见发布说明。 | 2022 年 7 月 7 日
|
||||
[2.0.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.0.1.md) | 包括告警和异常检测的错误修复和维护更新。 | 2022 年 6 月 16 日
|
||||
[2.0.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.0.0.md) | 包括告警的文档级监控器、OpenSearch 通知插件和 OpenSearch Dashboards 中的 Geo Map Tiles。还添加了 Lucene 9 支持和所有 OpenSearch 插件的错误修复。有关完整的发布亮点列表,请参见发布说明。 | 2022 年 5 月 26 日
|
||||
[2.0.0-rc1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.0.0-rc1.md) | 2.0.0 的发布候选版本。此版本允许你在 GA 发布之前预览即将推出的 2.0.0 版本。预览版本添加了文档级告警、Lucene 9 支持以及在文档级安全中使用词项查找查询的能力。 | 2022 年 5 月 3 日
|
||||
[1.3.15](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.15.md) | 包括跨集群复制、SQL、OpenSearch Dashboards 报告和告警的错误修复和维护更新。 | 2024 年 3 月 5 日
|
||||
[1.3.14](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.14.md) | 包括 OpenSearch 安全和 OpenSearch Dashboards 安全的错误修复和维护更新。 | 2023 年 12 月 12 日
|
||||
[1.3.13](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.13.md) | 包括异常检测的错误修复,添加维护更新和基础设施增强。 | 2023 年 9 月 21 日
|
||||
[1.3.12](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.12.md) | 添加 OpenSearch 安全和 OpenSearch Dashboards 可观测性的维护更新。包括可观测性、OpenSearch Dashboards 可视化和 OpenSearch 安全的错误修复。 | 2023 年 8 月 10 日
|
||||
[1.3.11](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.11.md) | 添加 OpenSearch 安全、OpenSearch Dashboards 安全和 ML Commons 的维护更新。 | 2023 年 6 月 29 日
|
||||
[1.3.10](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.10.md) | 添加基础设施增强和异常检测、可观测性和安全的维护更新。包括索引管理和 OpenSearch 安全的错误修复。 | 2023 年 5 月 18 日
|
||||
[1.3.9](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.9.md) | 添加 Debian 支持。包括 OpenSearch 核心、k-NN 和 OpenSearch 安全的升级、增强和维护更新。 | 2023 年 3 月 16 日
|
||||
[1.3.8](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.8.md) | 添加 OpenSearch 安全增强。更新工具脚本以在 Windows 上运行。包括异常检测和 OpenSearch 安全的维护更新和错误修复。 | 2023 年 2 月 2 日
|
||||
[1.3.7](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.7.md) | 添加 Windows 支持。包括错误处理的维护更新和错误修复。 | 2022 年 12 月 13 日
|
||||
[1.3.6](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.6.md) | 包括 OpenSearch Security Dashboards 插件中租户的维护更新和错误修复。 | 2022 年 10 月 6 日
|
||||
[1.3.5](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.5.md) | 包括 gradle 检查和 OpenSearch 安全的维护更新和错误修复。 | 2022 年 9 月 1 日
|
||||
[1.3.4](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.4.md) | 包括 OpenSearch 和 OpenSearch Dashboards 的维护更新和错误修复。 | 2022 年 7 月 14 日
|
||||
[1.3.3](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.3.md) | 添加异常检测和 ML Commons 的增强。异常检测、可观测性和 k-NN 的错误修复。 | 2022 年 6 月 9 日
|
||||
[1.3.2](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.2.md) | 异常检测和 Security Dashboards 插件的错误修复,添加使用 RPM 安装 OpenSearch 的选项,以及 ML Commons 执行任务的增强,并移除异常检测中的 job-scheduler zip。 | 2022 年 5 月 5 日
|
||||
[1.3.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.1.md) | 使用文档级安全时的错误修复,并调整 ML Commons 以使用最新的 RCF jar 和 protostuff 进行 RCF 模型序列化。 | 2022 年 3 月 30 日
|
||||
[1.3.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.0.md) | 向验证检测器 API 添加模型类型验证、连续转换、自定义操作、解释 API 的应用策略参数、默认操作重试,以及索引管理的新滚动和转换条件、新的 ML Commons 插件、SQL 的解析命令、可观测性的应用程序分析、实时尾部、相关性和事件弹出窗口,以及性能分析器的自动回迁和 OPENSEARCH_JAVA_HOME 支持。错误修复。 | 2022 年 3 月 17 日
|
||||
[1.2.4](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.2.4.md) | 将性能分析器、SQL 和安全插件更新到 Log4j 2.17.1,将告警和作业调度器更新到 cron-utils 9.1.6,并更新异常检测和 SQL 中的 gson。 | 2022 年 1 月 18 日
|
||||
[1.2.3](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.2.3.md) | 按照 [CVE-2021-45105](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-45105) 中的建议,将 OpenSearch 中使用的 Log4j 版本更新到 Log4j 2.17.0。 | 2021 年 12 月 22 日
|
||||
[1.2.0](https://github.com/opensearch-project/OpenSearch/blob/main/release-notes/opensearch.release-notes-1.2.0.md) | 添加可观测性、异常检测的新验证 API、分片级索引背压、SQL 和 PPL 的新"match"查询类型、k-NN 的 Faiss 库支持和自定义 Dashboards 品牌。 | 2021 年 11 月 23 日
|
||||
[1.1.0](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.1.0.md) | 添加跨集群复制、索引管理安全、桶级告警、帮助从 Elasticsearch OSS 升级到 OpenSearch 的 CLI,以及异常检测插件中高基数数据的增强。 | 2021 年 10 月 5 日
|
||||
[1.0.1](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.0.1.md) | 错误修复。 | 2021 年 9 月 1 日
|
||||
[1.0.0](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.0.0.md) | 正式发布版本。为需要在连接前进行版本检查的客户端添加兼容性设置。 | 2021 年 7 月 12 日
|
||||
[1.0.0-rc1](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.0.0-rc1.md) | 第一个发布候选版本。 | 2021 年 6 月 7 日
|
||||
[1.0.0-beta1](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.0.0-beta1.md) | 初始 Beta 版本。重构插件以与 OpenSearch 配合工作。 | 2021 年 5 月 13 日
|
||||
@@ -1,23 +1,17 @@
|
||||
---
|
||||
layout: default
|
||||
title: 分析 API
|
||||
has_children: true
|
||||
nav_order: 7
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/analyze-apis/
|
||||
- /api-reference/analyze-apis/
|
||||
---
|
||||
|
||||
# 分析 API
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
分析 API 允许你执行[文本分析]({{site.url}}{{site.baseurl}}/api-reference/analyze-apis/),这是将非结构化文本转换为针对搜索优化的单个词元(通常是单词)的过程。
|
||||
分析 API 允许你执行[文本分析](/api-reference/analyze-apis),这是将非结构化文本转换为针对搜索优化的单个词元(通常是单词)的过程。
|
||||
|
||||
分析 API 分析文本字符串并返回生成的词元。
|
||||
|
||||
::: info NOTE
|
||||
如果你使用安全插件,则必须拥有 `manage index` 权限。如果你只想分析文本,则必须拥有 `manage cluster` 权限。
|
||||
{: .note}
|
||||
:::
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -28,8 +22,9 @@ POST /_analyze
|
||||
POST /{index}/_analyze
|
||||
```
|
||||
|
||||
::: info NOTE
|
||||
虽然你可以使用 `GET` 和 `POST` 请求发送分析请求,但两者有重要区别。`GET` 请求会导致数据被缓存在索引中,以便下次请求数据时能够更快地检索。`POST` 请求发送一个尚不存在的字符串到分析器,以便与索引中已有的数据进行比较。`POST` 请求不会被缓存。
|
||||
{: .note}
|
||||
:::
|
||||
|
||||
## 路径参数
|
||||
|
||||
@@ -91,7 +86,6 @@ GET /_analyze
|
||||
"text" : ["first array element", "second array element"]
|
||||
}
|
||||
````
|
||||
{% include copy-curl.html %}
|
||||
|
||||
上述请求返回以下字段:
|
||||
|
||||
@@ -157,7 +151,6 @@ GET /_analyze
|
||||
"text" : "OpenSearch text analysis"
|
||||
}
|
||||
````
|
||||
{% include copy-curl.html %}
|
||||
|
||||
上述请求返回以下字段:
|
||||
|
||||
@@ -204,7 +197,6 @@ GET /books2/_analyze
|
||||
"text" : "Le garçon m'a SUIVI."
|
||||
}
|
||||
````
|
||||
{% include copy-curl.html %}
|
||||
|
||||
上述请求返回以下字段:
|
||||
|
||||
@@ -257,7 +249,6 @@ GET /_analyze
|
||||
"text" : "OpenSearch filter"
|
||||
}
|
||||
````
|
||||
{% include copy-curl.html %}
|
||||
|
||||
上述请求返回以下字段:
|
||||
|
||||
@@ -287,7 +278,6 @@ GET /_analyze
|
||||
"text" : "<b>Leave</b> right now!"
|
||||
}
|
||||
````
|
||||
{% include copy-curl.html %}
|
||||
|
||||
上述请求返回以下字段:
|
||||
|
||||
@@ -319,7 +309,6 @@ GET /_analyze
|
||||
"text" : "how to train your dog in five steps"
|
||||
}
|
||||
````
|
||||
{% include copy-curl.html %}
|
||||
|
||||
上述请求返回以下字段:
|
||||
|
||||
@@ -384,7 +373,6 @@ GET /books/_analyze
|
||||
"text" : "OpenSearch analyze test"
|
||||
}
|
||||
````
|
||||
{% include copy-curl.html %}
|
||||
|
||||
上述请求返回以下字段:
|
||||
|
||||
@@ -427,7 +415,6 @@ GET /books/_analyze
|
||||
"text" : "OpenSearch analyze test"
|
||||
}
|
||||
````
|
||||
{% include copy-curl.html %}
|
||||
|
||||
上述请求返回以下字段:
|
||||
|
||||
@@ -460,7 +447,6 @@ GET /books2/_analyze
|
||||
"text" : "OpenSearch analyze test"
|
||||
}
|
||||
````
|
||||
{% include copy-curl.html %}
|
||||
|
||||
上述请求返回以下字段:
|
||||
|
||||
@@ -507,7 +493,6 @@ GET /books2/_analyze
|
||||
"text" : "C'est le garçon qui m'a suivi."
|
||||
}
|
||||
````
|
||||
{% include copy-curl.html %}
|
||||
|
||||
上述请求返回以下字段:
|
||||
|
||||
@@ -538,7 +523,6 @@ GET /_analyze
|
||||
"text" : "That is the boy who followed me."
|
||||
}
|
||||
````
|
||||
{% include copy-curl.html %}
|
||||
|
||||
上述请求返回以下字段:
|
||||
|
||||
@@ -572,7 +556,6 @@ GET /_analyze
|
||||
"attributes" : ["keyword"]
|
||||
}
|
||||
````
|
||||
{% include copy-curl.html %}
|
||||
|
||||
上述请求返回以下字段:
|
||||
|
||||
@@ -653,10 +636,10 @@ PUT /books2
|
||||
}
|
||||
}
|
||||
````
|
||||
{% include copy-curl.html %}
|
||||
|
||||
上述请求是索引 API 而不是分析 API。有关其他详细信息,请参阅[动态索引级别索引设置]({{site.url}}{{site.baseurl}}/install-and-configure/configuring-opensearch/index-settings/#dynamic-index-level-index-settings)。
|
||||
{: .note}
|
||||
::: info NOTE
|
||||
上述请求是索引 API 而不是分析 API。有关其他详细信息,请参阅[动态索引级别索引设置](/install-and-configure/configuring-opensearch/index-settings#dynamic-index-level-index-settings)。
|
||||
:::
|
||||
|
||||
### 响应字段
|
||||
|
||||
@@ -686,5 +669,6 @@ charfilters | 数组 | 应用于文本的字符过滤器列表。
|
||||
tokenizer | Object | 应用于文本的分词器名称和词元列表<sup>*</sup>,包含应用词元过滤器之前的内容。
|
||||
tokenfilters | 数组 | 应用于文本的词元过滤器列表。每个词元过滤器包括过滤器名称和词元列表<sup>*</sup>,包含应用过滤器之后的内容。词元过滤器按请求中指定的顺序列出。
|
||||
|
||||
::: info NOTE
|
||||
有关词元字段描述,请参阅[词元对象](#词元对象)。
|
||||
{: .note}
|
||||
:::
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
---
|
||||
layout: default
|
||||
title: 分析 API 术语
|
||||
parent: 分析 API
|
||||
|
||||
nav_order: 1
|
||||
---
|
||||
|
||||
# 术语
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 别名
|
||||
parent: CAT API
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-aliases/
|
||||
|
||||
nav_order: 1
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# CAT 别名
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 别名操作列出别名到索引的映射,以及路由和过滤信息。
|
||||
|
||||
@@ -20,21 +12,18 @@ CAT 别名操作列出别名到索引的映射,以及路由和过滤信息。
|
||||
```json
|
||||
GET _cat/aliases?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
要将信息限制为特定别名,请在查询后添加别名名称:
|
||||
|
||||
```json
|
||||
GET _cat/aliases/<alias>?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
如果你想获取多个别名的信息,请用逗号分隔别名名称:
|
||||
|
||||
```json
|
||||
GET _cat/aliases/alias1,alias2,alias3
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -43,12 +32,11 @@ GET _cat/aliases/<alias>
|
||||
GET _cat/aliases
|
||||
```
|
||||
|
||||
|
||||
## URL 参数
|
||||
|
||||
所有 CAT 别名 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
@@ -65,4 +53,4 @@ alias1 | movies | * | - | - | -
|
||||
.opensearch-dashboards | .opensearch-dashboards_1 | - | - | - | -
|
||||
```
|
||||
|
||||
要了解有关索引别名的更多信息,请参阅[索引别名]({{site.url}}{{site.baseurl}}/opensearch/index-alias)。
|
||||
要了解有关索引别名的更多信息,请参阅[索引别名](/im-plugin/index-alias)。
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 分配
|
||||
parent: CAT API
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-allocation/
|
||||
nav_order: 5
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# CAT 分配
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 分配操作列出索引的磁盘空间分配以及每个节点上的分片数量。
|
||||
|
||||
@@ -19,21 +12,18 @@ CAT 分配操作列出索引的磁盘空间分配以及每个节点上的分片
|
||||
```json
|
||||
GET _cat/allocation?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
要将信息限制为特定节点,请在查询后添加节点名称:
|
||||
|
||||
```json
|
||||
GET _cat/allocation/<node_name>
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
如果你想获取多个节点的信息,请用逗号分隔节点名称:
|
||||
|
||||
```json
|
||||
GET _cat/allocation/node_name_1,node_name_2,node_name_3
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -46,11 +36,11 @@ GET _cat/allocation/<node_name>
|
||||
|
||||
所有 CAT 分配 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
bytes | 字节大小 | 指定字节大小的单位。例如,`7kb` 或 `6gb`。有关更多信息,请参阅[支持的单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
bytes | 字节大小 | 指定字节大小的单位。例如,`7kb` 或 `6gb`。有关更多信息,请参阅[支持的单位](/api-reference/units)。
|
||||
local | 布尔值 | 是否仅从本地节点返回信息,而不是从集群管理器节点返回。默认为 false。
|
||||
cluster_manager_timeout | 时间 | 等待连接到集群管理器节点的时间量。默认为 30 秒。
|
||||
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 集群管理器
|
||||
parent: CAT API
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-master/
|
||||
nav_order: 30
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# CAT 集群管理器
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 集群管理器操作列出帮助识别选举的集群管理器节点的信息。
|
||||
|
||||
@@ -19,7 +12,6 @@ CAT 集群管理器操作列出帮助识别选举的集群管理器节点的信
|
||||
```
|
||||
GET _cat/cluster_manager?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -31,7 +23,7 @@ GET _cat/cluster_manager
|
||||
|
||||
所有 CAT 集群管理器 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 计数
|
||||
parent: CAT API
|
||||
nav_order: 10
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-count/
|
||||
|
||||
---
|
||||
|
||||
# CAT 计数
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 计数操作列出集群中的文档数量。
|
||||
|
||||
@@ -20,21 +12,18 @@ CAT 计数操作列出集群中的文档数量。
|
||||
```json
|
||||
GET _cat/count?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
要查看特定索引或别名中的文档数量,请在查询后添加索引或别名名称:
|
||||
|
||||
```json
|
||||
GET _cat/count/<index_or_alias>?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
如果你想获取多个索引或别名的信息,请用逗号分隔索引或别名名称:
|
||||
|
||||
```json
|
||||
GET _cat/count/index_or_alias_1,index_or_alias_2,index_or_alias_3
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -45,8 +34,7 @@ GET _cat/count/<index>?v
|
||||
|
||||
## URL 参数
|
||||
|
||||
所有 CAT 计数 URL 参数都是可选的。你可以指定任何[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)。
|
||||
|
||||
所有 CAT 计数 URL 参数都是可选的。你可以指定任何[通用 URL 参数](/api-reference/cat/)。
|
||||
|
||||
## 响应
|
||||
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 字段数据
|
||||
parent: CAT API
|
||||
nav_order: 15
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-field-data/
|
||||
---
|
||||
|
||||
# CAT 字段数据
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 字段数据操作列出每个节点上每个字段使用的内存大小。
|
||||
|
||||
@@ -19,21 +12,18 @@ CAT 字段数据操作列出每个节点上每个字段使用的内存大小。
|
||||
```json
|
||||
GET _cat/fielddata?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
要将信息限制为特定字段,请在查询后添加字段名称:
|
||||
|
||||
```json
|
||||
GET _cat/fielddata/<field_name>?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
如果你想获取多个字段的信息,请用逗号分隔字段名称:
|
||||
|
||||
```json
|
||||
GET _cat/fielddata/field_name_1,field_name_2,field_name_3
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -46,11 +36,11 @@ GET _cat/fielddata/<field_name>?v
|
||||
|
||||
所有 CAT 字段数据 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
bytes | 字节大小 | 指定字节大小的单位。例如,`7kb` 或 `6gb`。有关更多信息,请参阅[支持的单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
bytes | 字节大小 | 指定字节大小的单位。例如,`7kb` 或 `6gb`。有关更多信息,请参阅[支持的单位](/api-reference/units)。
|
||||
|
||||
## 响应
|
||||
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 健康状况
|
||||
parent: CAT API
|
||||
|
||||
nav_order: 20
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-health/
|
||||
---
|
||||
|
||||
# CAT 健康状况
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 健康状况操作列出集群的状态、集群运行时间、节点数量以及其他有助于分析集群健康状况的有用信息。
|
||||
|
||||
@@ -20,14 +12,12 @@ CAT 健康状况操作列出集群的状态、集群运行时间、节点数量
|
||||
```json
|
||||
GET _cat/health?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
```
|
||||
GET _cat/health?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## URL 参数
|
||||
|
||||
@@ -35,7 +25,7 @@ GET _cat/health?v
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
time | 时间 | 指定时间单位。例如,`5d` 或 `7h`。有关更多信息,请参阅[支持的单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
time | 时间 | 指定时间单位。例如,`5d` 或 `7h`。有关更多信息,请参阅[支持的单位](/api-reference/units)。
|
||||
ts | 布尔值 | 如果为 true,则返回 HH:MM:SS 和 Unix 纪元时间戳。默认为 true。
|
||||
|
||||
## 响应
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 索引操作
|
||||
parent: CAT API
|
||||
nav_order: 25
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-indices/
|
||||
---
|
||||
|
||||
# CAT 索引
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 索引操作列出与索引相关的信息,即它们使用了多少磁盘空间、有多少分片、健康状态等。
|
||||
|
||||
@@ -19,21 +12,18 @@ CAT 索引操作列出与索引相关的信息,即它们使用了多少磁盘
|
||||
```
|
||||
GET _cat/indices?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
要将信息限制为特定索引,请在查询后添加索引名称。
|
||||
|
||||
```
|
||||
GET _cat/indices/<index>?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
如果你想获取多个索引的信息,请用逗号分隔索引:
|
||||
|
||||
```json
|
||||
GET _cat/indices/index1,index2,index3
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -46,19 +36,18 @@ GET _cat/indices
|
||||
|
||||
所有 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index/)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
bytes | 字节大小 | 指定字节大小的单位。例如,`7kb` 或 `6gb`。有关更多信息,请参阅[支持的单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
bytes | 字节大小 | 指定字节大小的单位。例如,`7kb` 或 `6gb`。有关更多信息,请参阅[支持的单位](/api-reference/units)。
|
||||
health | 字符串 | 根据健康状态限制索引。支持的值为 `green`、`yellow` 和 `red`。
|
||||
include_unloaded_segments | 布尔值 | 是否包含未加载到内存中的段的信息。默认为 false。
|
||||
cluster_manager_timeout | 时间 | 等待连接到集群管理器节点的时间量。默认为 30 秒。
|
||||
pri | 布尔值 | 是否仅返回主分片的信息。默认为 false。
|
||||
time | 时间 | 指定时间单位。例如,`5d` 或 `7h`。有关更多信息,请参阅[支持的单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
time | 时间 | 指定时间单位。例如,`5d` 或 `7h`。有关更多信息,请参阅[支持的单位](/api-reference/units)。
|
||||
expand_wildcards | 枚举 | 将通配符表达式展开为具体索引。用逗号组合多个值。支持的值为 `all`、`open`、`closed`、`hidden` 和 `none`。默认为 `open`。
|
||||
|
||||
|
||||
## 响应
|
||||
|
||||
```json
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 节点属性
|
||||
parent: CAT API
|
||||
nav_order: 35
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-nodeattrs/
|
||||
---
|
||||
|
||||
# CAT 节点属性
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 节点属性操作列出自定义节点的属性。
|
||||
|
||||
@@ -19,7 +12,6 @@ CAT 节点属性操作列出自定义节点的属性。
|
||||
```
|
||||
GET _cat/nodeattrs?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -31,14 +23,13 @@ GET _cat/nodeattrs
|
||||
|
||||
所有 CAT 节点属性 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
local | 布尔值 | 是否仅从本地节点返回信息,而不是从集群管理器节点返回。默认为 false。
|
||||
cluster_manager_timeout | 时间 | 等待连接到集群管理器节点的时间量。默认为 30 秒。
|
||||
|
||||
|
||||
## 响应
|
||||
|
||||
```json
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 节点
|
||||
parent: CAT API
|
||||
nav_order: 40
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-nodes/
|
||||
---
|
||||
|
||||
# CAT 节点
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 节点操作列出节点级别的信息,包括节点角色和负载指标。
|
||||
|
||||
@@ -21,7 +14,6 @@ CAT 节点操作列出节点级别的信息,包括节点角色和负载指标
|
||||
```
|
||||
GET _cat/nodes?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -33,18 +25,17 @@ GET _cat/nodes
|
||||
|
||||
所有 CAT 节点 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
bytes | 字节大小 | 指定字节大小的单位。例如,`7kb` 或 `6gb`。有关更多信息,请参阅[支持的单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
bytes | 字节大小 | 指定字节大小的单位。例如,`7kb` 或 `6gb`。有关更多信息,请参阅[支持的单位](/api-reference/units)。
|
||||
full_id | 布尔值 | 如果为 true,返回完整的节点 ID。如果为 false,返回缩短的节点 ID。默认为 false。
|
||||
local | 布尔值 | 是否仅从本地节点返回信息,而不是从集群管理器节点返回。默认为 false。
|
||||
cluster_manager_timeout | 时间 | 等待连接到集群管理器节点的时间量。默认为 30 秒。
|
||||
time | 时间 | 指定时间单位。例如,`5d` 或 `7h`。有关更多信息,请参阅[支持的单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
time | 时间 | 指定时间单位。例如,`5d` 或 `7h`。有关更多信息,请参阅[支持的单位](/api-reference/units)。
|
||||
include_unloaded_segments | 布尔值 | 是否包含未加载到内存中的段的信息。默认为 false。
|
||||
|
||||
|
||||
## 响应
|
||||
|
||||
```json
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 待处理任务
|
||||
parent: CAT API
|
||||
|
||||
nav_order: 45
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-pending-tasks/
|
||||
---
|
||||
|
||||
# CAT 待处理任务
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 待处理任务操作列出所有待处理任务的进度,包括任务优先级和在队列中的时间。
|
||||
|
||||
@@ -20,7 +12,6 @@ CAT 待处理任务操作列出所有待处理任务的进度,包括任务优
|
||||
```
|
||||
GET _cat/pending_tasks?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -32,13 +23,13 @@ GET _cat/pending_tasks
|
||||
|
||||
所有 CAT 节点 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
local | 布尔值 | 是否仅从本地节点返回信息,而不是从集群管理器节点返回。默认为 false。
|
||||
cluster_manager_timeout | 时间 | 等待连接到集群管理器节点的时间量。默认为 30 秒。
|
||||
time | 时间 | 指定时间单位。例如,`5d` 或 `7h`。有关更多信息,请参阅[支持的单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
time | 时间 | 指定时间单位。例如,`5d` 或 `7h`。有关更多信息,请参阅[支持的单位](/api-reference/units)。
|
||||
|
||||
## 响应
|
||||
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 插件
|
||||
parent: CAT API
|
||||
|
||||
nav_order: 50
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-plugins/
|
||||
---
|
||||
|
||||
# CAT 插件
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 插件操作列出已安装插件的名称、组件和版本。
|
||||
|
||||
@@ -20,7 +12,6 @@ CAT 插件操作列出已安装插件的名称、组件和版本。
|
||||
```
|
||||
GET _cat/plugins?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -32,7 +23,7 @@ GET _cat/plugins
|
||||
|
||||
所有 CAT 插件 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 恢复
|
||||
parent: CAT API
|
||||
|
||||
nav_order: 50
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-recovery/
|
||||
---
|
||||
|
||||
# CAT 恢复
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 恢复操作列出所有已完成和正在进行的索引和分片恢复。
|
||||
|
||||
@@ -20,21 +12,18 @@ CAT 恢复操作列出所有已完成和正在进行的索引和分片恢复。
|
||||
```
|
||||
GET _cat/recovery?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
要仅查看特定索引的恢复,请在查询后添加索引名称。
|
||||
|
||||
```
|
||||
GET _cat/recovery/<index>?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
如果你想获取多个索引的信息,请用逗号分隔索引:
|
||||
|
||||
```json
|
||||
GET _cat/recovery/index1,index2,index3
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -46,14 +35,14 @@ GET _cat/recovery
|
||||
|
||||
所有 CAT 恢复 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
active_only | 布尔值 | 是否仅包含正在进行的分片恢复。默认为 false。
|
||||
bytes | 字节大小 | 指定字节大小的单位。例如,`7kb` 或 `6gb`。有关更多信息,请参阅[支持的单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
bytes | 字节大小 | 指定字节大小的单位。例如,`7kb` 或 `6gb`。有关更多信息,请参阅[支持的单位](/api-reference/units)。
|
||||
detailed | 布尔值 | 是否包含有关分片恢复的详细信息。默认为 false。
|
||||
time | 时间 | 指定时间单位。例如,`5d` 或 `7h`。有关更多信息,请参阅[支持的单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
time | 时间 | 指定时间单位。例如,`5d` 或 `7h`。有关更多信息,请参阅[支持的单位](/api-reference/units)。
|
||||
|
||||
## 响应
|
||||
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 仓库
|
||||
parent: CAT API
|
||||
|
||||
nav_order: 52
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-repositories/
|
||||
---
|
||||
|
||||
# CAT 仓库
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 仓库操作列出集群的所有快照仓库。
|
||||
|
||||
@@ -20,7 +12,6 @@ CAT 仓库操作列出集群的所有快照仓库。
|
||||
```
|
||||
GET _cat/repositories?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -32,14 +23,13 @@ GET _cat/repositories
|
||||
|
||||
所有 CAT 仓库 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
local | 布尔值 | 是否仅从本地节点返回信息,而不是从集群管理器节点返回。默认为 false。
|
||||
cluster_manager_timeout | 时间 | 等待连接到集群管理器节点的时间量。默认为 30 秒。
|
||||
|
||||
|
||||
## 响应
|
||||
|
||||
```json
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 段复制
|
||||
parent: CAT API
|
||||
nav_order: 53
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# CAT 段复制
|
||||
**2.7 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="2.7 版本引入" />
|
||||
|
||||
CAT 段复制操作返回有关每个副本分片上活动和上次完成的[段复制]({{site.url}}{{site.baseurl}}/opensearch/segment-replication/index)事件的信息,包括相关的分片级别指标。这些指标提供有关副本落后主分片多远的信息。
|
||||
CAT 段复制操作返回有关每个副本分片上活动和上次完成的[段复制](/tuning-your-cluster/availability-and-recovery/segment-replication/)事件的信息,包括相关的分片级别指标。这些指标提供有关副本落后主分片多远的信息。
|
||||
|
||||
::: info NOTE
|
||||
仅对启用了段复制的索引调用 CAT 段复制 API。
|
||||
{: .note}
|
||||
:::
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -39,11 +35,11 @@ CAT 段复制 API 操作支持以下可选查询参数。
|
||||
`active_only` | 布尔值 | 如果为 `true`,响应仅包含活动的段复制。默认为 `false`。
|
||||
[`detailed`](#其他详细响应指标) | 字符串 | 如果为 `true`,响应包含段复制事件每个阶段的其他指标。默认为 `false`。
|
||||
`shards` | 字符串 | 要显示的分片的逗号分隔列表。
|
||||
`bytes` | 字节单位 | 用于显示字节大小值的[单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
`bytes` | 字节单位 | 用于显示字节大小值的[单位](/api-reference/units)。
|
||||
`format` | 字符串 | HTTP accept 标头的简短版本。有效值包括 `JSON` 和 `YAML`。
|
||||
`h` | 字符串 | 要显示的列名的逗号分隔列表。
|
||||
`help` | 布尔值 | 如果为 `true`,响应包含帮助信息。默认为 `false`。
|
||||
`time` | 时间单位 | 用于显示时间值的[单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
`time` | 时间单位 | 用于显示时间值的[单位](/api-reference/units)。
|
||||
`v` | 布尔值 | 如果为 `true`,响应包含列标题。默认为 `false`。
|
||||
`s` | 字符串 | 指定对结果进行排序。例如,`s=shardId:desc` 按 shardId 降序排序。
|
||||
|
||||
@@ -58,7 +54,6 @@ CAT 段复制 API 操作支持以下可选查询参数。
|
||||
```json
|
||||
GET /_cat/segment_replication?v=true
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
响应包含上述请求的指标:
|
||||
|
||||
@@ -74,7 +69,6 @@ shardId target_node target_host checkpoints_behind bytes_behind current_lag last
|
||||
```json
|
||||
GET /_cat/segment_replication/index1,index2?v=true&shards=0
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
响应包含上述请求的指标。列标题对应于指标名称:
|
||||
|
||||
@@ -91,7 +85,6 @@ shardId target_node target_host checkpoints_behind bytes_behind current_lag last
|
||||
```json
|
||||
GET /_cat/segment_replication?v=true&detailed=true
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
响应包含有关段复制事件的文件和阶段的其他指标:
|
||||
|
||||
@@ -108,7 +101,6 @@ shardId target_node target_host checkpoints_behind bytes_behind current_lag last
|
||||
```json
|
||||
GET /_cat/segment_replication?v&s=shardId:desc
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
响应包含排序后的结果:
|
||||
|
||||
@@ -125,7 +117,6 @@ shardId target_node target_host checkpoints_behind bytes_behind current_lag
|
||||
```json
|
||||
GET /_cat/segment_replication?v&s=s:desc
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 响应指标
|
||||
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 段
|
||||
parent: CAT API
|
||||
|
||||
nav_order: 55
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-segments/
|
||||
---
|
||||
|
||||
# CAT 段
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 段操作列出每个索引的 Lucene 段级别信息。
|
||||
|
||||
@@ -20,21 +12,18 @@ CAT 段操作列出每个索引的 Lucene 段级别信息。
|
||||
```
|
||||
GET _cat/segments?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
要仅查看特定索引的段信息,请在查询后添加索引名称。
|
||||
|
||||
```
|
||||
GET _cat/segments/<index>?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
如果你想获取多个索引的信息,请用逗号分隔索引:
|
||||
|
||||
```
|
||||
GET _cat/segments/index1,index2,index3
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -46,14 +35,13 @@ GET _cat/segments
|
||||
|
||||
所有 CAT 段 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
bytes | 字节大小 | 指定字节大小的单位。例如,`7kb` 或 `6gb`。有关更多信息,请参阅[支持的单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
bytes | 字节大小 | 指定字节大小的单位。例如,`7kb` 或 `6gb`。有关更多信息,请参阅[支持的单位](/api-reference/units)。
|
||||
cluster_manager_timeout | 时间 | 等待连接到集群管理器节点的时间量。默认为 30 秒。
|
||||
|
||||
|
||||
## 响应
|
||||
|
||||
```json
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 分片
|
||||
parent: CAT API
|
||||
|
||||
nav_order: 60
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-shards/
|
||||
---
|
||||
|
||||
# CAT 分片
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 分片操作列出所有主分片和副本分片的状态以及它们的分布情况。
|
||||
|
||||
@@ -20,21 +12,18 @@ CAT 分片操作列出所有主分片和副本分片的状态以及它们的分
|
||||
```
|
||||
GET _cat/shards?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
要仅查看特定索引的分片信息,请在查询后添加索引名称。
|
||||
|
||||
```
|
||||
GET _cat/shards/<index>?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
如果你想获取多个索引的信息,请用逗号分隔索引:
|
||||
|
||||
```
|
||||
GET _cat/shards/index1,index2,index3
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -46,15 +35,14 @@ GET _cat/shards
|
||||
|
||||
所有 CAT 分片 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
bytes | 字节大小 | 指定字节大小的单位。例如,`7kb` 或 `6gb`。有关更多信息,请参阅[支持的单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
bytes | 字节大小 | 指定字节大小的单位。例如,`7kb` 或 `6gb`。有关更多信息,请参阅[支持的单位](/api-reference/units)。
|
||||
local | 布尔值 | 是否仅从本地节点返回信息,而不是从集群管理器节点返回。默认为 false。
|
||||
cluster_manager_timeout | 时间 | 等待连接到集群管理器节点的时间量。默认为 30 秒。
|
||||
time | 时间 | 指定时间单位。例如,`5d` 或 `7h`。有关更多信息,请参阅[支持的单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
|
||||
time | 时间 | 指定时间单位。例如,`5d` 或 `7h`。有关更多信息,请参阅[支持的单位](/api-reference/units)。
|
||||
|
||||
## 响应
|
||||
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 快照
|
||||
parent: CAT API
|
||||
|
||||
nav_order: 65
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-snapshots/
|
||||
---
|
||||
|
||||
# CAT 快照
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 快照操作列出仓库的所有快照。
|
||||
|
||||
@@ -20,7 +12,6 @@ CAT 快照操作列出仓库的所有快照。
|
||||
```
|
||||
GET _cat/snapshots?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -32,13 +23,12 @@ GET _cat/snapshots
|
||||
|
||||
所有 CAT 快照 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
cluster_manager_timeout | 时间 | 等待连接到集群管理器节点的时间量。默认为 30 秒。
|
||||
time | 时间 | 指定时间单位。例如,`5d` 或 `7h`。有关更多信息,请参阅[支持的单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
|
||||
time | 时间 | 指定时间单位。例如,`5d` 或 `7h`。有关更多信息,请参阅[支持的单位](/api-reference/units)。
|
||||
|
||||
## 响应
|
||||
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 任务
|
||||
parent: CAT API
|
||||
|
||||
nav_order: 70
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-tasks/
|
||||
---
|
||||
|
||||
# CAT 任务
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 任务操作列出集群上当前运行的所有任务的进度。
|
||||
|
||||
@@ -20,7 +12,6 @@ CAT 任务操作列出集群上当前运行的所有任务的进度。
|
||||
```
|
||||
GET _cat/tasks?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -32,15 +23,14 @@ GET _cat/tasks
|
||||
|
||||
所有 CAT 任务 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
nodes | 列表 | 逗号分隔的节点 ID 或名称列表,用于限制返回的信息。使用 `_local` 返回你正在连接的节点的信息,指定节点名称以获取特定节点的信息,或保持参数为空以获取所有节点的信息。
|
||||
detailed | 布尔值 | 返回详细的任务信息。(默认:false)
|
||||
parent_task_id | 字符串 | 返回具有指定父任务 ID(node_id:task_number)的任务。保持为空或设置为 -1 以返回所有任务。
|
||||
time | 时间 | 指定时间单位。例如,`5d` 或 `7h`。有关更多信息,请参阅[支持的单位]({{site.url}}{{site.baseurl}}/opensearch/units/)。
|
||||
|
||||
time | 时间 | 指定时间单位。例如,`5d` 或 `7h`。有关更多信息,请参阅[支持的单位](/api-reference/units)。
|
||||
|
||||
## 响应
|
||||
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 模板
|
||||
parent: CAT API
|
||||
|
||||
nav_order: 70
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-templates/
|
||||
---
|
||||
|
||||
# CAT 模板
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 模板操作列出索引模板的名称、模式、顺序号和版本号。
|
||||
|
||||
@@ -20,34 +12,30 @@ CAT 模板操作列出索引模板的名称、模式、顺序号和版本号。
|
||||
```
|
||||
GET _cat/templates?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
如果你想获取特定模板或模式的信息:
|
||||
|
||||
```
|
||||
GET _cat/templates/<template_name_or_pattern>
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
```
|
||||
GET _cat/templates
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## URL 参数
|
||||
|
||||
所有 CAT 模板 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
local | 布尔值 | 是否仅从本地节点返回信息,而不是从集群管理器节点返回。默认为 false。
|
||||
cluster_manager_timeout | 时间 | 等待连接到集群管理器节点的时间量。默认为 30 秒。
|
||||
|
||||
|
||||
## 响应
|
||||
|
||||
```
|
||||
@@ -55,4 +43,4 @@ name | index_patterns order version composed_of
|
||||
tenant_template | [opensearch-dashboards*] | 0 |
|
||||
```
|
||||
|
||||
要了解有关索引模板的更多信息,请参阅[索引模板]({{site.url}}{{site.baseurl}}/opensearch/index-templates)。
|
||||
要了解有关索引模板的更多信息,请参阅[索引模板](/im-plugin/index-templates)。
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT 线程池
|
||||
parent: CAT API
|
||||
nav_order: 75
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cat/cat-thread-pool/
|
||||
---
|
||||
|
||||
# CAT 线程池
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
CAT 线程池操作列出每个节点上不同线程池的活动、排队和被拒绝的线程。
|
||||
|
||||
@@ -19,21 +12,18 @@ CAT 线程池操作列出每个节点上不同线程池的活动、排队和被
|
||||
```
|
||||
GET _cat/thread_pool?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
如果你想获取多个线程池的信息,请用逗号分隔线程池名称:
|
||||
|
||||
```
|
||||
GET _cat/thread_pool/thread_pool_name_1,thread_pool_name_2,thread_pool_name_3
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
如果你想将信息限制为特定线程池,请在查询后添加线程池名称:
|
||||
|
||||
```
|
||||
GET _cat/thread_pool/<thread_pool_name>?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -45,14 +35,13 @@ GET _cat/thread_pool
|
||||
|
||||
所有 CAT 线程池 URL 参数都是可选的。
|
||||
|
||||
除了[通用 URL 参数]({{site.url}}{{site.baseurl}}/api-reference/cat/index)外,你还可以指定以下参数:
|
||||
除了[通用 URL 参数](/api-reference/cat/)外,你还可以指定以下参数:
|
||||
|
||||
参数 | 类型 | 描述
|
||||
:--- | :--- | :---
|
||||
local | 布尔值 | 是否仅从本地节点返回信息,而不是从集群管理器节点返回。默认为 false。
|
||||
cluster_manager_timeout | 时间 | 等待连接到集群管理器节点的时间量。默认为 30 秒。
|
||||
|
||||
|
||||
## 响应
|
||||
|
||||
```json
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT API
|
||||
nav_order: 10
|
||||
has_children: true
|
||||
redirect_from:
|
||||
- /opensearch/catapis/
|
||||
- /opensearch/rest-api/cat/index/
|
||||
---
|
||||
|
||||
# CAT API
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
你可以使用紧凑对齐文本(CAT)API 以易于理解的表格格式获取有关集群的基本统计信息。CAT API 是一个人类可读的接口,返回纯文本而不是传统的 JSON。
|
||||
|
||||
使用 CAT API,你可以回答诸如哪个节点是选举的主节点、集群处于什么状态、每个索引有多少文档等问题。
|
||||
@@ -22,7 +16,6 @@ redirect_from:
|
||||
```
|
||||
GET _cat
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 可选查询参数
|
||||
|
||||
@@ -47,7 +40,6 @@ GET _cat
|
||||
```json
|
||||
GET _cat/aliases?v
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
响应提供更多详细信息,例如响应中每列的名称。
|
||||
|
||||
@@ -82,5 +74,6 @@ GET _cat/<operation_name>?h=<header_name_1>,<header_name_2>&v
|
||||
|
||||
通常,对于任何操作,你可以使用 `help` 参数找出可用的标题,然后使用 `h` 参数将输出限制为你关心的标题。
|
||||
|
||||
::: info NOTE
|
||||
如果你使用安全插件,请确保你有适当的权限。
|
||||
{: .note }
|
||||
:::
|
||||
|
||||
@@ -1,22 +1,14 @@
|
||||
---
|
||||
layout: default
|
||||
title: 集群分配解释
|
||||
nav_order: 10
|
||||
parent: 集群 API
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/cluster-allocation/
|
||||
---
|
||||
|
||||
# 集群分配解释
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
最基本的集群分配解释请求会查找未分配的分片并解释为什么它无法分配到节点。
|
||||
|
||||
如果你添加一些选项,你可以获取特定分片的信息,包括 OpenSearch 为什么将其分配到当前节点。
|
||||
|
||||
|
||||
## 示例
|
||||
|
||||
```json
|
||||
@@ -27,7 +19,6 @@ GET _cluster/allocation/explain?include_yes_decisions=true
|
||||
"primary": true
|
||||
}
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
## 路径和 HTTP 方法
|
||||
|
||||
@@ -36,7 +27,6 @@ GET _cluster/allocation/explain
|
||||
POST _cluster/allocation/explain
|
||||
```
|
||||
|
||||
|
||||
## URL 参数
|
||||
|
||||
所有集群分配解释参数都是可选的。
|
||||
@@ -46,7 +36,6 @@ POST _cluster/allocation/explain
|
||||
include_yes_decisions | 布尔值 | OpenSearch 在尝试将分片分配到节点时会做出一系列是或否的决定。如果此参数为 true,OpenSearch 会在其响应中包含(通常更多的)"是"决定。默认为 false。
|
||||
include_disk_info | 布尔值 | 是否在响应中包含有关磁盘使用情况的信息。默认为 false。
|
||||
|
||||
|
||||
## 请求正文
|
||||
|
||||
所有集群分配解释字段都是可选的。
|
||||
@@ -58,7 +47,6 @@ index | 字符串 | 分片的索引名称。
|
||||
primary | 布尔值 | 是否为主分片(true)或其第一个副本(false)提供解释,它们共享相同的分片 ID。
|
||||
shard | 整数 | 你想要解释的分片 ID。
|
||||
|
||||
|
||||
## 响应
|
||||
|
||||
```json
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: 集群路由和感知
|
||||
nav_order: 20
|
||||
parent: 集群 API
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /api-reference/cluster-awareness/
|
||||
- /opensearch/rest-api/cluster-awareness/
|
||||
---
|
||||
|
||||
# 集群路由和感知
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
要控制搜索或 HTTP 流量的分布,你可以使用每个感知属性的权重来控制搜索或 HTTP 流量跨区域的分布。这通常用于区域部署、异构实例以及在区域故障期间将流量路由到其他区域。
|
||||
|
||||
@@ -36,7 +28,6 @@ attribute | 字符串 | 感知属性的名称,通常为 `zone`。属性名称
|
||||
weights | JSON 对象 | 在 PUT 请求的请求正文中为属性分配权重。权重可以设置为任何比例,例如 2:3:5。在 3 个区域的 2:3:5 比例中,对于发送到集群的每 100 个请求,每个区域将以随机顺序接收 20、30 或 50 个搜索请求。当分配的权重为 `0` 时,该区域不会接收任何搜索流量。
|
||||
_version | 字符串 | 通过版本控制实现乐观并发控制(OCC)。该参数使用简单版本控制,如 `1`,并根据每次后续修改向上递增。这允许发起请求的任何服务器验证区域是否已被修改。
|
||||
|
||||
|
||||
在以下示例请求正文中,`zone_1` 和 `zone_2` 各接收 50 个请求,而 `zone_3` 被阻止接收请求:
|
||||
|
||||
```
|
||||
@@ -69,7 +60,6 @@ PUT /_cluster/routing/awareness/zone/weights
|
||||
"_version" : 1
|
||||
}
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
#### 响应
|
||||
|
||||
@@ -79,7 +69,6 @@ PUT /_cluster/routing/awareness/zone/weights
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## 示例:获取所有区域的权重
|
||||
|
||||
以下示例请求获取所有区域的权重。
|
||||
@@ -89,7 +78,6 @@ PUT /_cluster/routing/awareness/zone/weights
|
||||
```json
|
||||
GET /_cluster/routing/awareness/zone/weights
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
#### 响应
|
||||
|
||||
@@ -117,7 +105,6 @@ OpenSearch 返回每个区域的权重:
|
||||
```json
|
||||
DELETE /_cluster/routing/awareness/zone/weights
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
#### 响应
|
||||
|
||||
@@ -129,5 +116,5 @@ DELETE /_cluster/routing/awareness/zone/weights
|
||||
|
||||
## 后续步骤
|
||||
|
||||
- 有关区域停用的更多信息,请参阅[集群停用]({{site.url}}{{site.baseurl}}/api-reference/cluster-decommission/)。
|
||||
- 有关分配感知的更多信息,请参阅[集群形成]({{site.url}}{{site.baseurl}}/opensearch/cluster/#advanced-step-6-configure-shard-allocation-awareness-or-forced-awareness)。
|
||||
- 有关区域停用的更多信息,请参阅[集群停用](/api-reference/cluster-api/cluster-decommission)。
|
||||
- 有关分配感知的更多信息,请参阅[集群形成](/tuning-your-cluster/#advanced-step-6-configure-shard-allocation-awareness-or-forced-awareness)。
|
||||
|
||||
@@ -1,22 +1,13 @@
|
||||
---
|
||||
layout: default
|
||||
title: 集群停用
|
||||
nav_order: 30
|
||||
parent: 集群 API
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /api-reference/cluster-decommission/
|
||||
- /opensearch/rest-api/cluster-decommission/
|
||||
---
|
||||
|
||||
# 集群停用
|
||||
**1.0 版本引入**
|
||||
{: .label .label-purple }
|
||||
<Badge type="tip" text="1.0 版本引入" />
|
||||
|
||||
集群停用操作增加了基于感知的停用支持。它对多区域部署非常有益,其中感知属性(如 `zones`)可以帮助以受控方式将新升级应用于集群。这在中断期间特别有用,在这种情况下,你可以停用不健康的区域以防止复制请求停滞并防止请求积压变得过大。
|
||||
|
||||
有关分配感知的更多信息,请参阅[分片分配感知]({{site.url}}{{site.baseurl}}//opensearch/cluster/#shard-allocation-awareness)。
|
||||
|
||||
有关分配感知的更多信息,请参阅[分片分配感知](//opensearch/cluster/#shard-allocation-awareness)。
|
||||
|
||||
## HTTP 和路径方法
|
||||
|
||||
@@ -33,7 +24,6 @@ DELETE /_cluster/decommission/awareness
|
||||
awareness_attribute_name | 字符串 | 感知属性的名称,通常为 `zone`。
|
||||
awareness_attribute_value | 字符串 | 感知属性的值。例如,如果你在两个不同的区域中分配了分片,你可以给每个区域一个 `zone-a` 或 `zoneb` 的值。集群停用操作会停用方法中列出的区域。
|
||||
|
||||
|
||||
## 示例:停用和重新启用区域
|
||||
|
||||
你可以使用以下示例请求来停用和重新启用区域:
|
||||
@@ -45,18 +35,15 @@ awareness_attribute_value | 字符串 | 感知属性的值。例如,如果你
|
||||
```json
|
||||
PUT /_cluster/decommission/awareness/<zone>/<zone-a>
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
如果你想重新启用已停用的区域,你可以使用 `DELETE` 方法:
|
||||
|
||||
```json
|
||||
DELETE /_cluster/decommission/awareness
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
#### 响应
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"acknowledged": true
|
||||
@@ -72,7 +59,6 @@ DELETE /_cluster/decommission/awareness
|
||||
```json
|
||||
GET /_cluster/decommission/awareness/zone/_status
|
||||
```
|
||||
{% include copy-curl.html %}
|
||||
|
||||
#### 响应
|
||||
|
||||
@@ -82,8 +68,7 @@ GET /_cluster/decommission/awareness/zone/_status
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## 后续步骤
|
||||
|
||||
- 有关区域感知和权重的更多信息,请参阅[集群感知]({{site.url}}{{site.baseurl}}/api-reference/cluster-awareness/)。
|
||||
- 有关分配感知的更多信息,请参阅[集群形成]({{site.url}}{{site.baseurl}}/opensearch/cluster/#advanced-step-6-configure-shard-allocation-awareness-or-forced-awareness)。
|
||||
- 有关区域感知和权重的更多信息,请参阅[集群感知](/api-reference/cluster-api/cluster-awareness)。
|
||||
- 有关分配感知的更多信息,请参阅[集群形成](/tuning-your-cluster/#advanced-step-6-configure-shard-allocation-awareness-or-forced-awareness)。
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user