From df00b046cd5ae0f0e36b6eb55759a1f9f121aefc Mon Sep 17 00:00:00 2001 From: caodonghui Date: Thu, 13 May 2021 11:25:53 +0800 Subject: [PATCH] [zh]Resync tasks files[10] --- .../coarse-parallel-processing-work-queue.md | 18 +++++++++--------- .../job/fine-parallel-processing-work-queue.md | 12 ++++++------ .../tasks/job/parallel-processing-expansion.md | 9 +++++---- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/content/zh/docs/tasks/job/coarse-parallel-processing-work-queue.md b/content/zh/docs/tasks/job/coarse-parallel-processing-work-queue.md index 0259283757..33690a938e 100644 --- a/content/zh/docs/tasks/job/coarse-parallel-processing-work-queue.md +++ b/content/zh/docs/tasks/job/coarse-parallel-processing-work-queue.md @@ -2,7 +2,7 @@ title: 使用工作队列进行粗粒度并行处理 min-kubernetes-server-version: v1.8 content_type: task -weight: 30 +weight: 20 --- @@ -28,7 +28,7 @@ Here is an overview of the steps in this example: 1. **Start a message queue service.** In this example, we use RabbitMQ, but you could use another one. In practice you would set up a message queue service once and reuse it for many jobs. 1. **Create a queue, and fill it with messages.** Each message represents one task to be done. In - this example, a message is just an integer that we will do a lengthy computation on. + this example, a message is an integer that we will do a lengthy computation on. 1. **Start a Job that works on tasks from the queue**. The Job starts several pods. Each pod takes one task from the message queue, processes it, and repeats until the end of the queue is reached. --> @@ -63,7 +63,7 @@ non-parallel, use of [Job](/docs/concepts/jobs/run-to-completion-finite-workload ## 启动消息队列服务 -本例使用了 RabbitMQ,使用其他 AMQP 类型的消息服务应该比较容易。 +本例使用了 RabbitMQ,但你可以更改该示例,使用其他 AMQP 类型的消息服务。 在实际工作中,在集群中一次性部署某个消息队列服务,之后在很多 Job 中复用,包括需要长期运行的服务。 @@ -225,17 +225,17 @@ root@temp-loe07:/# -最后一个命令中, `amqp-consume` 工具从队列中取走了一个消息,并把该消息传递给了随机命令的标准输出。在这种情况下,`cat` 只会打印它从标准输入或得的内容,echo 只会添加回车符以便示例可读。 +最后一个命令中, `amqp-consume` 工具从队列中取走了一个消息,并把该消息传递给了随机命令的标准输出。 +在这种情况下,`cat` 会打印它从标准输入中读取的字符,echo 会添加回车符以便示例可读。 @@ -45,10 +45,10 @@ Here is an overview of the steps in this example: 2. **创建一个队列,然后向其中填充消息。** 每个消息表示一个将要被处理的工作任务。 - 在这个例子中,消息只是一个我们将用于进行长度计算的整数。 + 在这个例子中,消息是一个我们将用于进行长度计算的整数。 ## 使用任务填充队列 -现在,让我们往队列里添加一些“任务”。在这个例子中,我们的任务只是一些将被打印出来的字符串。 +现在,让我们往队列里添加一些“任务”。在这个例子中,我们的任务是一些将被打印出来的字符串。 启动一个临时的可交互的 pod 用于运行 Redis 命令行界面。 diff --git a/content/zh/docs/tasks/job/parallel-processing-expansion.md b/content/zh/docs/tasks/job/parallel-processing-expansion.md index 071fca97cb..7dd67cb239 100644 --- a/content/zh/docs/tasks/job/parallel-processing-expansion.md +++ b/content/zh/docs/tasks/job/parallel-processing-expansion.md @@ -2,13 +2,13 @@ title: 使用展开的方式进行并行处理 content_type: task min-kubernetes-server-version: v1.8 -weight: 20 +weight: 50 --- @@ -19,7 +19,7 @@ based on a common template. You can use this approach to process batches of work parallel. For this example there are only three items: _apple_, _banana_, and _cherry_. -The sample Jobs process each item simply by printing a string then pausing. +The sample Jobs process each item by printing a string then pausing. See [using Jobs in real workloads](#using-jobs-in-real-workloads) to learn about how this pattern fits more realistic use cases. @@ -29,7 +29,8 @@ this pattern fits more realistic use cases. 你可以用这种方法来并行执行批处理任务。 在本任务示例中,只有三个工作条目:_apple_、_banana_ 和 _cherry_。 -示例任务处理每个条目时仅仅是打印一个字符串之后结束。 +示例任务处理每个条目时打印一个字符串之后结束。 + 参考[在真实负载中使用 Job](#using-jobs-in-real-workloads)了解更适用于真实使用场景的模式。 ## {{% heading "prerequisites" %}}