1.环境说明
主机信息如下:
1
[root@test1 soft]# hostname
2
test1
3
[root@test1 soft]# cat /etc/hosts
4
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
5
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
6
192.168.56.91 test1
7
192.168.56.92 test2
8
192.168.56.93 test3
9
192.168.56.1 PC-201306171517
10
操作系统版本如下:
1
[root@test1 soft]# cat /etc/redhat-release
2
CentOS release 6.4 (Final)
3
[root@test1 soft]# uname -a
4
Linux test1 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
5
2.下载kafka
下载地址如下:
3.安装配置kafka
一.解压缩kafka
1
[root@test1 soft]# tar zxvf kafka_2.11-0.10.0.1.tgz -C /root/kafka
1
[root@test1 soft]# tar zxvf kafka_2.11-0.10.0.1.tgz -C /root/kafka
二.配置zookeeper
由于kafka需要使用到zookeeper来注册信息,因此需要首先配置zookeeper.在kafka的安装包中已经提供了zookeeper,不需要额外安装,直接配置一下即可.配置文件在config下的zookeeper. properties
1
[root@test1 config]# cat zookeeper.properties
2
# Licensed to the Apache Software Foundation (ASF) under one or more
3
# contributor license agreements. See the NOTICE file distributed with
4
# this work for additional information regarding copyright ownership.
5
# The ASF licenses this file to You under the Apache License,Version 2.0
6
# (the "License"); you may not use this file except in compliance with
7
# the License. You may obtain a copy of the License at
8
#
9
# http://www.apache.org/licenses/LICENSE-2.0
10
11
# Unless required by applicable law or agreed to in writing,software
12
# distributed under the License is distributed on an "AS IS" BASIS,
13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,either express or implied.
14
# See the License for the specific language governing permissions and
15
# limitations under the License.
16
# the directory where the snapshot is stored.
17
dataDir=/root/kafka/kafka_2.11-0.10.0.1/zoodata ###########这里修改zookeeper的快照目录,需要事先在文件系统上创建目录,其它默认即可.
18
# the port at which the clients will connect
19
clientPort=2181 #默认端口号2181
20
# disable the per-ip limit on the number of connections since this is a non-production config
21
maxClientCnxns=0
22