You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/12/13 03:07:47 UTC

[GitHub] [pulsar] liguangcheng opened a new issue, #18899: [Bug] broker cannot connect the bookie when bookieId set hostname

liguangcheng opened a new issue, #18899:
URL: https://github.com/apache/pulsar/issues/18899

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
   
   
   ### Version
   
   2.10.2
   
   ### Minimal reproduce step
   
   With zookeeper deployed, bookieId is set to hostname, and the broker cannot connect to bookie
   
   ===============================================================
   My preliminary analysis is that in the scenario of Zookeeper deployment, the broker should need to use zk to get the IP of Bookie
   
   In the following function, DNS is directly applied to resolve IP, and there is no support for zk
   ```
   public BookieSocketAddress(String addr) throws UnknownHostException {
           String[] parts = addr.split(COLON);
           if (parts.length < 2) {
               throw new UnknownHostException(addr);
           }
           this.hostname = parts[0];
   
           try {
               this.port = Integer.parseInt(parts[1]);
           } catch (NumberFormatException nfe) {
               throw new UnknownHostException(addr);
           }
   
           if (InetAddresses.isInetAddress(hostname)) {
               socketAddress = Optional.of(new InetSocketAddress(hostname, port));
           } else {
               socketAddress = Optional.empty();
           }
   }
   ```
   
   ### What did you expect to see?
   
   broker should connect the bookie when bookieId set with hostname
   
   ### What did you see instead?
   
   N/A
   
   ### Anything else?
   
   N/A
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


-- 
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: commits-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] github-actions[bot] commented on issue #18899: [Bug] broker cannot connect the bookie when bookieId set hostname

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #18899:
URL: https://github.com/apache/pulsar/issues/18899#issuecomment-1416900626

   The issue had no activity for 30 days, mark with Stale label.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] yangl commented on issue #18899: [Bug] broker cannot connect the bookie when bookieId set hostname

Posted by GitBox <gi...@apache.org>.
yangl commented on issue #18899:
URL: https://github.com/apache/pulsar/issues/18899#issuecomment-1347861328

   add the  `ip  hostname` config to the  /etc/hosts file 


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] pisceslj commented on issue #18899: [Bug] broker cannot connect the bookie when bookieId set hostname

