This message was deleted.
# general
s
This message was deleted.
t
This is the entire error message:
Copy code
2023-09-08T14:17:10.131+0200    INFO    main-SendThread(localhost:2181) stdout  2023-09-08T14:17:10,131 - INFO  - [main-SendThread(localhost:2181):ClientCnxn$SendThread@1177] - Opening socket connection to server localhost/127.0.0.1:2181.

2023-09-08T14:17:10.131+0200    INFO    main-SendThread(localhost:2181) stdout  2023-09-08T14:17:10,131 - INFO  - [main-SendThread(localhost:2181):ClientCnxn$SendThread@1179] - SASL config status: Will not attempt to authenticate using SASL (unknown error)

2023-09-08T14:17:10.132+0200    INFO    main-SendThread(localhost:2181) stdout  2023-09-08T14:17:10,132 - WARN  - [main-SendThread(localhost:2181):ClientCnxn$SendThread@1300] - Session 0x0 for server localhost/127.0.0.1:2181, Closing socket connection. Attempting reconnect except it is a SessionExpiredException.
java.net.ConnectException: Connection refused
        at sun.nio.ch.Net.pollConnect(Native Method) ~[?:?]
        at sun.nio.ch.Net.pollConnectNow(Net.java:672) ~[?:?]
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:946) ~[?:?]
        at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:344) ~[zookeeper-3.8.1.jar:3.8.1]
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1289) ~[zookeeper-3.8.1.jar:3.8.1]

2023-09-08T14:17:10.339+0200    INFO    main    stdout  2023-09-08T14:17:10,339 - INFO  - [main:ZooKeeper@1232] - Session: 0x0 closed

2023-09-08T14:17:10.340+0200    INFO    main-EventThread        stdout  2023-09-08T14:17:10,339 - INFO  - [main-EventThread:ClientCnxn$EventThread@568] - EventThread shut down for session: 0x0

2023-09-08T14:17:10.341+0200    ERROR   main    io.trino.server.Server  org.apache.pulsar.metadata.api.MetadataStoreException: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss
java.lang.RuntimeException: org.apache.pulsar.metadata.api.MetadataStoreException: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss
        at org.apache.pulsar.sql.presto.PulsarConnectorFactory.create(PulsarConnectorFactory.java:74)
        at io.trino.connector.ConnectorManager.createConnector(ConnectorManager.java:411)
        at io.trino.connector.ConnectorManager.createCatalog(ConnectorManager.java:254)
        at io.trino.connector.ConnectorManager.createCatalog(ConnectorManager.java:246)
        at io.trino.connector.ConnectorManager.createCatalog(ConnectorManager.java:232)
        at io.trino.metadata.StaticCatalogStore.loadCatalog(StaticCatalogStore.java:88)
        at io.trino.metadata.StaticCatalogStore.loadCatalogs(StaticCatalogStore.java:68)
        at io.trino.server.Server.doStart(Server.java:125)
        at io.trino.server.Server.lambda$start$0(Server.java:78)
        at io.trino.$gen.Trino_368____20230908_121636_1.run(Unknown Source)
        at io.trino.server.Server.start(Server.java:78)
        at io.trino.server.TrinoServer.main(TrinoServer.java:38)
Caused by: org.apache.pulsar.metadata.api.MetadataStoreException: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss
        at org.apache.pulsar.metadata.impl.ZKMetadataStore.<init>(ZKMetadataStore.java:111)
        at org.apache.pulsar.metadata.impl.ZkMetadataStoreProvider.create(ZKMetadataStore.java:634)
        at org.apache.pulsar.metadata.impl.MetadataStoreFactoryImpl.newInstance(MetadataStoreFactoryImpl.java:61)
        at org.apache.pulsar.metadata.impl.MetadataStoreFactoryImpl.createExtended(MetadataStoreFactoryImpl.java:48)
        at org.apache.pulsar.metadata.api.extended.MetadataStoreExtended.create(MetadataStoreExtended.java:42)
        at org.apache.pulsar.sql.presto.PulsarConnectorCache.<init>(PulsarConnectorCache.java:77)
        at org.apache.pulsar.sql.presto.PulsarConnectorCache.getConnectorCache(PulsarConnectorCache.java:105)
        at org.apache.pulsar.sql.presto.PulsarConnector.initConnectorCache(PulsarConnector.java:85)
        at org.apache.pulsar.sql.presto.PulsarConnectorFactory.create(PulsarConnectorFactory.java:70)
        ... 11 more
Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:102)
        at org.apache.bookkeeper.zookeeper.ZooKeeperWatcherBase.waitForConnection(ZooKeeperWatcherBase.java:159)
        at org.apache.pulsar.metadata.impl.PulsarZooKeeperClient$Builder.build(PulsarZooKeeperClient.java:258)
        at org.apache.pulsar.metadata.impl.ZKMetadataStore.<init>(ZKMetadataStore.java:103)
        ... 19 more
a
Are you running the
pulsar sql-worker
command inside the cluster?
t
No, I'm trying to run the pulsar sql queries from outside the cluster. Running
pulsar sql-worker
from inside the cluster using the mini-pulsar-toolkit instance also throws the same connection errors. I'm wondering what's the recommended way to run pulsar sql queries from an application outside of the pulsar cluster.
a
If the sql-worker tries to connect to zookeeper at
localhost:2181
but the zookeeper is not running on that machine/node it makes sense. You would have to configure it to use the values from the zookeeper-service (and potentially expose the service if you are connecting from outside the cluster)
t
Thank you for your help, really appreciate it :) I managed to expose the zookeeper service to my local host and successfully start a Trino sql server to run the queries. These are the commands that I used to get the service exposed:
Copy code
kubectl expose service -n pulsar pulsar-mini-zookeeper --name pulsar-mini-zookeeper-ext

minikube service pulsar-mini-zookeeper-ext -n pulsar
Now I'm wondering if this is valid approach to use Pulsar SQL. I would have hopped that the pulsar proxy service would be the only thing that has to be exposed from the pulsar cluster.
a
Usually you would have the trino servers running inside the cluster and then just create a service that allows you to connect with a trino client from outside
🙌 1