Database Reference
In-Depth Information
Starting a Kafka Broker Cluster
After a proper Kafka configuration file has been created, you can start it
using the kafka-server-start.sh script. This script takes the
properties file containing the configuration:
$ ./bin/kafka-server-start.sh config/server.properties
The server normally starts in the foreground because it doesn't have a
built-in daemon mode. A common pattern for starting the Kafka server in
the background, such as in an init.d script, is to write the output to a log
file and background the server:
$ ./bin/kafka-server-start.sh \
> config/server.propertiers > kafka.log 2>&1 &
A Multi-Broker Cluster on a Single Machine
Sometimes during the course of development it is desirable to have more
than one Kafka broker available to ensure that applications can
appropriately deal with partitions on multiple servers and the management
of reading from the ISR and so on. For example, developing a client for a
new language should always be done against a multi-broker cluster.
Starting multiple brokers on a single machine is a fairly straightforward
task. Each broker must be assigned a separate broker id, port and log
directory. For example, the following three files could be used:
config/server-1.properties:
broker.id=1
port=6001
log.dirs=/tmp/kafka-logs-1
zookeeper.connect=localhost:2181
config/server-2.properties:
broker.id=2
port=6002
log.dirs=/tmp/kafka-logs-2
zookeeper.connect=localhost:2181
config/server-3.properties:
broker.id=3
port=6003
Search WWH ::




Custom Search