Posted by GitBox <gi...@apache.org>.
pisceslj commented on issue #18899:
URL: https://github.com/apache/pulsar/issues/18899#issuecomment-1372116084

   The same problem when bookieId set with hostname,zookeeper deployed,k8s environment,  version 2.10.2 
   
   ====================================================================================
   The error log: 
   
   `[pulsar-registration-client-28-1] ERROR org.apache.bookkeeper.client.TopologyAwareEnsemblePlacementPolicy - Cannot resolve bookieId pulsar-k8s-cluster-bookie-2 to a network address, resolving as /default-region/default-rack
   org.apache.bookkeeper.proto.BookieAddressResolver$BookieIdNotResolvedException: Cannot resolve bookieId pulsar-k8s-cluster-bookie-2, bookie does not exist or it is not running
   	at org.apache.bookkeeper.client.DefaultBookieAddressResolver.resolve(DefaultBookieAddressResolver.java:68) ~[org.apache.bookkeeper-bookkeeper-server-4.14.5.jar:4.14.5]
   	at org.apache.bookkeeper.client.TopologyAwareEnsemblePlacementPolicy.resolveNetworkLocation(TopologyAwareEnsemblePlacementPolicy.java:804) ~[org.apache.bookkeeper-bookkeeper-server-4.14.5.jar:4.14.5]
   	at org.apache.bookkeeper.client.TopologyAwareEnsemblePlacementPolicy.createBookieNode(TopologyAwareEnsemblePlacementPolicy.java:794) ~[org.apache.bookkeeper-bookkeeper-server-4.14.5.jar:4.14.5]
   	at org.apache.bookkeeper.client.TopologyAwareEnsemblePlacementPolicy.handleBookiesThatJoined(TopologyAwareEnsemblePlacementPolicy.java:718) ~[org.apache.bookkeeper-bookkeeper-server-4.14.5.jar:4.14.5]
   	at org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl.handleBookiesThatJoined(RackawareEnsemblePlacementPolicyImpl.java:80) ~[org.apache.bookkeeper-bookkeeper-server-4.14.5.jar:4.14.5]
   	at org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicy.handleBookiesThatJoined(RackawareEnsemblePlacementPolicy.java:249) ~[org.apache.bookkeeper-bookkeeper-server-4.14.5.jar:4.14.5]
   	at org.apache.bookkeeper.client.TopologyAwareEnsemblePlacementPolicy.onClusterChanged(TopologyAwareEnsemblePlacementPolicy.java:665) ~[org.apache.bookkeeper-bookkeeper-server-4.14.5.jar:4.14.5]
   	at org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl.onClusterChanged(RackawareEnsemblePlacementPolicyImpl.java:80) ~[org.apache.bookkeeper-bookkeeper-server-4.14.5.jar:4.14.5]
   	at org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicy.onClusterChanged(RackawareEnsemblePlacementPolicy.java:92) ~[org.apache.bookkeeper-bookkeeper-server-4.14.5.jar:4.14.5]
   	at org.apache.bookkeeper.client.BookieWatcherImpl.processWritableBookiesChanged(BookieWatcherImpl.java:197) ~[org.apache.bookkeeper-bookkeeper-server-4.14.5.jar:4.14.5]
   	at org.apache.bookkeeper.client.BookieWatcherImpl.lambda$initialBlockingBookieRead$1(BookieWatcherImpl.java:233) ~[org.apache.bookkeeper-bookkeeper-server-4.14.5.jar:4.14.5]
   	at org.apache.pulsar.metadata.bookkeeper.PulsarRegistrationClient.lambda$null$5(PulsarRegistrationClient.java:139) ~[org.apache.pulsar-pulsar-metadata-2.10.2.jar:2.10.2]
   	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
   	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
   	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
   	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[io.netty-netty-common-4.1.77.Final.jar:4.1.77.Final]
   	at java.lang.Thread.run(Thread.java:829) ~[?:?]
   Caused by: java.net.UnknownHostException: pulsar-k8s-cluster-bookie-2
   	at org.apache.bookkeeper.net.BookieSocketAddress.<init>(BookieSocketAddress.java:68) ~[org.apache.bookkeeper-bookkeeper-server-4.14.5.jar:4.14.5]
   	at org.apache.bookkeeper.discover.BookieServiceInfoUtils.buildLegacyBookieServiceInfo(BookieServiceInfoUtils.java:40) ~[org.apache.bookkeeper-bookkeeper-server-4.14.5.jar:4.14.5]
   	at org.apache.bookkeeper.discover.RegistrationClient.getBookieServiceInfo(RegistrationClient.java:84) ~[org.apache.bookkeeper-bookkeeper-server-4.14.5.jar:4.14.5]
   	at org.apache.bookkeeper.client.DefaultBookieAddressResolver.resolve(DefaultBookieAddressResolver.java:43) ~[org.apache.bookkeeper-bookkeeper-server-4.14.5.jar:4.14.5]
   	... 18 more`
   
   ====================================================================================
   
   it's not convenient and flexible to add the "ip hostname" config to the /etc/hosts file in k8s environment.  The pod's ip maybe   change. 
   
   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] liguangcheng commented on issue #18899: [Bug] broker cannot connect the bookie when bookieId set hostname

Posted by GitBox <gi...@apache.org>.
liguangcheng commented on issue #18899:
URL: https://github.com/apache/pulsar/issues/18899#issuecomment-1347873275

   > add the `ip hostname` config to the /etc/hosts file
   
   yes, this works, I have already tested
   
   But I think that in the deployment mode of zk, the ip should not be obtained through DNS resolve, but should be obtained through zk, this is old feature but missing in the 2.10.2


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org