Support Questions
Find answers, ask questions, and share your expertise

leadership load across the brokers in a cluster is evenly balanced.

hi all

I need advice regarding the following problem

my target is to guarantees that the leadership load across the brokers in a cluster is evenly balanced.

sh /usr/hdp/2.6.0.3-8/kafka/bin/kafka-preferred-replica-election.sh --zookeeper zklist

Failed to start preferred replica election org.I0Itec.zkclient.exception.ZkException: Unable to connect to zklist at org.I0Itec.zkclient.ZkConnection.connect(ZkConnection.java:71) at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:1227) at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:156) at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:130) at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:97) at kafka.utils.ZkUtils$.createZkClient(ZkUtils.scala:70) at kafka.admin.PreferredReplicaLeaderElectionCommand$.main(PreferredReplicaLeaderElectionCommand.scala:57) at kafka.admin.PreferredReplicaLeaderElectionCommand.main(PreferredReplicaLeaderElectionCommand.scala) Caused by: java.net.UnknownHostException: zklist: Temporary failure in name resolution at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928) at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323) at java.net.InetAddress.getAllByName0(InetAddress.java:1276) at java.net.InetAddress.getAllByName(InetAddress.java:1192) at java.net.InetAddress.getAllByName(InetAddress.java:1126) at org.apache.zookeeper.client.StaticHostProvider.<init>(StaticHostProvider.java:61) at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:446) at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:380) at org.I0Itec.zkclient.ZkConnection.connect(ZkConnection.java:69)

Michael-Bronson
1 ACCEPTED SOLUTION

Accepted Solutions

Super Mentor

@uri ben-ari


The error indicates that you are not passing the correct "zookeeper.connect" property value to the flag "--zookeeper" in the command line.


You can get the "zookeeper.connect" value from

Ambari UI --> Kafka --> Configs --> Kafka Broker --> "zookeeper.connect"


In my case the value was : "amb25103.example.com:2181,amb25102.example.com:2181,amb25101.example.com:2181"
So i had to use the following command:

Example:

# /usr/hdp/2.6.0.3-8/kafka/bin/kafka-preferred-replica-election.sh --zookeeper amb25103.example.com:2181,amb25102.example.com:2181,amb25101.example.com:2181

.

View solution in original post

1 REPLY 1

Super Mentor

@uri ben-ari


The error indicates that you are not passing the correct "zookeeper.connect" property value to the flag "--zookeeper" in the command line.


You can get the "zookeeper.connect" value from

Ambari UI --> Kafka --> Configs --> Kafka Broker --> "zookeeper.connect"


In my case the value was : "amb25103.example.com:2181,amb25102.example.com:2181,amb25101.example.com:2181"
So i had to use the following command:

Example:

# /usr/hdp/2.6.0.3-8/kafka/bin/kafka-preferred-replica-election.sh --zookeeper amb25103.example.com:2181,amb25102.example.com:2181,amb25101.example.com:2181

.

View solution in original post