StokeBloke.com

Archive for November, 2016

OpenDNS failure?

Friday, November 11th, 2016

Well I spent a few hours yesterday trying to figure out why DNS was failing in some cases.

We use OpenDNS server then fallback to googles.

E.g.

208.67.222.222
208.67.220.220
8.8.8.8

Yesterday nslookup test.uribl.com.multi.uribl.com failed.

After a while I found the following …

OpenDNS server returns server unknown :

nslookup  test.uribl.com.multi.uribl.com 208.67.220.220
Server:		208.67.220.220
Address:	208.67.220.220#53

** server can’t find test.uribl.com.multi.uribl.com: NXDOMAIN
While google works correctly :

nslookup  test.uribl.com.multi.uribl.com 8.8.8.8
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
Name:	test.uribl.com.multi.uribl.com
Address: 127.0.0.14

I have now switched to use google DNS only. I have no idea why OpenDNS fails for this lookup but not any other.

The number of messages in a Kafka Topic

Friday, November 11th, 2016

This is how you find out how many messages exist for a kafka topic.


/opt/kafka/bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list kafka:9092 --topic test --time -2

This gives output like this

test:1:28179212
test:0:28180921


/opt/kafka/bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list kafka:9092 --topic test --time -1

This gives output like this

test:1:28228989
test:0:28230734

Simply subtract these values and you get the sizes.
0:28230734 – 28180921 = 49813
1:28228989 – 28179212 = 49777