是的,您可以运行独立的发现服务。这种情况很少见,通常我建议只在协调器上运行它。
在您的发现节点上:
- 下载与您的 Presto 节点兼容的版本的 discovery service tar.gz。 (例如,presto 版本 347 与 discovery service 1.29 兼容)并将其解压缩到一个目录。
- 类似于 Presto Server 设置,在服务根目录下创建
/etc 目录并配置node.properties 和jvm.config。
- 添加config.properties,发现服务就这么简单。
http-server.http.port=8081
- 在您的协调员/工作人员 config.properties 中更新这些行。
discovery-server.enabled=false
discovery.uri=http://discovery.example.com:8081
- 重新启动您的服务。 (发现服务的启动方式与 presto services are started 使用
bin/launcher 相同)
- 一旦所有服务器和工作器都启动,您应该能够检查
curl -XGET http://discovery.example.com:8081/v1/service 并且应该会看到一些包含以下内容的输出:
{
"environment": "production",
"services": [
{
"id": "d2b7141e-d83f-4d23-be86-285ff2a9f53d",
"nodeId": "57ac8bd3-c55e-4170-b363-80d10023ece8",
"type": "presto",
"pool": "general",
"location": "/57ac8bd3-c55e-4170-b363-80d10023ece8",
"properties": {
"node_version": "347",
"coordinator": "true",
"http": "http://coord.example.com:8080",
"http-external": "http://coord.example.com:8080",
"connectorIds": "system"
}
},
{
"id": "f0abafae-052a-4758-95c6-d19355043bc6",
"nodeId": "57ac8bd3-c55e-4170-b363-80d10023ece8",
"type": "presto-coordinator",
"pool": "general",
"location": "/57ac8bd3-c55e-4170-b363-80d10023ece8",
"properties": {
"http": "http://coord.example.com:8080",
"http-external": "http://coord.example.com:8080"
}
},
{
"id": "1f5096de-189e-4e25-bac3-adc079981d86",
"nodeId": "8d7e820f-dd01-4227-ad6e-f74b97202647",
"type": "presto",
"pool": "general",
"location": "/8d7e820f-dd01-4227-ad6e-f74b97202647",
"properties": {
"node_version": "347",
"coordinator": "false",
"http": "http://worker1.example.com:8080",
"http-external": "http://worker1.example.com:8080",
"connectorIds": "system"
}
},
....
]
}