-
Notifications
You must be signed in to change notification settings - Fork 0
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
Presto:分布式 SQL 查询引擎 | 宇宙湾 #119
Comments
博主你好,我对博客里面 4.4 时序交互图里面虚线框的发现服务部分存在一些疑惑。不清楚 Coordinator 和 worker 是怎么发送心跳给发现服务的。 |
是的,并不是 Worker 主动发送心跳,而是 Discovery 定时监测节点是否存活。其实,Presto 是基于 Airlift 框架来实现服务发现的,通过 HTTP 协议进行集群通讯。我们在 {
"environment": "presto",
"services": [
{
"id": "1f538ad9-e4b0-40a2-88a7-8e901b6d8ce6",
"nodeId": "presto_node_1",
"type": "presto-coordinator",
"pool": "general",
"location": "/presto_node_1",
"properties": {
"http": "http:https://127.0.0.1:9999",
"http-external": "http:https://127.0.0.1:9999"
}
},
{
"id": "89a0bf46-a949-4d62-8c65-c6fb9afe1bb2",
"nodeId": "presto_node_1",
"type": "discovery",
"pool": "general",
"location": "/presto_node_1",
"properties": {
"http": "http:https://127.0.0.1:9999",
"http-external": "http:https://127.0.0.1:9999"
}
},
{
"id": "253a93c3-ebe9-46cf-a0ee-41e7de56c620",
"nodeId": "presto_node_1",
"type": "presto",
"pool": "general",
"location": "/presto_node_1",
"properties": {
"node_version": "344",
"coordinator": "true",
"http": "http:https://127.0.0.1:9999",
"http-external": "http:https://127.0.0.1:9999",
"connectorIds": "system,druid"
}
},
{
"id": "0a9970f3-6717-4979-8f28-7f12c7bd7c75",
"nodeId": "presto_node_1",
"type": "jmx-http",
"pool": "general",
"location": "/presto_node_1",
"properties": {
"http": "http:https://127.0.0.1:9999",
"http-external": "http:https://127.0.0.1:9999"
}
}
]
} 具体的,是在 |
Node 的状态主要分为 active、inactive、shuttingDown 三种,以集合的形式保存在了 AllNodes 类中。后续再选择 Worker 的时候会判断是否存活,并通过 |
我看这个调用 |
我已经找到了,在 |
@sjx782392329 多谢提了一个很好的问题,刚我梳理了一下,添加到正文啦,详见:https://yuzhouwan.com/posts/200906/#Service-Discovery |
博主你好,"Presto:分布式 SQL 查询引擎" 中 "查询模型"中写了 Stage、Task、Split的关系,其中Stage在状态机 SEDA(stage event driver architecture)的定义中理解起来很清晰,F1 设计中更多提到Fragment这个基础概念,想听大神 如何在看待 Fragment 和 Stage之间的关系。 “Stage包含了一系列Task“,感觉有些模糊,博主是否可以把Task类型、 Stage和Task的包含关系 在文中进一步说明下。 |
你好,这个问题很赞呀 👍 不是大神哈,我简单说一下个人的理解吧。是这样的,类似 SEDA 的 Stage 和 F1 的 Fragment 概念,其实在很多引擎中都是存在的,本质上还是为了方便在分布式集群中做执行调度。在 Presto 中,同样也存在着 SubPlan、Fragment、Stage、Task 这些概念。总的来说,它们的对应关系是 SubPlan : Stage : Fragment : Task = 1 : 1 : 1 : n,即前三个均是一一对应的关系,而 Stage 则会包含多个 Task。其中,SubPlan 是根据 SQL 语义分析而拆分出来的逻辑查询计划。进一步依据算子,可以将 SubPlan 拆分一系列 PlanNode。再把这一系列的 PlanNode 封装起来就是 Fragment。然后,将 Fragment 调度到真正执行的 Worker 时,就形成了 Stage。这里的 Stage 则包含了一个或者多个 Task,每一个 Task 处理整个数据集的一小部分数据。另外,Task 的类型有很多种,可以看下 DataDefinitionTask 这个接口的具体实现,这里就不展开了。 |
https://yuzhouwan.com/posts/200906/
The text was updated successfully, but these errors were encountered: