Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translate /monitoring/historyserver.md #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions monitoring/historyserver.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "History Server"
title: "历史服务器"
nav-parent_id: monitoring
nav-pos: 3
---
Expand All @@ -22,62 +22,62 @@ specific language governing permissions and limitations
under the License.
-->

Flink has a history server that can be used to query the statistics of completed jobs after the corresponding Flink cluster has been shut down.
Flink 有一个历史服务器,在相应的 Flink 集群关闭后,历史服务器可以用来查询已完成作业的统计信息。

Furthermore, it exposes a REST API that accepts HTTP requests and responds with JSON data.
此外,它暴露了一个接收 HTTP 请求,响应 JSON 数据的 REST API。

* This will be replaced by the TOC
{:toc}

## Overview
## 概述

The HistoryServer allows you to query the status and statistics of completed jobs that have been archived by a JobManager.
历史服务器允许你去查询已被作业管理器存档的已完成作业的状态和统计信息。

After you have configured the HistoryServer *and* JobManager, you start and stop the HistoryServer via its corresponding startup script:
你配置好历史服务器和作业管理器后,你可以通过相应的启动脚本来启动和停止历史服务器:

{% highlight shell %}
# Start or stop the HistoryServer
# 启动或停止历史服务器
bin/historyserver.sh (start|start-foreground|stop)
{% endhighlight %}

By default, this server binds to `localhost` and listens at port `8082`.
默认情况下,这个服务器绑定 `localhost` 并监听端口 `8082`

Currently, you can only run it as a standalone process.
目前,你只能在一个独立的进程运行它。

## Configuration
## 配置

The configuration keys `jobmanager.archive.fs.dir` and `historyserver.archive.fs.refresh-interval` need to be adjusted for archiving and displaying archived jobs.
需要调整配置 `jobmanager.archive.fs.dir` `historyserver.archive.fs.refresh-interval` ,用于存档和展示已存档的作业。

**JobManager**
**作业管理器**

The archiving of completed jobs happens on the JobManager, which uploads the archived job information to a file system directory. You can configure the directory to archive completed jobs in `flink-conf.yaml` by setting a directory via `jobmanager.archive.fs.dir`.
已完成作业的存档发生在作业管理器中,作业管理器将存档的作业信息上传到文件系统的目录中。你可以在 `flink-conf.yaml` 中通过设置 `jobmanager.archive.fs.dir` 来配置存档已完成作业的目录。

{% highlight yaml %}
# Directory to upload completed job information
# 上传已完成作业信息的目录
jobmanager.archive.fs.dir: hdfs:///completed-jobs
{% endhighlight %}

**HistoryServer**
**历史服务器**

The HistoryServer can be configured to monitor a comma-separated list of directories in via `historyserver.archive.fs.dir`. The configured directories are regularly polled for new archives; the polling interval can be configured via `historyserver.archive.fs.refresh-interval`.
历史服务器通过 `historyserver.archive.fs.dir` 可以配置监听一个逗号分隔的目录列表。配置的目录会被定期轮询以产生新的存档。轮询的时间间隔可以通过 `historyserver.archive.fs.refresh-interval` 来配置。

{% highlight yaml %}
# Monitor the following directories for completed jobs
# 监听下面的目录为了已完成的作业
historyserver.archive.fs.dir: hdfs:///completed-jobs

# Refresh every 10 seconds
# 每10秒更新
historyserver.archive.fs.refresh-interval: 10000
{% endhighlight %}

The contained archives are downloaded and cached in the local filesystem. The local directory for this is configured via `historyserver.web.tmpdir`.
包含的存档会被下载或缓存到本地文件系统。这个的本地目录通过 `historyserver.web.tmpdir` 来配置。

Check out the configuration page for a [complete list of configuration options]({{ site.baseurl }}/ops/config.html#history-server).
检查配置页面来获取一个 [完整的配置项列表]({{ site.baseurl }}/ops/config.html#history-server)

## Available Requests
## 可用的请求

Below is a list of available requests, with a sample JSON response. All requests are of the sample form `http://hostname:8082/jobs`, below we list only the *path* part of the URLs.
下面是可用请求的列表,包含一个示例 JSON 响应。所有的请求都是示例形式 `http://hostname:8082/jobs`,下面我们只列出这些 URL 的部分路径。

Values in angle brackets are variables, for example `http://hostname:port/jobs/<jobid>/exceptions` will have to requested for example as `http://hostname:port/jobs/7684be6004e4e955c2a558a9bc463f65/exceptions`.
在尖括号里的值是变量,例如 `http://hostname:port/jobs/<jobid>/exceptions` 将会有像 `http://hostname:port/jobs/7684be6004e4e955c2a558a9bc463f65/exceptions` 的请求。

- `/config`
- `/jobs/overview`
Expand Down