kwenZh opened a new issue #14707:
URL: https://github.com/apache/pulsar/issues/14707


   **Describe the bug**
   
   i am deploying a Pulsar cluster in k8s and want other clients which are not 
in the same k8s cluster with the Pulsar cluster can connect to the Pulsar 
cluster,   i want to configurations broker service nodePort in 
`advertisedListeners` to implement 。and client use broke service nodePort, but 
it  accidental seems error:  12:10:37.036 [pulsar-io-4-3] WARN 
org.apache.pulsar.broker.namespace.NamespaceService - Unable to find 
OwnedBundle for topic - ,   Namespace is being unloaded, 
   
   such as i want to use   following config --listener-name external to access
   
   pulsar version: 2.8.1
   
   broker statefulset replices count: 3
   
   broker service info:
   ```
   pulsar-cluster-broker LoadBalancer x.x.x.x <pending> 
8080:32696/TCP,6650:31024/TCP 22h
   ```
   
   config `advertisedListeners` in broker.conf 
   
   ```
   advertisedListeners: 
"internal:pulsar://pulsar-cluster-broker-0.pulsar-cluster-broker.pulsar.svc.cluster.local:6650,external:pulsar://k8s-vip:31024"
   ```
     
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. Go to     'configurations  broker.conf‘s advertisedListeners, add broker 
service nodePort'
   2. Click on '....  other clients which are not in the same k8s cluster with 
