apache/pulsar

same pulsar-admin should seamlessly work with both brokers and function workers in a distributed environment

Open

#6,425 建立於 2020年2月26日

在 GitHub 查看
 (2 留言) (2 反應) (0 負責人)Java (3,485 fork)batch import
area/functiongood first issuehelp wantedtype/feature

倉庫指標

Star
 (13,697 star)
PR 合併指標
 (平均合併 3天 10小時) (30 天內合併 146 個 PR)

描述

I am running Function worker as a separate machine, and pulsar-admin gives this error:

# bin/pulsar-admin functions create   --py c.py   --classname router.RoutingFunction   --tenant c1-d1   --namespace emsaas   --name test1   --inputs persistent://c1-d1/emsaas/in
Function worker service is not done initializing. Please try again in a little while.
Reason: HTTP 503 Service Unavailable

client.conf points to the broker. Changing webServiceUrl to point to the function worker fixes the issue. This is not intuitive and the error message doesn't help. I would expect pulsar-admin to get the Function worker address from the broker somehow and work transparently without the need to use different client.conf's.

Relevant broker log: 172.32.2.235 is the address of the Function worker, and the log that fails it seems to connect to 127.0.0.1.

Feb 23 13:17:09 localhost pulsar: 13:17:09.892 [pulsar-web-30-15] INFO  org.eclipse.jetty.server.RequestLog - 172.32.2.235 - - [23/Feb/2020:13:17:09 +0000] "GET /admin/v2/persistent/public/functions/coordinate/stats HTTP/1.1" 200 901 "-" "Pulsar-Java-v2.5.0" 1
Feb 23 13:17:39 localhost pulsar: 13:17:39.879 [pulsar-web-30-8] INFO  org.eclipse.jetty.server.RequestLog - 172.32.2.235 - - [23/Feb/2020:13:17:39 +0000] "GET /admin/v2/persistent/public/functions/coordinate/stats HTTP/1.1" 200 901 "-" "Pulsar-Java-v2.5.0" 3
Feb 23 13:17:41 localhost pulsar: 13:17:41.644 [pulsar-web-30-4] INFO  org.eclipse.jetty.server.RequestLog - 127.0.0.1 - - [23/Feb/2020:13:17:41 +0000] "POST /admin/v3/functions/c1-d1/emsaas/test1 HTTP/1.1" 503 98 "-" "Pulsar-Java-v2.5.0" 4
Feb 23 13:17:54 localhost kernel: ena: Feature 27 isn't supported
Feb 23 13:18:09 localhost pulsar: 13:18:09.879 [pulsar-web-30-6] INFO  org.eclipse.jetty.server.RequestLog - 172.32.2.235 - - [23/Feb/2020:13:18:09 +0000] "GET /admin/v2/persistent/public/functions/coordinate/stats HTTP/1.1" 200 901 "-" "Pulsar-Java-v2.5.0" 1 

貢獻者指南