@@ -3,13 +3,6 @@ title: "服务网格的组件"
33weight : 1
44---
55
6- {{% notice info %}}
7- <i class =" fas fa-language " ></i > There are certain paragaraphs needs translation from
8- English to Chinese. Do you speak Chinese? Help us to translate
9- it by sending us pull requests!
10- {{% /notice %}}
11- 12- 136![ Grid] ( /images/grid_4.png )
147
158## Router
@@ -47,7 +40,7 @@ it by sending us pull requests!
4740节点会自动注册运行它的计算机路径上所有可用的浏览器驱动程序.
4841它还为基于Chromium的浏览器和Firefox的每个可用的CPU都创建插槽.
4942对于Safari和Internet Explorer,
50- 则仅创建一个插槽。
43+ 则仅创建一个插槽.
5144通过特定的配置,
5245它可以在Docker容器中运行会话.
5346您可以在下一 [ 章节] ({{< ref "/grid/grid_4/setting_up_your_own_grid.zh-cn.md" >}})
@@ -59,47 +52,58 @@ it by sending us pull requests!
5952例如, Windows节点可以具有将Internet Explorer作为浏览器选项的功能,
6053而在Linux或Mac上则无法实现.
6154
62- ## Session Map
55+ ## 会话表
56+ 57+ 会话表是一种数据存储的方式,
58+ 用于保存会话id和会话运行的节点的信息.
59+ 它作为路由支持,
60+ 在向节点转发请求的过程中起作用.
61+ 路由将通过会话表获取与会话id关联的节点.
6362
64- The Session Map is a data store that keeps the information of the session id and the Node
65- where the session is running. It serves as a support for the Router in the process of
66- forwarding a request to the Node. The Router will ask the Session Map for the Node
67- associated to a session id.
63+ ## 新的会话队列器, 新的会话队列
6864
69- ## New Session Queuer, New Session Queue
65+ 新的会话队列器是唯一可以与新会话队列通信的组件.
66+ 它处理所有的诸如添加这样操纵队列的操作.
67+ 它具有用于设置请求超时和请求重试间隔的可配置参数.
7068
71- The New Session Queuer is the only
72- component which can communicate with the New Session Queue. It handles all queue operations like
73- add to manipulate the queue. It has configurable parameters for setting
74- the request timeout and request retry interval.
69+ 新的会话队列器从路由器接收新会话请求
70+ 并将其添加到队列中.
71+ 队列一直等待直到获取了请求的响应.
72+ 如果请求超时,
73+ 请求将立即被拒绝,
74+ 并且不会添加到队列中.
7575
76- The New Session Queuer receives the new session request from the Router and adds it to the queue.
77- The queuer waits until it receives the response for the request.
78- If the request times out, the request is rejected immediately and not added to the queue.
76+ 成功地将请求添加到队列后,
77+ 事件总线将触发一个事件.
78+ 分发服务器接收此事件并轮询队列.
79+ 此时, 将尝试创建一个会话.
7980
80- Upon successfully adding the request to the queue, Event Bus triggers an event.
81- The Distributor picks up this event and polls the queue. It now attempts to create a session.
81+ 如果所请求的功能不存在于任何已注册的节点中,
82+ 那么请求将立即被拒绝,
83+ 并且客户端将收到响应.
8284
83- If the requested capabilities do not exist in any of the registered Nodes, then the request is rejected
84- immediately and the client receives a response.
85+ 如果请求的功能与任何节点插槽的功能匹配,
86+ 分发服务器将尝试获取可用插槽.
87+ 如果所有插槽都很忙,
88+ 分发服务器将要求队列器将请求添加到队列前面.
89+ 分发服务器在请求重试间隔之后再次接收请求.
90+ 它将尝试重试,
91+ 直到请求成功或超时.
92+ 如果请求在重试或添加到队列前面时超时,
93+ 则其将被拒绝.
8594
86- If the requested capabilities match the capabilities of any of Node slots, Distributor attempts to get the
87- available slot. If all the slots are busy, the Distributor will ask the queuer to add the request
88- to the front of the queue. The Distributor receives the request again after the request retry interval.
89- It will attempt retries until the request is successful or has timed out.
90- If request times out while retrying or adding to the front of the queue its rejected.
95+ 在获得可用的插槽和会话创建之后,
96+ 分发服务器通过事件总线将新会话响应传递给新会话队列器.
97+ 新的会话队列器将在接收到事件时响应给客户端.
9198
92- After getting an available slot and session creation, the Distributor passes the new session response
93- to the New Session Queuer via the Event Bus. The New Session Queuer will respond to the client when it
94- receives the event.
99+ ## 事件总线
95100
96- ## Event Bus
101+ 事件总线充当节点、分发服务器、新的会话队列器和会话表之间的通信路径.
102+ 网格通过消息进行大部分内部通信, 避免了昂贵的HTTP调用.
103+ 当以完全分布式模式启动网格时, 事件总线是应该启动的第一个组件.
97104
98- The Event Bus serves as a communication path between the Nodes, Distributor, New Session Queuer, and Session Map.
99- The Grid does most of its internal communication through messages, avoiding expensive HTTP calls.
100- When starting the Grid in its fully distributed mode, the Event Bus is the first component that should be started.
101105
102- ## Roles in Grid
106+ ## 网格中的角色
103107
104108在网格3中, 组件是集线器和节点,
105109可以通过以独立模式启动网格来一起运行它们.
0 commit comments