the Pulsar cluster , to access external listener-name , 
   command is 
   ```
   bin/pulsar-client --listener-name external --url pulsar://k8s-vip:31024 
consume persistent://public/default/test-zyk-1 -n 0 -s "zyk-sub"
   ```
   3. . Scroll down to '....'
   4. See error:
   
   There are occasional errors when using the client
   
   client error:
   ```
   09:47:59.110 [pulsar-client-io-1-1] WARN 
org.apache.pulsar.client.impl.ClientCnx - [id: 0x0c64a320, L:/x.x.x.x:33112 - 
R:k8s-vip/k8s-vip:31024] Received error from server: Namespace is being 
unloaded, cannot add topic persistent://public/default/test-zyk-1-partition-0
   09:47:59.110 [pulsar-client-io-1-1] WARN 
org.apache.pulsar.client.impl.ConsumerImpl - 
[persistent://public/default/test-zyk-1-partition-0][zyk-sub] Failed to 
subscribe to topic on k8s-vip/k8s-vip:31024
   09:47:59.110 [pulsar-client-io-1-1] WARN 
org.apache.pulsar.client.impl.ConnectionHandler - 
[persistent://public/default/test-zyk-1-partition-0] [zyk-sub] Could not get 
connection to broker: Namespace is being unloaded, cannot add topic 
persistent://public/default/test-zyk-1-partition-0 -- Will try again in 11.667 s
   09:47:59.435 [pulsar-timer-5-1] INFO 
org.apache.pulsar.client.impl.ConnectionHandler - 
[persistent://public/default/test-zyk-1-partition-2] [zyk-sub] Reconnecting 
after connection was closed
   ```
   
   broker error: broker-0
   ```
   12:10:37.036 [pulsar-io-4-3] WARN 
org.apache.pulsar.broker.namespace.NamespaceService - Unable to find 
OwnedBundle for topic - [persistent://public/default/test-zyk-1-partition-1]
   12:10:37.036 [pulsar-io-4-3] WARN 
org.apache.pulsar.broker.service.BrokerService - Namespace is being unloaded, 
cannot add topic persistent://public/default/test-zyk-1-partition-1
   12:10:37.036 [pulsar-io-4-3] WARN org.apache.pulsar.broker.service.ServerCnx 
- [/x.x.x.x:50478][persistent://public/default/test-zyk-1-partition-1][zyk-sub] 
Failed to create consumer: consumerId=1, Namespace is being unloaded, cannot 
add topic persistent://public/default/test-zyk-1-partition-1
   ```
   
   sometims normaly broker log info, broker-2
   ```
   12:12:39.101 [pulsar-io-4-3] INFO org.apache.pulsar.broker.service.ServerCnx 
- [/x.x.81.52:38242] Subscribing on topic 
persistent://public/default/test-zyk-1-partition-2 / zyk-sub
   12:12:39.102 [pulsar-io-4-3] INFO 
org.apache.bookkeeper.mledger.impl.ManagedCursorImpl - 
[public/default/persistent/test-zyk-1-partition-2-zyk-sub] Rewind from 168:15 
to 168:15
   12:12:39.102 [pulsar-io-4-3] INFO 
org.apache.pulsar.broker.service.persistent.PersistentTopic - 
[persistent://public/default/test-zyk-1-partition-2] There are no replicated 
subscriptions on the topic
   12:12:39.102 [pulsar-io-4-3] INFO 
org.apache.pulsar.broker.service.persistent.PersistentTopic - 
[persistent://public/default/test-zyk-1-partition-2][zyk-sub] Created new 
subscription for 2
   12:12:39.102 [pulsar-io-4-3] INFO org.apache.pulsar.broker.service.ServerCnx 
- [/x.x.81.52:38242] Created subscription on topic 
persistent://public/default/test-zyk-1-partition-2 / zyk-sub
   12:12:39.105 [pulsar-io-4-3] INFO org.apache.pulsar.broker.service.ServerCnx 
- [/x.x.81.52:38242] Subscribing on topic 
persistent://public/default/test-zyk-1-partition-1 / zyk-sub
   12:12:39.105 [pulsar-io-4-3] INFO 
org.apache.bookkeeper.mledger.impl.ManagedCursorImpl - 
[public/default/persistent/test-zyk-1-partition-1-zyk-sub] Rewind from 170:12 
to 170:12
   12:12:39.105 [pulsar-io-4-3] INFO 
org.apache.pulsar.broker.service.persistent.PersistentTopic - 
[persistent://public/default/test-zyk-1-partition-1] There are no replicated 
subscriptions on the topic
   12:12:39.106 [pulsar-io-4-3] INFO 
org.apache.pulsar.broker.service.persistent.PersistentTopic - 
[persistent://public/default/test-zyk-1-partition-1][zyk-sub] Created new 
subscription for 1
   12:12:39.106 [pulsar-io-4-3] INFO org.apache.pulsar.broker.service.ServerCnx 
- [/x.x.81.52:38242] Created subscription on topic 
persistent://public/default/test-zyk-1-partition-1 / zyk-sub
   12:12:39.106 [pulsar-io-4-3] INFO org.apache.pulsar.broker.service.ServerCnx 
- [/x.x.81.52:38242] Subscribing on topic 
persistent://public/default/test-zyk-1-partition-0 / zyk-sub
   12:12:39.106 [pulsar-io-4-3] INFO 
org.apache.bookkeeper.mledger.impl.ManagedCursorImpl - 
[public/default/persistent/test-zyk-1-partition-0-zyk-sub] Rewind from 169:13 
to 169:13
   12:12:39.108 [pulsar-io-4-3] INFO 
org.apache.pulsar.broker.service.persistent.PersistentTopic - 
[persistent://public/default/test-zyk-1-partition-0] There are no replicated 
subscriptions on the topic
   12:12:39.108 [pulsar-io-4-3] INFO 
org.apache.pulsar.broker.service.persistent.PersistentTopic - 
[persistent://public/default/test-zyk-1-partition-0][zyk-sub] Created new 
subscription for 0
   12:12:39.108 [pulsar-io-4-3] INFO org.apache.pulsar.broker.service.ServerCnx 
- [/x.x.81.52:38242] Created subscription on topic 
persistent://public/default/test-zyk-1-partition-0 / zyk-sub
   12:13:20.724 [pulsar-io-4-3] INFO 
org.apache.pulsar.broker.service.AbstractDispatcherSingleActiveConsumer - 
Removing consumer 
Consumer{subscription=PersistentSubscription{topic=persistent://public/default/test-zyk-1-partition-0,
 name=zyk-sub}, consumerId=0, consumerName=126dc, address=/x.x.81.52:38242}
   12:13:20.724 [pulsar-io-4-3] INFO 
org.apache.pulsar.broker.service.AbstractDispatcherSingleActiveConsumer - 
Removing consumer 
Consumer{subscription=PersistentSubscription{topic=persistent://public/default/test-zyk-1-partition-2,
 name=zyk-sub}, consumerId=2, consumerName=126dc, address=/x.x.81.52:38242}
   12:13:20.724 [pulsar-io-4-3] INFO 
org.apache.pulsar.broker.service.AbstractDispatcherSingleActiveConsumer - 
Removing consumer 
Consumer{subscription=PersistentSubscription{topic=persistent://public/default/test-zyk-1-partition-1,
 name=zyk-sub}, consumerId=1, consumerName=126dc, address=/x.x.81.52:38242}
   ```
   
   i think it is broker service in k8s , choice  one of broker cluster, and 
topic do not below with bundle in this broker pod  ?
   
   
   
   
   **Expected behavior**
   A
   **Screenshots**
   If applicable, add screenshots to help explain your problem.
   
   
   **Desktop (please complete the following information):**
    - OS: centos
    - pulsar version: 2.8.1
   
   **Additional context**
   
   other clients which are not in the same k8s cluster with the Pulsar cluster 
, access by pulsar-proxy’s nodePort is normally


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to