Connecting to a Kafka cluster
To connect Unravel server to a Kafka cluster, change the configuration of the Kafka cluster and add some properties to unravel.properties
.
Change the configuration of the Kafka cluster.
Export an available port for
JMX_PORT
. You need to export one port for each Kafka server.export JMX_PORT=
jmx-port
Tip
The default JMX port for Kafka in CDH is 9393.
In HDP you would export this parameter in Ambari Web UI under Advanced kafka-env | kafka-env template.
Enable remote access for JMX monitoring by appending the following lines to
KAFKA_JMX_OPTS
inkafka_run_class.sh
:-Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT -Dcom.sun.management.jmxremote.port=$JMX_PORT -Djava.rmi.server.hostname=
public-hostname
-Djava.net.preferIPv4Stack=trueTip
Not required for HDP.
Verify the configuration changes on the Kafka cluster.
Restart the Kafka broker.
In
/usr/local/unravel/etc/unravel.properties
, add properties to monitor the Kafka cluster.The Unravel daemon,
unravel_km
, relies on a list of Kafka servers to query and discover the entire cluster. You need to add this list of Kafka servers to/usr/local/unravel/etc/unravel.properties
.For complete descriptions of properties, see Kafka Monitoring Properties.
com.unraveldata.ext.kafka.clusters=
cluster-list
com.unraveldata.ext.kafka.cluster-id
.bootstrap_servers=boot-servers
com.unraveldata.ext.kafka.cluster-id
.jmx_servers=jmx-servers
com.unraveldata.ext.kafka.cluster-id
.jmx.jmx-server-id
.host=jmx-hosts
com.unraveldata.ext.kafka.cluster-id
.jmx.jmx-server-id
.port=jmx-port
For example,
com.unraveldata.ext.kafka.clusters=c1,c2 com.unraveldata.ext.kafka.c1.bootstrap_servers=localhost:9092,localhost:9093 com.unraveldata.ext.kafka.c2.bootstrap_servers=localhost:9192,localhost:9193 com.unraveldata.ext.kafka.c1.jmx_servers=kafka-test1,kafka-test2 com.unraveldata.ext.kafka.c2.jmx_servers=kafka-test1,kafka-test2 com.unraveldata.ext.kafka.c1.jmx.kafka-test1.host=localhost com.unraveldata.ext.kafka.c1.jmx.kafka-test2.host=localhost com.unraveldata.ext.kafka.c2.jmx.kafka-test1.host=localhost com.unraveldata.ext.kafka.c2.jmx.kafka-test2.host=localhost com.unraveldata.ext.kafka.c1.jmx.kafka-test1.port=5005 com.unraveldata.ext.kafka.c1.jmx.kafka-test2.port=5010 com.unraveldata.ext.kafka.c2.jmx.kafka-test1.port=5105 com.unraveldata.ext.kafka.c2.jmx.kafka-test2.port=5110