Kafka single-machine, cluster mode installation details (ii)

Source: Internet
Author: User
Tags zookeeper

The environment of this article is as follows:
Operating system: CentOS 6 32-bit
JDK version: 1.8.0_77 32-bit
Kafka version: 0.9.0.1 (Scala 2.11)

Connected with the Kafka stand-alone, cluster mode installation detailed (a)

6. Single-node multi-broker mode

Kafka can be used in a variety of modes, including single-node single-broker, single-node multi-broker, multi-node multi-broker.
Here we simply distinguish:
Single-node single broker: On a single machine, a Kafka instance is launched (this is the model in the previous article).
Single-node multi-broker: Turn on multiple Kafka (pseudo-distributed like Hadoop) on the same machine.
Multi-node Multi-broker: Open multiple Kafka on multiple machines separately.

6.1 Copy Kafka

Copy the previous single-node single-broker Kafka folder 1 copies to Kafka2.

6.2 Modifying a configuration file

(1) Modify the following content in the server.properties of the first Kafka:

broker.id=0port=9092host.name=master

(2) Modify the following content in the server.properties of the second Kafka:

broker.id=1port=9093 //端口号要与其他同主机的实例不同host.name=master
6.3 Starting the program

First make sure that zookeeper it is started, and then execute it separately in 2 Kafka directories.

bin/kafka-server-start.sh config/server.properties&

If no error is indicated, the boot is successful.

7. Distribution mode (multi-node multi-broker) 7.1 Replication Kafka

Copy the Kafka folder of the sixth step to the other 2 servers slave1 and slave2, respectively, KAFKA3,KAFKA4.

7.2 Modifying a configuration file

(1) Modify the following content in the third Kafka Server.properties:

broker.id=2port=9092host.name=slave1

(2) Modify the following content in the server.properties of the fourth Kafka:

broker.id=3port=9092host.name=slave2
7.3 Starting the program

Make sure that you zookeeper have started, and then perform all the Kafka directories on each of the 3 hosts

bin/kafka-server-start.sh config/server.properties&

If no error is indicated, the boot is successful.

Kafka single-machine, cluster mode installation details (ii)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.