Quick Method to see Kafka-Broker uptime

Quick Method to see Kafka-Broker uptime

lstart and etime are the actual start time and the actual elapsed time since start

[userid@kafka-server ~]$ ps -eo pid,comm,lstart,etime,time,args | grep -i kafka | grep -v grep
9863 java Thu Nov 3 16:19:38 2017 05:25:55 00:09:55 /usr/jdk64/java-1.8.0-openjdk- -Xmx1G -Xms1G -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+DisableExplicitGC -Djava.awt.headless=true -Xloggc:/var/log/kafka/kafkaServer-gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -Dkafka.logs.dir=/var/log/kafka -Dlog4j.configuration=file:/usr/iop/current/kafka-broker/bin/../config/log4j.properties -cp :/kafka-broker/bin/../libs/* -Xmx8g -Xms8g -Djava.security.auth.login.config=/kafka-broker/config/kafka_jaas.conf kafka Kafka /kafka-broker/config/server.properties

Secrets to Debugging Network Traffic

As many of you know, I am Java Programmer and a cURL fan. When I am demonstrating an API to a customer or another IBMer, I tend to default to either method to demonstrate the API.

I was demonstrating a download API that was being redirected, and throwing an error on a different Node.  In order to debug the traffic, I used a couple of different methods.

1 – For Java

I added -Djavax.net.debug=ssl:handshake:verbose  to the Java VM Arguments.  In Eclipse, I configure the Run Configuration -> VM Arguments.

java -Djavax.net.debug=ssl:handshake:verbose  MyAPIDemo

I absolutely make sure you have enough buffer in your console window.  I right click and update to a 100,000 lines.  I like to keep it as high as possible to capture all the details.

Scroll Through the output and find out what actually happened in the request.

2 – For cURL

I add -vv which is super verbose to the command

curl -H "Authorization: Basic asdfljkfasdf" https://api.com/api -vv

I read through and find out why my API failed.

You can read more about the configuration in the IBM JDK Documentation.