[zh]Resync tasks files[10]
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
title: 使用工作队列进行粗粒度并行处理
|
||||
min-kubernetes-server-version: v1.8
|
||||
content_type: task
|
||||
weight: 30
|
||||
weight: 20
|
||||
---
|
||||
|
||||
<!--
|
||||
@@ -10,7 +10,7 @@ weight: 30
|
||||
title: Coarse Parallel Processing Using a Work Queue
|
||||
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
|
||||
<!--
|
||||
## Starting a message queue service
|
||||
|
||||
This example uses RabbitMQ, but it should be easy to adapt to another AMQP-type message service.
|
||||
This example uses RabbitMQ, however, you can adapt the example to use another AMQP-type message service.
|
||||
|
||||
In practice you could set up a message queue service once in a
|
||||
cluster and reuse it for many jobs, as well as for long-running services.
|
||||
@@ -72,7 +72,7 @@ Start RabbitMQ as follows:
|
||||
-->
|
||||
## 启动消息队列服务
|
||||
|
||||
本例使用了 RabbitMQ,使用其他 AMQP 类型的消息服务应该比较容易。
|
||||
本例使用了 RabbitMQ,但你可以更改该示例,使用其他 AMQP 类型的消息服务。
|
||||
|
||||
在实际工作中,在集群中一次性部署某个消息队列服务,之后在很多 Job 中复用,包括需要长期运行的服务。
|
||||
|
||||
@@ -225,17 +225,17 @@ root@temp-loe07:/#
|
||||
|
||||
<!--
|
||||
In the last command, the `amqp-consume` tool takes one message (`-c 1`)
|
||||
from the queue, and passes that message to the standard input of an arbitrary command. In this case, the program `cat` is just printing
|
||||
out what it gets on the standard input, and the echo is just to add a carriage
|
||||
from the queue, and passes that message to the standard input of an arbitrary command. In this case, the program `cat` prints out the characters read from standard input, and the echo adds a carriage
|
||||
return so the example is readable.
|
||||
-->
|
||||
|
||||
最后一个命令中, `amqp-consume` 工具从队列中取走了一个消息,并把该消息传递给了随机命令的标准输出。在这种情况下,`cat` 只会打印它从标准输入或得的内容,echo 只会添加回车符以便示例可读。
|
||||
最后一个命令中, `amqp-consume` 工具从队列中取走了一个消息,并把该消息传递给了随机命令的标准输出。
|
||||
在这种情况下,`cat` 会打印它从标准输入中读取的字符,echo 会添加回车符以便示例可读。
|
||||
|
||||
<!--
|
||||
## Filling the Queue with tasks
|
||||
|
||||
Now lets fill the queue with some "tasks". In our example, our tasks are just strings to be
|
||||
Now let's fill the queue with some "tasks". In our example, our tasks are strings to be
|
||||
printed.
|
||||
|
||||
In a practice, the content of the messages might be:
|
||||
|
||||
Reference in New Issue
Block a user