Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't modify bind-address of broker #289

Closed
CBR09 opened this issue Mar 9, 2017 · 2 comments
Closed

Can't modify bind-address of broker #289

CBR09 opened this issue Mar 9, 2017 · 2 comments

Comments

@CBR09
Copy link

CBR09 commented Mar 9, 2017

Hi,
I've tried update bind-address of broker to bind another interface but no luck, maybe it related to listener option?. is there any workaround for it?
./kafka-mesos.sh broker update 0 --bind-address a.b.c.d
./kafka-mesos.sh broker restart 0
In broker logs
...."syslog":false,"log4jOptions":{},"bindAddress":"a.b.c.d","defaults":{"listeners":"PLAINTEXT://x.y.z.d:31000","broker.id":"0","log.dirs":"kafka-logs","port":"31000"....}}
a.b.c.d and z.y.z.d are two diffrent IPs (sorry for hiding IP), a.b.c.d is IP which I want to listening.
Thanks

@steveniemitz
Copy link
Contributor

steveniemitz commented Mar 9, 2017

I think this is related to #286 ? But I'm not sure.

Do you actually want to bind to a certain interface? Or do you just want to advertise a different IP than is being listened on?

Also, what version are you running? The use of bind-address on kafka 0.9.0+ was fixed recently in #197 (and #259).

EDIT: To add, the log you pasted in is only the config defaults, the listeners are transformed on broker launch if a bind address is set (see [1], [2]). You can validate the actual parameters passed to the broker by looking at the actual kafka logs, it'll write the config out when it starts.

[1] https://github.com/mesos/kafka/blob/master/src/scala/main/ly/stealth/mesos/kafka/executor/BrokerServer.scala#L83
[2] https://github.com/mesos/kafka/blob/master/src/scala/main/ly/stealth/mesos/kafka/executor/BrokerServer.scala#L46

@CBR09
Copy link
Author

CBR09 commented Mar 10, 2017

Oh, yes it's related to #286, I changed https://github.com/mesos/kafka/blob/master/src/scala/main/ly/stealth/mesos/kafka/scheduler/mesos/MesosTaskFactory.scala#L95 to
defaults += ("listeners" -> s"PLAINTEXT://${offer.getHostname}:${ reservation.port }")
So it made --bind-address didn't work. When I converted back to original code, I could set --bind-address, but I still got issue about IP:port advertised to ZK.

@CBR09 CBR09 closed this as completed Mar 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants