apache-zookeeper

Kafka: Get broker host from ZooKeeper

一个人想着一个人 提交于 2019-11-27 11:29:13
For particular reasons I need to use both - ConsumerGroup (a.k.a. high-level consumer) and SimpleConsumer (a.k.a. low-level consumer) to read from Kafka. For ConsumerGroup I use ZooKeeper-based config and am completely satisfied with it, but SimpleConsumer requires seed brokers to be instantiated. I don't want to keep list of both - ZooKeeper and broker hosts. Thus, I'm looking for a way to automatically discover brokers for a particular topic from ZooKeeper . Because of some indirect information I belief that these data is stored in ZooKeeper under one of the following paths: /brokers/topics/

Reloading SolrCloud configuration (stored on Zookeeper) - schema.xml

回眸只為那壹抹淺笑 提交于 2019-11-27 11:17:38
问题 I have setup a SolrCloud replication using standalone zookeeper. But now I wish to make some changes to my Schema.xml and reload the core. The problem is that when I run a single server Solr (no solrcloud) the new schema is loaded, but I do not know how to reload schema on all the replication server. I tried reloading the schema on one of the server with no desired impact. Is there a way in which I can reload my schema.xml in Solr in distributed replication setup which uses zookeeper. 回答1:

How to install Kafka on Windows?

断了今生、忘了曾经 提交于 2019-11-27 11:07:27
I'm trying to install Kafka message queue on Windows for testing purposes (not for production). I found this article on how to install Apache Kafka 0.8 on Windows: http://janschulte.wordpress.com/2013/10/13/apache-kafka-0-8-on-windows/ It's a good article, but it's outdated, unfortunately. Does someone know a way to achieve that? Ok, it's finally not complicated :) The only steps are: Download Kafka and uncompress it somewhere nice (let's say C:/Kafka ) Install Cygwin Edit \bin\kafka-run-class.sh and at the end of the file, change exec $JAVA $KAFKA_HEAP_OPTS $KAFKA_JVM_PERFORMANCE_OPTS $KAFKA

Is it possible to start a zookeeper server instance in process, say for unit tests?

一世执手 提交于 2019-11-27 10:47:50
Calling org.apache.zookeeper.server.quorum.QuorumPeerMain.main() isn't working. To start ZooKeeper you have to execute ZooKeeperServerMain class. You can use following code to start ZooKeeper in embedded mode. Properties startupProperties = ... QuorumPeerConfig quorumConfiguration = new QuorumPeerConfig(); try { quorumConfiguration.parseProperties(startupProperties); } catch(Exception e) { throw new RuntimeException(e); } zooKeeperServer = new ZooKeeperServerMain(); final ServerConfig configuration = new ServerConfig(); configuration.readFrom(quorumConfiguration); new Thread() { public void

ZooKeeper reliability - three versus five nodes

耗尽温柔 提交于 2019-11-27 10:31:35
问题 From the ZooKeeper FAQ: Reliability: A single ZooKeeper server (standalone) is essentially a coordinator with no reliability (a single serving node failure brings down the ZK service). A 3 server ensemble (you need to jump to 3 and not 2 because ZK works based on simple majority voting) allows for a single server to fail and the service will still be available. So if you want reliability go with at least 3. We typically recommend having 5 servers in "online" production serving environments.

Kafka - How to commit offset after every message using High-Level consumer?

我是研究僧i 提交于 2019-11-27 10:20:58
问题 I'm using Kafka's high-level consumer. Because I'm using Kafka as a 'queue of transactions' for my application, I need to make absolutely sure I don't miss or re-read any messages. I have 2 questions regarding this: How do I commit the offset to zookeeper? I will turn off auto-commit and commit offset after every message successfully consumed. I can't seem to find actual code examples of how to do this using high-level consumer. Can anyone help me with this? On the other hand, I've heard

Explaining Apache ZooKeeper

只愿长相守 提交于 2019-11-27 09:55:22
I am trying to understand ZooKeeper, how it works and what it does. Is there any application which is comparable to ZooKeeper? If you know, then how would you describe ZooKeeper to a layman? I have tried apache wiki, zookeeper sourceforge...but I am still not able to relate to it. I just read thru http://zookeeper.sourceforge.net/index.sf.shtml , so aren't there more services like this? Is it as simple as just replicating a server service? Luca Geretti In a nutshell, ZooKeeper helps you build distributed applications. How it works You may describe ZooKeeper as a replicated synchronization

How to get data from old offset point in Kafka?

試著忘記壹切 提交于 2019-11-27 09:36:58
问题 I am using zookeeper to get data from kafka. And here I always get data from last offset point. Is there any way to specify the time of offset to get old data? There is one option autooffset.reset. It accepts smallest or largest. Can someone please explain what is smallest and largest. Can autooffset.reset helps in getting data from old offset point instead of latest offset point? 回答1: The consumers belong always to a group and, for each partition, the Zookeeper keeps track of the progress of

removing a kafka consumer group in zookeeper

放肆的年华 提交于 2019-11-27 09:14:37
I'm using kafka_2.9.2-0.8.1.1 with zookeeper 3.4.6. Is there a utility that can automatically remove a consumer group from zookeeper? Or can I just remove everything under /consumers/[group_id] in zookeeper? If the latter, is there anything else I'm missing & can this be done with a live system? Update: As of kafka version 2.3.0, there is a new utility: > bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --delete --group my-group Related doc: http://kafka.apache.org/documentation/#basic_ops_consumer_lag See below for more discussion Heejin Currently, as I know, the only way to

Why do Kafka consumers connect to zookeeper, and producers get metadata from brokers?

冷暖自知 提交于 2019-11-27 05:07:36
问题 Why is it that consumers connect to zookeeper to retrieve the partition locations? And kafka producers have to connect to one of the brokers to retrieve metadata. My point is, what exactly is the use of zookeeper when every broker already has all the necessary metadata to tell producers the location to send their messages? Couldn't the brokers send this same information to the consumers? I can understand why brokers have the metadata, to not have to make a connection to zookeeper each time a