kafka install

This tutorial assumes you are starting fresh and have no existing Kafka or ZooKeeper data. Since Kafka console scripts are different for Unix-based and Windows platforms, on Windows platforms use bin\windows\ instead of bin/, and change the script extension to .bat. Step 1: Download the code Download the 1.1.0 release and un-tar it. > wget http://mirrors.hust.edu.cn/apache/kafka/1.1.0/kafka_2.11-1.1.0.tgz > tar -xzf kafka_2.11-1.1.0.tgz > cd kafka_2.11-1.1.0 Step 2: … Read more

kafka 安装入门

kafka正常运行,必须配置zookeeper,否则无论是kafka集群还是客户端的生存者和消费者都无法正常的工作的;所以需要配置启动zookeeper服务。 (1)zookeeper需要java环境 # yum -y install java-1.8.0 解压到指定目录 tar -xzf kafka_2.13-2.8.0.tgz -C /opt/ (2)这里kafka下载包已经包括zookeeper服务,所以只需修改配置文件,启动即可。 如果需要下载指定zookeeper版本;可以单独去zookeeper官网http://mirrors.shu.edu.cn/apache/zookeeper/下载指定版本。 [root@~]# cd /data/kafka_2.13-2.8.0/ [root@ kafka_2.11-2.1.0]# grep “^[^#]” config/zookeeper.properties dataDir=/tmp/zookeeper   #数据存储目录 clientPort=2181   #zookeeper端口 maxClientCnxns=0 注:可自行添加修改zookeeper配置 3.3 配置kafka (1)修改配置文件 [root@ kafka_2.13-2.8.0]# grep “^[^#]” config/server.properties broker.id=0 listeners=PLAINTEXT://localhost:9092 num.network.threads=3 num.io.threads=8 socket.send.buffer.bytes=102400 socket.receive.buffer.bytes=102400 socket.request.max.bytes=104857600 log.dirs=/tmp/kafka-logs num.partitions=1 num.recovery.threads.per.data.dir=1 offsets.topic.replication.factor=1 transaction.state.log.replication.factor=1 transaction.state.log.min.isr=1 log.retention.hours=168 log.segment.bytes=1073741824 log.retention.check.interval.ms=300000 zookeeper.connect=localhost:2181 zookeeper.connection.timeout.ms=6000 group.initial.rebalance.delay.ms=0 注:可根据自己需求修改配置文件  broker.id:唯一标识ID … Read more