centos下安装单机版kafka-0.10.0.1

前端之家收集整理的这篇文章主要介绍了centos下安装单机版kafka-0.10.0.1前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1.环境说明

主机信息如下:
操作系统版本如下:
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

下载地址如下:
我这里使用 Scala 2.11 - kafka_2.11-0.10.0.1.tgz ( asc , md5 )版本

3.安装配置kafka

一.解压缩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

三.配置kafka

kafka的配置文件在config下的server.properties文件.下面是一个配置实例:
37
38
39
40
41
42
43
44
45
46
47
48
49
50
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

4.启动kafka

为了方便可以将kafka的运行目录添加到PATH环境变量中.
首先使用命令 bin/zookeeper-server-start.sh config/zookeeper.properties
启动zookeeper.
1
[root@test1 kafka_2.11-0.10.0.1]# nohup ./bin/zookeeper-server-start.sh config/zookeeper.properties &
2
[1] 1888
3
[root@test1 kafka_2.11-0.10.0.1]# nohup: ignoring input and appending output to `nohup.out'
4
5
[root@test1 kafka_2.11-0.10.0.1]# jps
6
1888 QuorumPeerMain
7
2118 Jps
8
再使用命令 bin/kafka-server-start.sh config/server.properties
启动kafka

猜你在找的CentOS相关文章