赞
踩
本博文讲解的为单机版安装教程
可以在上面两个地方选一个合适的镜像
mkdir -p /usr/local/services/zookeeper
cd /usr/local/services/zookeeper
wget --no-check-certificate https://mirrors.aliyun.com/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz
此处的zookeeper版本可能已经失效了,同学们可在镜像网站内选择合适的zookeeper版本,然后以此命令替换掉 镜像源下载即可。
cd /usr/local/services/zookeeper
tar -zxf zookeeper-3.4.10.tar.gz
cd zookeeper-3.4.10
mkdir data
mkdir logs
vim conf/zoo.cfg
tickTime = 2000
dataDir = /usr/local/services/zookeeper/zookeeper-3.4.10/data
dataLogDir = /usr/local/services/zookeeper/zookeeper-3.4.10/logs
tickTime = 2000
clientPort = 2181
initLimit = 5
syncLimit = 2
使用命令 vim conf/zoo.cfg 创建配置文件并打开,虽然文件夹下有了一个zoo_sample.cfg示例配置文件,我们还是新创建一个。至此以安装结束
/usr/local/services/zookeeper/zookeeper-3.4.10/bin/zkServer.sh start
/usr/local/services/zookeeper/zookeeper-3.4.10/bin/zkCli.sh
/usr/local/services/zookeeper/zookeeper-3.4.10/bin/zkServer.sh status
/usr/local/services/zookeeper/zookeeper-3.4.10/bin/zkServer.sh stop
yum install -y vim maven wget
如果此地址无法访问或者下载速度较慢,可自行网络寻找Kafka压缩包,虽然版本不一样但是安装命令是基本一致的。
wget http://mirrors.tuna.tsinghua.edu.cn/apache/kafka/2.2.0/kafka_2.11-2.2.0.tgz
tar -zxvf kafka_2.11-2.2.0.tgz
cd kafka_2.11-2.2.0
vim config/server.properties
advertised.listeners=PLAINTEXT://192.168.29.128:9092
这里的192.168.29.128 替换为自己实际服务器ip, 此处端口号默认为9092
bin/kafka-server-start.sh -daemon config/server.properties
bin/kafka-server-stop.sh
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。