|
2 | 2 | title: CloudHub
|
3 | 3 | sidebar_position: 1
|
4 | 4 | ---
|
5 |
| -## CloudHub Overview |
| 5 | +## CloudHub 概览 |
6 | 6 |
|
7 |
| -CloudHub is one module of cloudcore and is the mediator between Controllers and the Edge side. It supports both web-socket based connection as well as a [QUIC](https://quicwg.org/ops-drafts/draft-ietf-quic-applicability.html) protocol access at the same time. |
8 |
| -The edgehub can choose one of the protocols to access to the cloudhub. CloudHub's function is to enable the communication between edge and the Controllers. |
| 7 | +CloudHub 是 cloudcore 的一个模块,其作为媒介实现边缘和控制器之间的通信。它支持基于 WebSocket 的连接和 [QUIC](https://quicwg.org/ops-drafts/draft-ietf-quic-applicability.html) 协议两种访问方式,EdgeHub 可以选择其一来访问 CloudHub。 |
9 | 8 |
|
10 |
| -The connection to the edge(through EdgeHub module) is done through the HTTP over websocket connection. |
11 |
| -For internal communication it directly communicates with the Controllers. |
12 |
| -All the request send to CloudHub are of context object which are stored in channelQ along with the |
13 |
| -mapped channels of event object marked to its nodeID. |
| 9 | +通过 EdgeHub 模块与边缘进行连接是通过 WebSocket 上的 HTTP 连接实现的。而云上的内部通信则是直接与控制器通信。所有发送到 CloudHub 的请求都是上下文对象,这些对象与标记其节点ID的事件对象的映射通道一起存储在 channelQ 中。 |
14 | 10 |
|
15 | 11 |
|
16 |
| -The main functions performed by CloudHub are: |
| 12 | +CloudHub 执行的主要功能有: |
17 | 13 |
|
18 |
| -- Get message context and create ChannelQ for events |
19 |
| -- Create http connection over websocket |
20 |
| -- Serve websocket connection |
21 |
| -- Read message from edge |
22 |
| -- Write message to edge |
23 |
| -- Publish message to Controller |
| 14 | +- 获取消息上下文并为事件创建 ChannelQ |
| 15 | +- 通过 WebSocket 创建 HTTP 连接 |
| 16 | +- 保持 WebSocket 连接 |
| 17 | +- 从读取边缘信息 |
| 18 | +- 向边缘写入信息 |
| 19 | +- 向控制器发布信息 |
24 | 20 |
|
25 | 21 |
|
26 |
| -### Get message context and create ChannelQ for events: |
| 22 | +### 获取消息上下文并为事件创建 ChannelQ: |
27 | 23 |
|
28 |
| -The context object is stored in a channelQ. |
29 |
| -For all nodeID channel is created and the message is converted to event object |
30 |
| -Event object is then passed through the channel. |
| 24 | +上下文对象存储在 channelQ 当中。在所有 nodeID channel 都被创建,消息被转化为事件对象之后,通过该 channel 传递事件对象。 |
31 | 25 |
|
32 |
| -### Create http connection over websocket: |
| 26 | +### 通过 WebSocket 创建 HTTP 连接: |
33 | 27 |
|
34 |
| -- TLS certificates are loaded through the path provided in the context object |
35 |
| -- HTTP server is started with TLS configurations |
36 |
| -- Then HTTP connection is upgraded to websocket connection receiving conn object. |
37 |
| -- ServeConn function is responsible for serving all incoming connections |
| 28 | +- 通过上下文对象提供的路径加载 TLS 证书 |
| 29 | +- 使用 TLS 配置启动 HTTP 服务器 |
| 30 | +- 接着 HTTP 被更新为接收 conn 对象的 WebSocket 连接 |
| 31 | +- ServeConn 函数负责服务所有传入连接 |
38 | 32 |
|
39 |
| -### Read message from edge: |
| 33 | +### 从读取边缘信息: |
40 | 34 |
|
41 |
| -- First a deadline is set for keepalive interval |
42 |
| -- Then the JSON message from connection is read |
43 |
| -- After the details of Message Router are all set |
44 |
| -- Message is then converted to event object for cloud internal communication |
45 |
| -- In the end the event is published to Controllers |
| 35 | +- 首先为一个 keepalive 间隔设置一个截止时间 |
| 36 | +- 接着从连接中读取 JSON 信息 |
| 37 | +- 等待所有消息路由的细节都设置完成 |
| 38 | +- 将消息转化为用于云内部通信的事件对象 |
| 39 | +- 最后将事件发布给控制器 |
46 | 40 |
|
47 |
| -### Write Message to Edge: |
| 41 | +### 向边缘写入信息: |
48 | 42 |
|
49 |
| -- First all event objects are received with the given nodeID |
50 |
| -- The existence of same request and the liveness of the node need to be checked |
51 |
| -- The event object is converted to message structure |
52 |
| -- Write deadline is set. Then the message is passed to the websocket connection |
| 43 | +- 首先接收所有带有给定 nodeID 的事件对象 |
| 44 | +- 检查是否存在相同的请求以及节点是否存活 |
| 45 | +- 将事件对象转化为消息结构体 |
| 46 | +- 设置写入截至期后将消息传递给 WebSocket 连接 |
53 | 47 |
|
54 |
| -### Publish Message to Controllers: |
| 48 | +### 向控制器发布信息: |
55 | 49 |
|
56 |
| -- A default message with timestamp, clientID and event type is sent to controller |
57 |
| - every time a request is made to websocket connection |
58 |
| -- If the node gets disconnected then error is thrown and an event of describing |
59 |
| - node failure is published to the controller. |
| 50 | +- 每次向 WebSocket 连接发送请求时都会向控制器发送一个包含时间戳、clientID 和事件类型的默认消息。 |
| 51 | +- 若节点断连则会抛出错误,并向控制器发布一个描述该节点失败的事件。 |
60 | 52 |
|
61 |
| -## Usage |
| 53 | +## 用法 |
62 | 54 |
|
63 |
| -The CloudHub can be configured in three ways as mentioned below : |
| 55 | +可通过下述三种方式配置 CloudHub: |
64 | 56 |
|
65 |
| -- **Start the websocket server only**: Click [here](https://github.com/kubeedge/kubeedge/tree/master/docs/proposals/quic-design.md#start-the-websocket-server-only) to see the details. |
66 |
| -- **Start the quic server only**: Click [here](https://github.com/kubeedge/kubeedge/tree/master/docs/proposals/quic-design.md#start-the-quic-server-only) to see the details. |
67 |
| -- **Start the websocket and quic server at the same time**: Click [here](https://github.com/kubeedge/kubeedge/tree/master/docs/proposals/quic-design.md#start-the-websocket-and-quic-server-at-the-same-time) to see the details |
| 57 | +- **仅启动 WebSocket**: 点击[此处](https://github.com/kubeedge/kubeedge/tree/master/docs/proposals/quic-design.md#start-the-websocket-server-only)了解详情。 |
| 58 | +- **仅启动 QUIC 服务器**: 点击[此处](https://github.com/kubeedge/kubeedge/tree/master/docs/proposals/quic-design.md#start-the-quic-server-only)了解详情。 |
| 59 | +- **同时启动 WebSocket 和 QUIC 服务器**: 点击[此处](https://github.com/kubeedge/kubeedge/tree/master/docs/proposals/quic-design.md#start-the-websocket-and-quic-server-at-the-same-time)了解详情。 |
0 commit comments