精华内容
下载资源
问答
  • Kafka is a distributed,partitioned,replicated commit logservice。它提供了类似于JMS的特性,但是在设计实现上完全不同,此外它并不是JMS规范的实现。kafka对消息保存时根据Topic进行归类,发送消息者成为...

    Kafka is a distributed,partitioned,replicated commit logservice。它提供了类似于JMS的特性,但是在设计实现上完全不同,此外它并不是JMS规范的实现。kafka对消息保存时根据Topic进行归类,发送消息者成为Producer,消息接受者成为Consumer,此外kafka集群有多个kafka实例组成,每个实例(server)成为broker。无论是kafka集群,还是producer和consumer都依赖于zookeeper来保证系统可用性集群保存一些meta信息。

    今天我们先从搭建Kafka源码环境入手。

    1.gradle安装

    gradle安装

    2.下载apache kafka源代码

    apache kafka下载

    3.用gradle构建产生IDEA工程文件

    执行如下命令:

    经过几分钟的编译后,出现Build Successful表示源码编译下载成功。

    生成IDEA工程文件如下:

    5.IDEA中查看源码工程

    6.Kafka启动时,参数设置

    7、在编译运行时可能出现的问题

    错误: -source 1.6 中不支持 diamond 运算符

    解决办法是:使用jdk1.7来编译,

    这样就可以启动调试Kafka源码了。是不是很简单。

    展开全文
  • kafka源码环境搭建

    2018-07-07 10:57:11
    kafka源码环境搭建基于 JDK 1.8.0_161 kafka-0.10.0.1 scala-2.12.6 zookeeper-3.4.12 gradle-4.5开发工具 IDEA 2018.1.51.首先需要依次配置环境变量 JDK 1.8.0_161、kafka-0.10.0.1、scala-2.12.6、zookeeper...
    kafka源码环境搭建
    
    基于
        JDK 1.8.0_161
        kafka-0.10.0.1
        scala-2.12.6
        zookeeper-3.4.12
        gradle-4.5
    开发工具 IDEA 2018.1.5

    1.首先需要依次配置环境变量
        JDK 1.8.0_161、kafka-0.10.0.1、scala-2.12.6、zookeeper-3.4.12、gradle-4.5
    2.启动zookeeper
        首先拷贝一份%ZOOKEEPER_HOME%\conf\zoo_sample.cfg 修改为zoo.cfg,修改zoo.cfg里面的dataDir=/tmp/zookeeper日志存储目录
        执行 zkserver

    C:\Users\chenjianfei>zkserver
    
    C:\Users\chenjianfei>call "D:\jdk1.8.0_161"\bin\java "-Dzookeeper.log.dir=D:\zookeeper-3.4.12\bin\.." "-Dzookeeper.root.logger=INFO,CONSOLE" -cp "D:\zookeeper-3.4.12\bin\..\build\classes;D:\zookeeper-3.4.12\bin\..\build\lib\*;D:\zookeeper-3.4.12\bin\..\*;D:\zookeeper-3.4.12\bin\..\lib\*;D:\zookeeper-3.4.12\bin\..\conf" org.apache.zookeeper.server.quorum.QuorumPeerMain "D:\zookeeper-3.4.12\bin\..\conf\zoo.cfg"
    2018-07-07 10:25:49,583 [myid:] - INFO  [main:QuorumPeerConfig@136] - Reading configuration from: D:\zookeeper-3.4.12\bin\..\conf\zoo.cfg
    2018-07-07 10:25:49,583 [myid:] - INFO  [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
    2018-07-07 10:25:49,583 [myid:] - INFO  [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
    2018-07-07 10:25:49,583 [myid:] - INFO  [main:DatadirCleanupManager@101] - Purge task is not scheduled.
    2018-07-07 10:25:49,583 [myid:] - WARN  [main:QuorumPeerMain@116] - Either no config or no quorum defined in config, running  in standalone mode
    2018-07-07 10:25:49,645 [myid:] - INFO  [main:QuorumPeerConfig@136] - Reading configuration from: D:\zookeeper-3.4.12\bin\..\conf\zoo.cfg
    2018-07-07 10:25:49,645 [myid:] - INFO  [main:ZooKeeperServerMain@98] - Starting server
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:Environment@100] - Server environment:zookeeper.version=3.4.12-e5259e437540f349646870ea94dc2658c4e44b3b, built on 03/27/2018 03:55 GMT
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:Environment@100] - Server environment:host.name=DESKTOP-6FVEB35
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:Environment@100] - Server environment:java.version=1.8.0_161
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:Environment@100] - Server environment:java.vendor=Oracle Corporation
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:Environment@100] - Server environment:java.home=D:\jdk1.8.0_161\jre
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:Environment@100] - Server environment:java.class.path=D:\zookeeper-3.4.12\bin\..\build\classes;D:\zookeeper-3.4.12\bin\..\build\lib\*;D:\zookeeper-3.4.12\bin\..\zookeeper-3.4.12.jar;D:\zookeeper-3.4.12\bin\..\lib\audience-annotations-0.5.0.jar;D:\zookeeper-3.4.12\bin\..\lib\jline-0.9.94.jar;D:\zookeeper-3.4.12\bin\..\lib\log4j-1.2.17.jar;D:\zookeeper-3.4.12\bin\..\lib\netty-3.10.6.Final.jar;D:\zookeeper-3.4.12\bin\..\lib\slf4j-api-1.7.25.jar;D:\zookeeper-3.4.12\bin\..\lib\slf4j-log4j12-1.7.25.jar;D:\zookeeper-3.4.12\bin\..\conf
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:Environment@100] - Server environment:java.library.path=D:\jdk1.8.0_161\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;D:\app\chenjianfei\product\11.2.0\client_1\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;D:\jdk1.8.0_161\bin;D:\apache-maven-3.5.2\bin;D:\Git\cmd;D:\gradle-4.5\bin;D:\scala-2.12.6\bin;D:\zookeeper-3.4.12\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\chenjianfei\AppData\Local\Microsoft\WindowsApps;;.
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:Environment@100] - Server environment:java.io.tmpdir=C:\Users\CHENJI~1\AppData\Local\Temp\
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:Environment@100] - Server environment:java.compiler=<NA>
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:Environment@100] - Server environment:os.name=Windows 10
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:Environment@100] - Server environment:os.arch=amd64
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:Environment@100] - Server environment:os.version=10.0
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:Environment@100] - Server environment:user.name=chenjianfei
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:Environment@100] - Server environment:user.home=C:\Users\chenjianfei
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:Environment@100] - Server environment:user.dir=C:\Users\chenjianfei
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:ZooKeeperServer@835] - tickTime set to 2000
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:ZooKeeperServer@844] - minSessionTimeout set to -1
    2018-07-07 10:25:58,833 [myid:] - INFO  [main:ZooKeeperServer@853] - maxSessionTimeout set to -1
    2018-07-07 10:25:59,067 [myid:] - INFO  [main:ServerCnxnFactory@117] - Using org.apache.zookeeper.server.NIOServerCnxnFactory as server connection factory
    2018-07-07 10:25:59,067 [myid:] - INFO  [main:NIOServerCnxnFactory@89] - binding to port 0.0.0.0/0.0.0.0:2181

    3.IDEA 安装scala插件


    4.指定gradle插件位置

    5.IDEA导入kafka源码

        import 项目->选择gradle 完成


    6.kafka服务启动准备

    7.创建kafka producer启动准备

    8.创建kafka consumer启动准备

    9.依次启动

        kafka->producer->consumer

    10.在producer控制台输入hello kafka,可以在consumer接收到hello kafka




    展开全文
  • 1.3 win下Kafka源码环境搭建

    万次阅读 2021-03-20 11:29:38
    本文目的:1 搭建win下kafka调试环境,2,看kafka源码 1 本文环境 win10专业版 JDK 1.8 scala 2.13.4 gradle 3.5 kafka 1.0.0 源码 2 前置软件准备 2.1 JDK 安装省略(如果有本地有多个jdk环境,可以参考这里...

    本文目的:1 搭建win下kafka调试环境,2,看kafka源码

    1 本文环境

    1. win10专业版
    2. JDK 1.8
    3. scala 2.11.11
    4. gradle 4.8.1
    5. kafka 0.11.0.3-rc0 源码

    2 前置软件准备

    2.1 JDK

    安装省略(如果有本地有多个jdk环境,可以参考这里进行配置切换),检查版本如下
    在这里插入图片描述


    2.2 scala

    安装看这里,检查版本如下

    当前社区编译 Kafka 支持 3 个 Scala 版本,分别是 2.11、2.12 和 2.13。2.11 应该很快就会不支持了,而 2.13 又是刚刚推出的版本,因此我推荐你安装 Scala 2.11 版本。

    也可以先确定kafka版本,然后在kafka目录下的gradle.properties中看scalaVersion

    在这里插入图片描述

    2.3 gradle

    安装看这里(注意最好设置好远程私服地址+本地仓库地址),检查版本如下

    建议安装4.x版本的gradle,也可以先确定kafka版本,然后在build.gradle 里找到gradleVersion。即使该版本kafka建议对应的gradle版本

    在这里插入图片描述


    2.4 kafka源码

    1. 直接从官网下载,我下载的是kafka-1.0.0-src.tgz
    2. 从github上下载,然后切出自己想要的分支版本
    //clone 到本地
    >git clone https://github.com/bigData-lab/kafka.git
    //因为我要1.0.0版本的kafka,所以先看tag或远程的版本
    >git tag //查看标签
    >git branch -r //查看远程分支名
    
    >git checkout -b v0.11.0.3-rc0 0.11.0.3-rc0
    
    

    3 win下编译kafka

    3.1 scala版本检查

    首先确保gradle.properties配置文件中的scalaVersion与安装的一致。gradle.properties配置文件的细节如下:

    # Licensed to the Apache Software Foundation (ASF) under one or more
    # contributor license agreements.  See the NOTICE file distributed with
    # this work for additional information regarding copyright ownership.
    # The ASF licenses this file to You under the Apache License, Version 2.0
    # (the "License"); you may not use this file except in compliance with
    # the License.  You may obtain a copy of the License at
    #
    #    http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    
    group=org.apache.kafka
    # NOTE: When you change this version number, you should also make sure to update
    # the version numbers in tests/kafkatest/__init__.py and kafka-merge-pr.py.
    version=1.0.0
    scalaVersion=2.11.11
    task=build
    org.gradle.jvmargs=-XX:MaxPermSize=512m -Xmx1024m -Xss2m
    

    3.2 构建idea工程

    在kafka的目录下执行

    Gradlew是包装器,自动下载包装器里定义好的gradle 版本,保证编译环境统一,gradle 是用本地的gradle版本。

    // 1.因为我本地已经配置好了kafka所需的各种环境,所以直接gradle idea
    // 2. 我之前已经gradle idea过了,中间会有很多下载耗时较长(分钟级别)。下图展示仅仅是为了演示步骤
    >gradle idea
    

    如下图
    在这里插入图片描述


    4 配置Kafka源码环境

    前面几个步骤执行完成后就可以很舒适的阅读Kafka的源码,但是如果需要启动Kafka的服务还需要一些额外的步骤。

    4.1 导入idea

    1. 安装scala插件(之前已经安装了scala,所以下图是update)
      在这里插入图片描述

    2. 配置gradle

    在这里插入图片描述

    1. 导入编译后的kafka
      在这里插入图片描述

    2. 配置日志
      将config目录下的log4j.properties文件拷贝到core/src/main/scala目录下,这样可以让Kafka在运行时能够输出日志信息,可以参考下图:
      在这里插入图片描述
      修改修改log4j.properties,增加kafka日志路径kafka.logs.dir

    kafka.logs.dir=D:\\idea-workspace\\github\\kafka\\logs
    
    1. 配置server.properties文件
    # Licensed to the Apache Software Foundation (ASF) under one or more
    # contributor license agreements.  See the NOTICE file distributed with
    # this work for additional information regarding copyright ownership.
    # The ASF licenses this file to You under the Apache License, Version 2.0
    # (the "License"); you may not use this file except in compliance with
    # the License.  You may obtain a copy of the License at
    #
    #    http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    
    # see kafka.server.KafkaConfig for additional details and defaults
    
    ############################# Server Basics #############################
    
    # The id of the broker. This must be set to a unique integer for each broker.
    broker.id=0
    
    ############################# Socket Server Settings #############################
    
    # The address the socket server listens on. It will get the value returned from 
    # java.net.InetAddress.getCanonicalHostName() if not configured.
    #   FORMAT:
    #     listeners = listener_name://host_name:port
    #   EXAMPLE:
    #     listeners = PLAINTEXT://your.host.name:9092
    #listeners=PLAINTEXT://:9092
    
    # Hostname and port the broker will advertise to producers and consumers. If not set, 
    # it uses the value for "listeners" if configured.  Otherwise, it will use the value
    # returned from java.net.InetAddress.getCanonicalHostName().
    #advertised.listeners=PLAINTEXT://your.host.name:9092
    
    # Maps listener names to security protocols, the default is for them to be the same. See the config documentation for more details
    #listener.security.protocol.map=PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL
    
    # The number of threads that the server uses for receiving requests from the network and sending responses to the network
    num.network.threads=3
    
    # The number of threads that the server uses for processing requests, which may include disk I/O
    num.io.threads=8
    
    # The send buffer (SO_SNDBUF) used by the socket server
    socket.send.buffer.bytes=102400
    
    # The receive buffer (SO_RCVBUF) used by the socket server
    socket.receive.buffer.bytes=102400
    
    # The maximum size of a request that the socket server will accept (protection against OOM)
    socket.request.max.bytes=104857600
    
    
    ############################# Log Basics #############################
    
    # A comma seperated list of directories under which to store log files
    log.dirs=D:\\idea-workspace\\github\\kafka\\logs\\kafka-logs
    
    # The default number of log partitions per topic. More partitions allow greater
    # parallelism for consumption, but this will also result in more files across
    # the brokers.
    num.partitions=1
    
    # The number of threads per data directory to be used for log recovery at startup and flushing at shutdown.
    # This value is recommended to be increased for installations with data dirs located in RAID array.
    num.recovery.threads.per.data.dir=1
    
    ############################# Internal Topic Settings  #############################
    # The replication factor for the group metadata internal topics "__consumer_offsets" and "__transaction_state"
    # For anything other than development testing, a value greater than 1 is recommended for to ensure availability such as 3.
    offsets.topic.replication.factor=1
    transaction.state.log.replication.factor=1
    transaction.state.log.min.isr=1
    
    ############################# Log Flush Policy #############################
    
    # Messages are immediately written to the filesystem but by default we only fsync() to sync
    # the OS cache lazily. The following configurations control the flush of data to disk.
    # There are a few important trade-offs here:
    #    1. Durability: Unflushed data may be lost if you are not using replication.
    #    2. Latency: Very large flush intervals may lead to latency spikes when the flush does occur as there will be a lot of data to flush.
    #    3. Throughput: The flush is generally the most expensive operation, and a small flush interval may lead to exceessive seeks.
    # The settings below allow one to configure the flush policy to flush data after a period of time or
    # every N messages (or both). This can be done globally and overridden on a per-topic basis.
    
    # The number of messages to accept before forcing a flush of data to disk
    #log.flush.interval.messages=10000
    
    # The maximum amount of time a message can sit in a log before we force a flush
    #log.flush.interval.ms=1000
    
    ############################# Log Retention Policy #############################
    
    # The following configurations control the disposal of log segments. The policy can
    # be set to delete segments after a period of time, or after a given size has accumulated.
    # A segment will be deleted whenever *either* of these criteria are met. Deletion always happens
    # from the end of the log.
    
    # The minimum age of a log file to be eligible for deletion due to age
    log.retention.hours=168
    
    # A size-based retention policy for logs. Segments are pruned from the log unless the remaining
    # segments drop below log.retention.bytes. Functions independently of log.retention.hours.
    #log.retention.bytes=1073741824
    
    # The maximum size of a log segment file. When this size is reached a new log segment will be created.
    log.segment.bytes=1073741824
    
    # The interval at which log segments are checked to see if they can be deleted according
    # to the retention policies
    log.retention.check.interval.ms=300000
    
    ############################# Zookeeper #############################
    
    # Zookeeper connection string (see zookeeper docs for details).
    # This is a comma separated host:port pairs, each corresponding to a zk
    # server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002".
    # You can also append an optional chroot string to the urls to specify the
    # root directory for all kafka znodes.
    zookeeper.connect=localhost:2181
    
    # Timeout in ms for connecting to zookeeper
    zookeeper.connection.timeout.ms=6000
    
    
    ############################# Group Coordinator Settings #############################
    
    # The following configuration specifies the time, in milliseconds, that the GroupCoordinator will delay the initial consumer rebalance.
    # The rebalance will be further delayed by the value of group.initial.rebalance.delay.ms as new members join the group, up to a maximum of max.poll.interval.ms.
    # The default value for this is 3 seconds.
    # We override this to 0 here as it makes for a better out-of-the-box experience for development and testing.
    # However, in production environments the default value of 3 seconds is more suitable as this will help to avoid unnecessary, and potentially expensive, rebalances during application startup.
    group.initial.rebalance.delay.ms=0
    
    
    # 是否允许topic被删除,设置为true则topic可以被删除,
    # 开启这个功能方便Kafka在运行一段时间之后,能够删除一些不需要的临时topic
    delete.topic.enable=true
    # 禁用自动创建topic的功能
    auto.create.topics.enable=false
    

    漫长的构建过程

    在这里插入图片描述

    1. 配置kafka启动参数

    这里配置Main class为kafka.Kafka,并制定启动时所需要的配置文件地址,即:config/server.properties。配置JMX_PORT是为了方便搜集Kafka自身的Metrics数据

    在这里插入图片描述

    在这里插入图片描述


    5 Zookeeper的安装、配置及启动

    Kafka需要使用Zookeeper来管理元数据,比如记录topic、partitions(分区)以及replica(副本)的分配信息。

    所以这里的Zookeeper的安装也以极简为主(详细安装见这里),即采用单机配置。Zookeeper下载地址为:http://zookeeper.apache.org/releases.html,下载之后解压,然后将conf/zoo_sample.cfg重命名为zoo.cfg,其中$ZOOKEEPER_HOME指的是ZooKeeper的根目录。

    修改$ZOOKEEPER_HOME/conf/zoo.cfg配置,示例配置如下(其余配置可以不做修改):

    # The number of milliseconds of each tick
    tickTime=2000
    # The number of ticks that the initial 
    # synchronization phase can take
    initLimit=10
    # The number of ticks that can pass between 
    # sending a request and getting an acknowledgement
    syncLimit=5
    # the directory where the snapshot is stored.
    # do not use /tmp for storage, /tmp here is just 
    # example sakes.
    dataDir=D:\\ProgramFiles\\zookeeper-3.4.12\\data
    dataLogDir=D:\\ProgramFiles\\zookeeper-3.4.12\\logs
    # the port at which the clients will connect
    clientPort=2181
    # the maximum number of client connections.
    # increase this if you need to handle more clients
    #maxClientCnxns=60
    #
    # Be sure to read the maintenance section of the 
    # administrator guide before turning on autopurge.
    #
    # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
    #
    # The number of snapshots to retain in dataDir
    #autopurge.snapRetainCount=3
    # Purge task interval in hours
    # Set to "0" to disable auto purge feature
    #autopurge.purgeInterval=1
    

    简要介绍 zoo.cfg 文件

    • tickTime:默认3000ms,作一种基本单元,用它的倍数来表示系统内部的时间间隔配置,比如
    • 2*tickTime 是客户端会话的超时时间
    • 1*tickTime 是客户端 zk 服器端的心跳时
    • dataDir:无默认配置,必配置;用于配置储快照文件的目录,如果没有配置 dataLogDir,那么事务日志也会储在目录
    • clientPort:zk 的运行端口,默认是 2181
      启动
    Windows:直接双击 zkServer.cmd
    Linux: zkServer.sh start
    

    在这里插入图片描述

    如果zk不是默认的,需要修改 kafka的config/server.poroperties 文件的zookeeper.connect属性


    最后kafka启动成功

    在这里插入图片描述


    6 使用kafka

    1. 启动zk
    2. 从idea中启动kafka.scala (相当kafka的server)
    3. 创建topic
    --create -topic waterWang-test --zookeeper localhost:2181 --partitions 2 --replication-factor 1
    

    如下图填写配置
    在这里插入图片描述
    创建topic成功
    在这里插入图片描述

    展开全文
  • 比如 2.8,这是因为去掉了 ZooKeeper,还不太稳定,生产环境也不太建议使用,所以以 2.7 版本进行源码搭建并研究。 二、环境准备 JDK:1.8.0_241 Scala:2.13.6 Gradle:5.6.3 三、环境搭建 3.1 JDK 环境搭建 这个...
  • Kafka源码环境搭建

    2019-04-13 14:19:55
    Kafka源码环境搭建https://blog.csdn.net/u013256816/article/details/78533725版权声明:本文为博主原创文章,未经博主朱小厮允许不得转载。 https://blog.csdn.net/u013256816/article/details/78533725 欢迎...
  • 2、源码环境搭建 2.1 环境准备: 环境:jdk1.8 scala2.12(2.13上坑较多)kafka2.0 gradle4.9 (由于坑太多,已换为gradle4.9,以后再也不敢用新版的坑了,踩坑花了不少时间) gradle所有版本下载:https://s..
  • kafka源码环境的搭建

    2021-04-30 00:09:31
    一:kafka源码环境的搭建
  • 搭建Kafka源码环境搭建过程新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants...
  • 1.官网下载kafka源码包,http://kafka.apache.org/downloads,这里版本为0.11.0.1。 2.下载下来的源码执行gradle idea,没有安装gradle的需要先安装。生成Idea工程并导入 3.kafka是scala编写,因此需要安装scala...
  • Kafka 源码环境搭建

    2019-05-10 09:53:55
    所以为了省去一些不必要的麻烦,还是建议读者在安装Scala版本之前先查看下Kafka源码中gradle.properties文件中配置的scalaVersion。 再确保了scalaVersion之后,需要将config目录下的log4j.properties文件拷贝到...
  • 1、前置安装包 需安装 JDK 1.8 、 Gradle 3.1 Scala 2.10 scala下载地址 ... 2、在windows上部署和启动zookeeper ... 修改下zoo.cfg文件 ...3、使用gradle来构建Kafka源码 使用命令 gradl

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 9,881
精华内容 3,952
关键字:

kafka源码搭建