Hello everyone,
I'm reaching out today for help because I'm stuck on Pulsar. I currently have a situation where I'm not making much progress, even though I've read quite a bit of Pulsar documentation and searched online.
I would like to perform a standalone (all-in-one) installation of Pulsar with Kubernetes, but the installation requires having 1 replica of each, which doesn't suit me. So I went through Docker (
https://pulsar.apache.org/docs/3.0.x/getting-started-docker/) to install it in Standalone mode and have only one "container".
The function creation works well, but when I try to do a "PutState" or "QueryState", I get an error message telling me:
I have no name!@46d54818541c:/pulsar$ bin/pulsar-admin functions putstate \
--tenant public
--namespace default
--name wordcount
--state "{"key":"test", "stringValue":"hello pulsar"}"
State storage client is not done initializing. Please try again in a little while.
Reason: State storage client is not done initializing. Please try again in a little while.
2023-05-15T14
4621,398+0000 [main] WARN org.apache.pulsar.common.util.ShutdownUtil - Triggering immediate shutdown of current process with status 1
java.lang.Exception: Stacktrace for immediate shutdown
at org.apache.pulsar.common.util.ShutdownUtil.triggerImmediateForcefulShutdown(ShutdownUtil.java:52) ~[org.apache.pulsar-pulsar-common-3.0.0.jar:3.0.0]
at org.apache.pulsar.admin.cli.PulsarAdminTool.exit(PulsarAdminTool.java:315) ~[org.apache.pulsar-pulsar-client-tools-3.0.0.jar:3.0.0]
at org.apache.pulsar.admin.cli.PulsarAdminTool.execute(PulsarAdminTool.java:305) ~[org.apache.pulsar-pulsar-client-tools-3.0.0.jar:3.0.0]
at org.apache.pulsar.admin.cli.PulsarAdminTool.main(PulsarAdminTool.java:280) ~[org.apache.pulsar-pulsar-client-tools-3.0.0.jar:3.0.0]
To activate "StateStorage" and be able to use the "PutState" & "QueryState" functions, I tried to follow this documentation (
https://pulsar.apache.org/docs/3.0.x/functions-worker-stateful/).
I'm not sure if this is how it's supposed to work, but I tried several methods because I didn't quite understand:
docker run -it -e PULSAR_PREFIX_functionsWorkerEnablePackageManagement=true -p 6650:6650 -p 8080:8080 --mount source=pulsardata,target=/pulsar/data --mount source=pulsarconf,target=/pulsar/conf apachepulsar/pulsar:3.0.0 sh -c "bin/apply-config-from-env.py conf/standalone.conf && bin/pulsar standalone"
To test an environment variable, I used a variable listed in this documentation (
https://github.com/apache/pulsar/blob/e6b12c64b043903eb5ff2dc5186fe8030f157cfc/conf/standalone.conf), and upon container startup, we can see:
[conf/standalone.conf] Applying config functionsWorkerEnablePackageManagement = true
[conf/standalone.conf] Updating config functionsWorkerEnablePackageManagement = true
I checked in the confS/standalone.conf file and the variable has not been set to true, it is still false.
Here, I had to specify the version "3.0" and not "2.10" as indicated in the documentation because I encountered a problem with the Java JVM "UseZGC experimental options".
I also tried to modify the bookkeeper.conf file as indicated in the documentation to enable functions with states, but I can't get it to work.
I would like to know why and how to get a response to my "PutState" or "QueryState" please.
By the way, is there not yet a Helm chart for the standalone version of Pulsar (all-in-one pod)
Thank you for your understanding.
Best regards,