question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Advertised broker address

See original GitHub issue

Expected behavior

Connecting through the discovery to the broker in the cluster setup should redirect to the public address of the broker. Preferably there should be an option to set an advertised hostname, this should come together with an option to set a bind host for the broker (however, this might not be necessary).

Actual behavior

Broker advertises the hostname as the address for the client to connect to. On EC2, it results in the client trying to connect to something like ip-xx-xxx-xxx-xxx which is not resolvable from outside of the same region. The error I see on my local machine while trying to publish messages to Pulsar is the following:

2016-09-19 17:45:38,592 - ERROR - [main:CmdProduce@186] - java.net.UnknownHostException: ip-10-239-182-4: unknown error
com.yahoo.pulsar.client.api.PulsarClientException: java.net.UnknownHostException: ip-10-239-182-4: unknown error
    at com.yahoo.pulsar.client.impl.HttpClient$1.onThrowable(HttpClient.java:139)
    at com.ning.http.client.providers.netty.future.NettyResponseFuture.abort(NettyResponseFuture.java:238)
    at com.ning.http.client.providers.netty.request.NettyRequestSender.abort(NettyRequestSender.java:422)
    at com.ning.http.client.providers.netty.request.NettyRequestSender.sendRequestWithNewChannel(NettyRequestSender.java:290)
    at com.ning.http.client.providers.netty.request.NettyRequestSender.sendRequestWithCertainForceConnect(NettyRequestSender.java:142)
    at com.ning.http.client.providers.netty.request.NettyRequestSender.sendRequest(NettyRequestSender.java:117)
    at com.ning.http.client.providers.netty.request.NettyRequestSender.sendNextRequest(NettyRequestSender.java:493)
    at com.ning.http.client.providers.netty.handler.Protocol.exitAfterHandlingRedirect(Protocol.java:189)
    at com.ning.http.client.providers.netty.handler.HttpProtocol.handleHttpResponse(HttpProtocol.java:427)
    at com.ning.http.client.providers.netty.handler.HttpProtocol.handle(HttpProtocol.java:470)
    at com.ning.http.client.providers.netty.handler.Processor.messageReceived(Processor.java:88)
    at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
    at org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream(ChunkedWriteHandler.java:142)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
    at org.jboss.netty.handler.codec.http.HttpContentDecoder.messageReceived(HttpContentDecoder.java:108)
    at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
    at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:459)
    at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:536)
    at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:435)
    at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
    at org.jboss.netty.handler.codec.http.HttpClientCodec.handleUpstream(HttpClientCodec.java:92)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
    at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
    at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
    at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
    at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
    at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.UnknownHostException: ip-10-239-182-4: unknown error
    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
    at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
    at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
    at java.net.InetAddress.getAllByName(InetAddress.java:1192)
    at java.net.InetAddress.getAllByName(InetAddress.java:1126)
    at java.net.InetAddress.getByName(InetAddress.java:1076)
    at com.ning.http.client.NameResolver$JdkNameResolver.resolve(NameResolver.java:28)
    at com.ning.http.client.providers.netty.request.NettyRequestSender.remoteAddress(NettyRequestSender.java:358)
    at com.ning.http.client.providers.netty.request.NettyRequestSender.connect(NettyRequestSender.java:369)
    at com.ning.http.client.providers.netty.request.NettyRequestSender.sendRequestWithNewChannel(NettyRequestSender.java:283)
    ... 37 more

I could set the hostname on the machine to a public IP address / public hostname but it is an ugly workaround. I do not have any DNS other than EC2 defaults available right now.

Steps to reproduce

Launch the cluster setup in EC2 (without any DNS other than EC2 defaults) and try producing messages.

System configuration

Pulsar version: 1.14

If the suggestions sound okay, I can prepare a PR.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
merlimatcommented, Sep 19, 2016

Yes, having both gives the most flexibility, and please go ahead in removing bindOnLocalhost.

0reactions
radekgcommented, Sep 20, 2016

@merlimat Please see attached PR. I went for brokerAddress and advertisedAddress as these settings relate to broker.conf file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kafka Listeners – Explained | Confluent
The address at which you reach a broker depends on the network used. If you're connecting to the broker from an internal network,...
Read more >
NAR Internet Advertising Policy
Advertising or marketing real property - An Internet site which consists of information regarding properties which have been listed with a real estate...
Read more >
Michigan Legislature - Section 339.2512e
(a) The telephone number or street address of the employing broker. ... (4) A real estate salesperson shall not advertise to sell real...
Read more >
RE 559 - License Disclosure Requirements for Advertising ...
state that the broker is licensed as a real estate broker by the. State of California. 8-digit license number of each licensee in...
Read more >
IAC Ch 10, p.1 193E—10.1(543B) Advertising. A broker shall ...
A broker shall not advertise to sell, buy, exchange, rent, or lease ... show only a post office box number, telephone number or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found