[jira] [Commented] (KAFKA-4337) Create topic in multiple zookeepers with Kafka AdminUtils.CreateTopic JAVA API in Kafka 0.9.0.1 gives Error (Topic gets created in only one of the specified zookeeper)
[ https://issues.apache.org/jira/browse/KAFKA-4337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15622940#comment-15622940 ] Bharat Patel commented on KAFKA-4337: - HI I am specifying zookeeperIPS comma separated like this "xx.xx.xx.xx:PORT,xx.xx.xx.xx:PORT". There is no error as such. But topic is created in only first zookeeper mentioned in list. Note :- I am passing 3 IPs of zookeeper, which all are belong to different Kafka Cluster and want that AdminUtils.createTopic command will create topic in all three zookeepers. But it is not happening. If I call AdminUtils.createTopic method 3 times separately, then it is able to create topic in all 3 zookeepers. Thanks > Create topic in multiple zookeepers with Kafka AdminUtils.CreateTopic JAVA > API in Kafka 0.9.0.1 gives Error (Topic gets created in only one of the > specified zookeeper) > --- > > Key: KAFKA-4337 > URL: https://issues.apache.org/jira/browse/KAFKA-4337 > Project: Kafka > Issue Type: Bug > Components: admin >Reporter: Bharat Patel > Original Estimate: 24h > Remaining Estimate: 24h > > Want to use below code snippet to create topic in multiple zookeepers with > Kafka Java APIS. when I specify 2 zookeeprs IPs in zookeeperConnect variable > it only creates topic in anyone of zookeeper. Both the zookeeper are 2 > different kafka clusters. > String zookeeperConnect = zookeeperIPs; // Multiple zookeeper IPs >int sessionTimeoutMs = 10 * 1000; >int connectionTimeoutMs = 8 * 1000; >try { > ZkClient zkClient = new ZkClient( > zookeeperConnect, > sessionTimeoutMs, > connectionTimeoutMs, > ZKStringSerializer$.MODULE$); > boolean isSecureKafkaCluster = false; > ZkUtils zkUtils = new ZkUtils(zkClient, > new ZkConnection(zookeeperConnect), isSecureKafkaCluster); > String topic1 = "nameofTopictobeCreated"; > int partitions = 1; > int replication = 1; > Properties topicConfig = new Properties(); // add per-topic > configurations settings here > AdminUtils.createTopic(zkUtils, topic1, partitions, replication, > topicConfig); -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (KAFKA-4337) Create topic in multiple zookeepers with Kafka AdminUtils.CreateTopic JAVA API in Kafka 0.9.0.1 gives Error (Topic gets created in only one of the specified zookeeper)
[ https://issues.apache.org/jira/browse/KAFKA-4337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15603917#comment-15603917 ] Ismael Juma commented on KAFKA-4337: Yes, this is not a valid bug. You can configure multiple host:port pairs for the case when one or more are down. You are supposed to pass host:port pairs for servers in the _same_ ZooKeeper ensemble. > Create topic in multiple zookeepers with Kafka AdminUtils.CreateTopic JAVA > API in Kafka 0.9.0.1 gives Error (Topic gets created in only one of the > specified zookeeper) > --- > > Key: KAFKA-4337 > URL: https://issues.apache.org/jira/browse/KAFKA-4337 > Project: Kafka > Issue Type: Bug > Components: admin >Reporter: Bharat Patel > Original Estimate: 24h > Remaining Estimate: 24h > > Want to use below code snippet to create topic in multiple zookeepers with > Kafka Java APIS. when I specify 2 zookeeprs IPs in zookeeperConnect variable > it only creates topic in anyone of zookeeper. Both the zookeeper are 2 > different kafka clusters. > String zookeeperConnect = zookeeperIPs; // Multiple zookeeper IPs >int sessionTimeoutMs = 10 * 1000; >int connectionTimeoutMs = 8 * 1000; >try { > ZkClient zkClient = new ZkClient( > zookeeperConnect, > sessionTimeoutMs, > connectionTimeoutMs, > ZKStringSerializer$.MODULE$); > boolean isSecureKafkaCluster = false; > ZkUtils zkUtils = new ZkUtils(zkClient, > new ZkConnection(zookeeperConnect), isSecureKafkaCluster); > String topic1 = "nameofTopictobeCreated"; > int partitions = 1; > int replication = 1; > Properties topicConfig = new Properties(); // add per-topic > configurations settings here > AdminUtils.createTopic(zkUtils, topic1, partitions, replication, > topicConfig); -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (KAFKA-4337) Create topic in multiple zookeepers with Kafka AdminUtils.CreateTopic JAVA API in Kafka 0.9.0.1 gives Error (Topic gets created in only one of the specified zookeeper)
[ https://issues.apache.org/jira/browse/KAFKA-4337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15603886#comment-15603886 ] huxi commented on KAFKA-4337: - After checking the source code, zookeeper client will try to connect to the specified ZK servers in a robin-round manner, so it will connect to the first zookeeper server in the list. If it failed, it will try to connect to the second one. > Create topic in multiple zookeepers with Kafka AdminUtils.CreateTopic JAVA > API in Kafka 0.9.0.1 gives Error (Topic gets created in only one of the > specified zookeeper) > --- > > Key: KAFKA-4337 > URL: https://issues.apache.org/jira/browse/KAFKA-4337 > Project: Kafka > Issue Type: Bug > Components: admin >Reporter: Bharat Patel > Original Estimate: 24h > Remaining Estimate: 24h > > Want to use below code snippet to create topic in multiple zookeepers with > Kafka Java APIS. when I specify 2 zookeeprs IPs in zookeeperConnect variable > it only creates topic in anyone of zookeeper. Both the zookeeper are 2 > different kafka clusters. > String zookeeperConnect = zookeeperIPs; // Multiple zookeeper IPs >int sessionTimeoutMs = 10 * 1000; >int connectionTimeoutMs = 8 * 1000; >try { > ZkClient zkClient = new ZkClient( > zookeeperConnect, > sessionTimeoutMs, > connectionTimeoutMs, > ZKStringSerializer$.MODULE$); > boolean isSecureKafkaCluster = false; > ZkUtils zkUtils = new ZkUtils(zkClient, > new ZkConnection(zookeeperConnect), isSecureKafkaCluster); > String topic1 = "nameofTopictobeCreated"; > int partitions = 1; > int replication = 1; > Properties topicConfig = new Properties(); // add per-topic > configurations settings here > AdminUtils.createTopic(zkUtils, topic1, partitions, replication, > topicConfig); -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (KAFKA-4337) Create topic in multiple zookeepers with Kafka AdminUtils.CreateTopic JAVA API in Kafka 0.9.0.1 gives Error (Topic gets created in only one of the specified zookeeper)
[ https://issues.apache.org/jira/browse/KAFKA-4337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15603845#comment-15603845 ] huxi commented on KAFKA-4337: - could you paste how you specify multiple zookeeper IPs? Those should be comma separated host:port pairs. Besides, could you offer the error log also? > Create topic in multiple zookeepers with Kafka AdminUtils.CreateTopic JAVA > API in Kafka 0.9.0.1 gives Error (Topic gets created in only one of the > specified zookeeper) > --- > > Key: KAFKA-4337 > URL: https://issues.apache.org/jira/browse/KAFKA-4337 > Project: Kafka > Issue Type: Bug > Components: admin >Reporter: Bharat Patel > Original Estimate: 24h > Remaining Estimate: 24h > > Want to use below code snippet to create topic in multiple zookeepers with > Kafka Java APIS. when I specify 2 zookeeprs IPs in zookeeperConnect variable > it only creates topic in anyone of zookeeper. Both the zookeeper are 2 > different kafka clusters. > String zookeeperConnect = zookeeperIPs; // Multiple zookeeper IPs >int sessionTimeoutMs = 10 * 1000; >int connectionTimeoutMs = 8 * 1000; >try { > ZkClient zkClient = new ZkClient( > zookeeperConnect, > sessionTimeoutMs, > connectionTimeoutMs, > ZKStringSerializer$.MODULE$); > boolean isSecureKafkaCluster = false; > ZkUtils zkUtils = new ZkUtils(zkClient, > new ZkConnection(zookeeperConnect), isSecureKafkaCluster); > String topic1 = "nameofTopictobeCreated"; > int partitions = 1; > int replication = 1; > Properties topicConfig = new Properties(); // add per-topic > configurations settings here > AdminUtils.createTopic(zkUtils, topic1, partitions, replication, > topicConfig); -- This message was sent by Atlassian JIRA (v6.3.4#6332)