Apache Kafka 安装步骤

 

ZooKeeper框架安装

1 - 下载ZooKeeper

http://zookeeper.apache.org/releases.html

 

2 - 提取tar文件

tar -zxf zookeeper-3.4.6.tar.gz

cd zookeeper-3.4.6
mkdir data

3 –使用命令vi“conf / zoo.cfg"打开名为 conf / zoo.cfg 的配置文件,并将所有以下参数设置为起点。

  vi conf/zoo.cfg
tickTime=2000
dataDir=/path/to/zookeeper/data
clientPort=2181
initLimit=5
syncLimit=2

4 - 启动ZooKeeper服务器

bin/zkServer.sh start

执行此命令后,您将得到如下所示的响应 -

$ JMX enabled by default
$ Using config: /Users/../zookeeper-3.4.6/bin/../conf/zoo.cfg
$ Starting zookeeper ... STARTED

5 - 启动CLI

bin/zkCli.sh

输入上面的命令后,您将被连接到zookeeper服务器,并将获得以下响应。

Connecting to localhost:2181
................
................
................
Welcome to ZooKeeper!
................
................
WATCHER::
WatchedEvent state:SyncConnected type: None path:null
[zk: localhost:2181(CONNECTED) 0]

6 - 停止Zookeeper服务器

bin/zkServer.sh stop

Apache Kafka安装

1 - 下载Kafka

https://www.apache.org/dyn/closer.cgi?path=/kafka/0.9.0.0/kafka_2.11-0.9.0.0.tgz

2 - 解压tar文件

tar -zxf kafka_2.11.0.9.0.0 tar.gz
cd kafka_2.11.0.9.0.0

3 - 启动服务器

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

服务器启动后,您会在屏幕上看到以下响应:

$ bin/kafka-server-start.sh config/server.properties
[2016-01-02 15:37:30,410] INFO KafkaConfig values:
request.timeout.ms = 30000
log.roll.hours = 168
inter.broker.protocol.version = 0.9.0.X
log.preallocate = false
security.inter.broker.protocol = PLAINTEXT
…………………………………………….
…………………………………………….

4 - 停止服务器

bin/kafka-server-stop.sh config/server.properties

 

posted on 2019-02-21 11:17  我是司  阅读(345)  评论(0)    收藏  举报

导航