2019-10-24 09:29:53 UTC - Pedro Cardoso: @Pedro Cardoso has joined the channel ---- 2019-10-24 09:33:32 UTC - Pedro Cardoso: Hello, I have a question about pulsar functions. I've deployed a Pulsar cluster locally in my laptop using minikube. What is the practical difference in deploying a function in local-mode vs cluster mode with this setup? ---- 2019-10-24 10:02:13 UTC - Pedro Cardoso: Is it possible to upload a java-based pulsar function directly from a laptop to a pulsar cluster? ---- 2019-10-24 10:04:46 UTC - Ali Ahmed: is your function is running inside minikube ? ---- 2019-10-24 10:04:57 UTC - Pedro Cardoso: I want it to, yes ---- 2019-10-24 10:06:05 UTC - Ali Ahmed: you just submit your jar with a config to the pulsar server it will then tun it for you ---- 2019-10-24 10:10:01 UTC - Pedro Cardoso: I've created a basic maven project with the message exclamation code example and when submitting the function to pulsar I get the following: ``` ▶ kubectl exec $(kubectl get pods -n pulsar -o custom-columns=:metadata.name | grep proxy) -n pulsar -it -- bin/pulsar-admin functions create \ --jar target/pulsar-function-1.0-SNAPSHOT.jar \ --classname org.apache.pulsar.functions.api.examples.ExclamationFunction \ --inputs <persistent://public/default/exclamation-input> \ --output <persistent://public/default/exclamation-output> \ --name exclamation The specified jar file does not exist ``` ---- 2019-10-24 10:11:33 UTC - Ali Ahmed: why you running the command inside k8 ? ---- 2019-10-24 10:13:12 UTC - Pedro Cardoso: So that I can directly use the pulsar-admin utility, I was following <https://pulsar.apache.org/docs/en/deploy-kubernetes/#set-up-properties-and-namespaces> just did not create the alias. ---- 2019-10-24 10:13:28 UTC - Pedro Cardoso: In particular: `$ alias pulsar-admin='kubectl exec pulsar-admin -it -- bin/pulsar-admin'` ---- 2019-10-24 10:14:14 UTC - Ali Ahmed: did you copy the jar in the k8 pod ```target/pulsar-function-1.0-SNAPSHOT.jar``` ? ---- 2019-10-24 10:15:08 UTC - Pedro Cardoso: I did not, hence my question of whether it was possible to upload the jar to a pulse cluster directly ---- 2019-10-24 10:15:47 UTC - Nicolas Ha: I now see some brokers failing with ``` 10:15:13.579 [main] ERROR org.apache.pulsar.PulsarBrokerStarter - Failed to start pulsar service. org.apache.pulsar.broker.PulsarServerException: org.apache.pulsar.broker.PulsarServerException: org.apache.pulsar.broker.PulsarServerException: Broker-znode owned by different zk-session 144115531814340778 at org.apache.pulsar.broker.PulsarService.start(PulsarService.java:467) ~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0] at org.apache.pulsar.PulsarBrokerStarter$BrokerStarter.start(PulsarBrokerStarter.java:273) ~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0] at org.apache.pulsar.PulsarBrokerStarter.main(PulsarBrokerStarter.java:332) [org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0] Caused by: org.apache.pulsar.broker.PulsarServerException: org.apache.pulsar.broker.PulsarServerException: Broker-znode owned by different zk-session 144115531814340778 at org.apache.pulsar.broker.loadbalance.impl.ModularLoadManagerImpl.start(ModularLoadManagerImpl.java:816) ~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0] at org.apache.pulsar.broker.loadbalance.impl.ModularLoadManagerWrapper.start(ModularLoadManagerWrapper.java:110) ~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0] at org.apache.pulsar.broker.PulsarService.startLoadManagementService(PulsarService.java:589) ~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0] at org.apache.pulsar.broker.PulsarService.start(PulsarService.java:447) ~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0] ... 2 more Caused by: org.apache.pulsar.broker.PulsarServerException: Broker-znode owned by different zk-session 144115531814340778 at org.apache.pulsar.broker.loadbalance.impl.ModularLoadManagerImpl.start(ModularLoadManagerImpl.java:800) ~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0] at org.apache.pulsar.broker.loadbalance.impl.ModularLoadManagerWrapper.start(ModularLoadManagerWrapper.java:110) ~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0] at org.apache.pulsar.broker.PulsarService.startLoadManagementService(PulsarService.java:589) ~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0] at org.apache.pulsar.broker.PulsarService.start(PulsarService.java:447) ~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0] ... 2 more ``` ---- 2019-10-24 10:15:55 UTC - Ali Ahmed: you can the pulsar admin cli from your local machine and just submit to the cluster ---- 2019-10-24 10:17:22 UTC - Pedro Cardoso: So I need to have that installed in my laptop? Do I have to install the whole pulsar codebase to get access to it or is there a lighter standalone version? ---- 2019-10-24 10:17:59 UTC - Nicolas Ha: If I get a ```10:16:13.653 [bookkeeper-io-14-1] ERROR org.apache.bookkeeper.proto.PerChannelBookieClient - Could not connect to bookie: [id: 0x2bb51b78, L:/10.244.2.140:34150]/10.131.40.250:3181, current state CONNECTING :``` And later a ``` 10:16:13.669 [main] ERROR org.apache.pulsar.PulsarBrokerStarter - Failed to start pulsar service. org.apache.pulsar.broker.PulsarServerException: java.lang.RuntimeException: org.apache.pulsar.client.api.PulsarClientException$BrokerPersistenceException: org.apache.bookkeeper.mledger.ManagedLedgerException: Error while recovering ledger ``` Then it means the broker is fine but it can’t connect to the bookies right? ---- 2019-10-24 10:18:30 UTC - Ali Ahmed: it’s a single package so you can download the tar and just run the cli with the correct server url ---- 2019-10-24 10:19:49 UTC - Pedro Cardoso: <https://mvnrepository.com/artifact/org.apache.pulsar/pulsar-client-admin> ? ---- 2019-10-24 10:20:12 UTC - Ali Ahmed: that won’t work ---- 2019-10-24 10:20:35 UTC - Ali Ahmed: it doesn’t have the shell scripts and other jars ---- 2019-10-24 10:25:16 UTC - Pedro Cardoso: Just to make sure you mean downloading `$ wget <https://archive.apache.org/dist/pulsar/pulsar-2.4.1/apache-pulsar-2.4.1-bin.tar.gz>` and simply using whats inside the bin folder to communicate with the minikube cluster? ---- 2019-10-24 10:26:26 UTC - Ali Ahmed: yes ---- 2019-10-24 10:26:54 UTC - Pedro Cardoso: I will try it that way then. Thank you very much for your help! ---- 2019-10-24 10:53:24 UTC - Nicolas Ha: Right so I see lots of these in the bookies ``` 10:44:31.664 [bookkeeper-io-16-2] ERROR org.apache.bookkeeper.proto.PerChannelBookieClient - Could not connect to bookie: [id: 0x7aa942b8, L:/10.244.2.217:33830]/10.131.40.250:3181, current state CONNECTING : io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: No route to host: /10.131.40.250:3181 at io.netty.channel.unix.Errors.throwConnectException(Errors.java:112) ~[io.netty-netty-all-4.1.32.Final.jar:4.1.32.Final] at io.netty.channel.unix.Socket.finishConnect(Socket.java:269) ~[io.netty-netty-all-4.1.32.Final.jar:4.1.32.Final] at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:665) [io.netty-netty-all-4.1.32.Final.jar:4.1.32.Final] at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:642) [io.netty-netty-all-4.1.32.Final.jar:4.1.32.Final] at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:522) [io.netty-netty-all-4.1.32.Final.jar:4.1.32.Final] at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:423) [io.netty-netty-all-4.1.32.Final.jar:4.1.32.Final] ``` I guess this means bookies can’t connect between them? I checked though and all nodes are reachable, but `/10.131.40.250` is not something in my cluster as far as I can tell ---- 2019-10-24 11:30:49 UTC - Sijie Guo: is 10.131.40.250 a node ip? ---- 2019-10-24 11:30:53 UTC - Sijie Guo: not a pod ip ---- 2019-10-24 11:42:13 UTC - Nicolas Ha: not a current node ip (ie. not shown anywhere in `kubectl get nodes -o wide`). But maybe it was the IP if a destoyed node (?) could it be possible? ---- 2019-10-24 12:03:59 UTC - Sijie Guo: you destroyed nodes before? ---- 2019-10-24 12:07:56 UTC - Nicolas Ha: yes - <https://apache-pulsar.slack.com/archives/C5Z4T36F7/p1571832092040800?thread_ts=1571784418.028500&cid=C5Z4T36F7> ---- 2019-10-24 13:26:39 UTC - n4j: @n4j has joined the channel ---- 2019-10-24 13:40:50 UTC - Wesley: @Wesley has joined the channel ---- 2019-10-24 13:49:28 UTC - Kendall Magesh-Davis: bump ---- 2019-10-24 16:38:30 UTC - Kendall Magesh-Davis: I think I figured out what was wrong. I had updated the broker to a new secret&token but the proxy was still configured with one from a previous test. Redeploying to see if I’ve solved the problem I made for myself. ---- 2019-10-24 18:05:09 UTC - Ashwin Kapur: I have a question regarding using JSON Schemas. If I use the Java API, I can encode a POD class as JSON and send it and I can also receive it. However, what if I want to send messages using the Java API and read them using the Python API. Is there a description somewhere of how the class is encoded so a Python client can decode it? ---- 2019-10-24 18:06:38 UTC - Ashwin Kapur: There seems to be a long time Stack Overflow question that asks the same thing with no responses. <https://stackoverflow.com/questions/58523566/publishing-to-topic-with-registered-schema-in-apache-pulsar> ---- 2019-10-24 18:43:09 UTC - Matteo Merli: The question was asked yesterday :slightly_smiling_face:
You can pass the schema in Python as described in <https://pulsar.apache.org/docs/en/client-libraries-python/#declaring-and-validating-schema> +1 : David Kjerrumgaard, Nicolas Ha ---- 2019-10-24 20:28:48 UTC - Anand Sinha: Hi @Matteo Merli, would you have any view points on these; or any other alternate suggestions for the original problem? Do note that the number of topics (and hence, subscriptions) would be very large in number. ---- 2019-10-24 23:41:29 UTC - Nicolas Ha: alright I was keeping the cluster in case there was something to debug but it looks like there is nothing to do here - will destroy it later today ---- 2019-10-25 02:04:01 UTC - Kendall Magesh-Davis: Welp. Ended up guessing and being right, no thanks to error messages. The base64 encoded secret key I was copying to a file was getting a carriage return character at the end, invalidating it. TL;DR fixed it with `cat /opt/my-secret.key | tr -d \\n >> /opt/fixed.key` ---- 2019-10-25 02:04:52 UTC - Kendall Magesh-Davis: I’m sure there’s a more elegant solution, but I got it working so :shrug: ---- 2019-10-25 08:55:49 UTC - Viji: @Viji has joined the channel ----
