Open codelipenghui opened 5 years ago
Same issue I'm facing:
2019-07-30 18:24:11.813 INFO 20248 --- [r-client-io-1-1] o.a.p.c.impl.ConsumerStatsRecorderImpl : Starting Pulsar consumer perf with config: { "topicNames" : [ "device-twin-topic" ], "topicsPattern" : null, "subscriptionName" : "device-twin-subscription", "subscriptionType" : "Shared", "receiverQueueSize" : 1000, "acknowledgementsGroupTimeMicros" : 100000, "negativeAckRedeliveryDelayMicros" : 60000000, "maxTotalReceiverQueueSizeAcrossPartitions" : 50000, "consumerName" : null, "ackTimeoutMillis" : 0, "tickDurationMillis" : 1000, "priorityLevel" : 0, "cryptoFailureAction" : "FAIL", "properties" : { }, "readCompacted" : false, "subscriptionInitialPosition" : "Latest", "patternAutoDiscoveryPeriod" : 1, "regexSubscriptionMode" : "PersistentOnly", "deadLetterPolicy" : null, "autoUpdatePartitions" : true, "replicateSubscriptionState" : false, "resetIncludeHead" : false } 2019-07-30 18:24:11.818 INFO 20248 --- [r-client-io-1-1] o.a.p.c.impl.ConsumerStatsRecorderImpl : Pulsar client config: { "serviceUrl" : "http://localhost:8087", "authPluginClassName" : null, "authParams" : null, "operationTimeoutMs" : 30000, "statsIntervalSeconds" : 60, "numIoThreads" : 1, "numListenerThreads" : 1, "connectionsPerBroker" : 1, "useTcpNoDelay" : true, "useTls" : false, "tlsTrustCertsFilePath" : "", "tlsAllowInsecureConnection" : false, "tlsHostnameVerificationEnable" : false, "concurrentLookupRequest" : 5000, "maxLookupRequest" : 50000, "maxNumberOfRejectedRequestPerConnection" : 50, "keepAliveIntervalSeconds" : 30, "connectionTimeoutMs" : 10000, "requestTimeoutMs" : 60000, "defaultBackoffIntervalNanos" : 100000000, "maxBackoffIntervalNanos" : 30000000000 } 2019-07-30 18:24:13.018 WARN 20248 --- [r-client-io-1-1] o.a.pulsar.client.impl.ConnectionPool : Failed to open connection to 20b59f0ed6eb:6650 : java.net.UnknownHostException: failed to resolve '20b59f0ed6eb' after 7 queries 2019-07-30 18:24:13.021 WARN 20248 --- [r-client-io-1-1] o.a.p.client.impl.ConnectionHandler : [device-twin-topic] [device-twin-subscription] Error connecting to broker: org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: java.net.UnknownHostException: failed to resolve '20b59f0ed6eb' after 7 queries 2019-07-30 18:24:13.021 WARN 20248 --- [r-client-io-1-1] o.a.p.client.impl.ConnectionHandler : [device-twin-topic] [device-twin-subscription] Could not get connection to broker: org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: java.net.UnknownHostException: failed to resolve '20b59f0ed6eb' after 7 queries -- Will try again in 0.1 s 2019-07-30 18:24:13.122 INFO 20248 --- [ulsar-timer-6-1] o.a.p.client.impl.ConnectionHandler : [device-twin-topic] [device-twin-subscription] Reconnecting after connection was closed 2019-07-30 18:24:14.266 WARN 20248 --- [r-client-io-1-1] o.a.pulsar.client.impl.ConnectionPool : Failed to open connection to 20b59f0ed6eb:6650 : java.net.UnknownHostException: failed to resolve '20b59f0ed6eb' after 7 queries 2019-07-30 18:24:14.266 WARN 20248 --- [r-client-io-1-1] o.a.p.client.impl.ConnectionHandler : [device-twin-topic] [device-twin-subscription] Error connecting to broker: org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: java.net.UnknownHostException: failed to resolve '20b59f0ed6eb' after 7 queries 2019-07-30 18:24:14.266 WARN 20248 --- [r-client-io-1-1] o.a.p.client.impl.ConnectionHandler : [device-twin-topic] [device-twin-subscription] Could not get connection to broker: org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: java.net.UnknownHostException: failed to resolve '20b59f0ed6eb' after 7 queries -- Will try again in 0.186 s 2019-07-30 18:24:14.453 INFO 20248 --- [ulsar-timer-6-1] o.a.p.client.impl.ConnectionHandler : [device-twin-topic] [device-twin-subscription] Reconnecting after connection was closed 2019-07-30 18:24:15.637 WARN 20248 --- [r-client-io-1-1] o.a.pulsar.client.impl.ConnectionPool : Failed to open connection to 20b59f0ed6eb:6650 : java.net.UnknownHostException: failed to resolve '20b59f0ed6eb' after 7 queries 2019-07-30 18:24:15.637 WARN 20248 --- [r-client-io-1-1] o.a.p.client.impl.ConnectionHandler : [device-twin-topic] [device-twin-subscription] Error connecting to broker: org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: java.net.UnknownHostException: failed to resolve '20b59f0ed6eb' after 7 queries 2019-07-30 18:24:15.637 WARN 20248 --- [r-client-io-1-1] o.a.p.client.impl.ConnectionHandler : [device-twin-topic] [device-twin-subscription] Could not get connection to broker: org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: java.net.UnknownHostException: failed to resolve '20b59f0ed6eb' after 7 queries -- Will try again in 0.4 s 2019-07-30 18:24:16.037 INFO 20248 --- [ulsar-timer-6-1] o.a.p.client.impl.ConnectionHandler : [device-twin-topic] [device-twin-subscription] Reconnecting after connection was closed 2019-07-30 18:24:17.276 WARN 20248 --- [r-client-io-1-1] o.a.pulsar.client.impl.ConnectionPool : Failed to open connection to 20b59f0ed6eb:6650 : java.net.UnknownHostException: failed to resolve '20b59f0ed6eb' after 7 queries 2019-07-30 18:24:17.276 WARN 20248 --- [r-client-io-1-1] o.a.p.client.impl.ConnectionHandler : [device-twin-topic] [device-twin-subscription] Error connecting to broker: org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: java.net.UnknownHostException: failed to resolve '20b59f0ed6eb' after 7 queries 2019-07-30 18:24:17.276 WARN 20248 --- [r-client-io-1-1] o.a.p.client.impl.ConnectionHandler : [device-twin-topic] [device-twin-subscription] Could not get connection to broker: org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: java.net.UnknownHostException: failed to resolve '20b59f0ed6eb' after 7 queries -- Will try again in 0.76 s 2019-07-30 18:24:18.037 INFO 20248 --- [ulsar-timer-6-1] o.a.p.client.impl.ConnectionHandler : [device-twin-topic] [device-twin-subscription] Reconnecting after connection was closed 2019-07-30 18:24:19.224 WARN 20248 --- [r-client-io-1-1] o.a.pulsar.client.impl.ConnectionPool : Failed to open connection to 20b59f0ed6eb:6650 : java.net.UnknownHostException: failed to resolve '20b59f0ed6eb' after 7 queries
i am having a same problem- I am Just trying to start pulsar using bin/pulsar standalone on mac book, It throws up unknownhostexception for my mac host- any fix for this is appreciated..
I have the same problem. I have a pulsar cluster with 3 brokers, no DNS and no proxy. My producer is using multi-hosts service url to connect to the cluster, one broker is down and it doesn't try to connect to the other 2 brokers that are live. When will it be fixed?
I would like to contribute to this issue.
Thanks for @kaynewu for working on this issue
Here is a possible fix https://github.com/apache/pulsar/pull/18838.
Since our tests depend heavily on the unresolved logic, I write a best effort solution so that prioritize the reachable hosts in candidates.
Hi @tisonkun : can you please specify in which version of Pulsar this fix is avilable ? I dont see that in release notes , thanks
@batilak The PR isn't merged so there is no fixed version available yet. You may test it out and see if we can nudge it forward.
Describe the bug
Use "pulsar://host1:6650,host2:6650,127.0.0.1:6650" as service url to create a pulsar client, "host1" and "host2" is the wrong hosts, not every time I can successfully connect to "127.0.0.1:6650".
To Reproduce
Sometimes will get "java.net.UnknownHostException" and sometimes will connect success. Here is the stack trace while create producer failed:
Expected behavior
Pulsar client should try to connect to each hosts, only all the hosts can't connect successfully return the error message to users.