Closed ThisIsMissEm closed 4 years ago
hi @ThisIsMissEm -- sorry for the delay, i've only recently resumed work on my github projects. reading through the logs it looks like you can connect to the broker that's on your localhost, but not a "remote" one at 'kafka.company.local' - correct? if you're trying to connect to a bigger cluster it might be worth checking with your kafka admin? the issue is a networking one though from what i can tell - e.g. maybe the advertised hostname or ip is incorrect? i hope you found a solution by now though! i'm closing this issue as I don't think it's a kt issue, but please feel free to re-open the issue if i can be of help!
Sorry to revive an old issue, but I'm having a similar problem and I think I've found the root cause. In -verbose
mode I see an attempt to look up the hostname on my home router (192.168.1.1) but not on the one(s) provided by the VPN (172.16.130.109, 172.16.130.110); if I use the IP address of the broker(s) then everything works fine.
The net package docs say that the pure Go resolver "sends DNS requests directly to the servers listed in /etc/resolv.conf", i.e. if that doesn't include the VPN servers then it won't be able to look them up. There's an alternative implementation called cgo
but unfortunately the netgo
build tag prevents me from overriding it — "The decision can also be forced while building the Go source tree by setting the netgo or netcgo build tag" — and I've confirmed that myself:
$ GODEBUG=netdns=cgo+2 kt consume --brokers kafka.example.tech:9092 -topic foo -offsets newest -verbose
...
go package net: built with netgo build tag; using Go's DNS resolver
go package net: hostLookupOrder(kafka.example.tech) = files,dns
Unless netgo
can be removed somehow (I don't know the intricacies of Go builds or why it was chosen) I think these are the only workarounds:
/etc/hosts
/etc/resolv.conf
(as at least Cisco's VPN software doesn't do this itself)
Hi! When running
kt topic
the command connects successfully and prints out the topics on my kafka cluster, but when doingkt consume -topic my-topic
I get the following error:I've no idea what's causing this as if I can list topics, surely I can consume them? My cluster has no authentication requirements.