• Linux安装kafka

    2018-08-31 16:54:19
    三、安装kafka 1、下载kafka cd /usr/local/src wget http://archive.apache.org/dist/kafka/0.8.2.1/kafka_2.11-0.8.2.1.tgz 注意,kafka_2.11-0.8.2.1.tgz版本是已经编译好的版本,解压就能使用。 tar -xzvf ...

    三、安装kafka

    1、下载kafka

    cd /usr/local/src

    wget http://archive.apache.org/dist/kafka/0.8.2.1/kafka_2.11-0.8.2.1.tgz

    注意,kafka_2.11-0.8.2.1.tgz版本是已经编译好的版本,解压就能使用。

    tar -xzvf kafka_2.11-0.8.2.1.tgz #解压

    mv kafka_2.11-0.8.2.1 /usr/local/kafka #移动到安装目录

    2、配置kafka

    mkdir /usr/local/kafka/log/kafka #创建kafka日志目录

    cd /usr/local/kafka/config #进入配置目录

    vi server.properties #编辑修改相应的参数

    broker.id=0

    port=9092 #端口号

    host.name=192.168.5.56 #服务器IP地址,修改为自己的服务器IP

    log.dirs=/usr/local/kafka/log/kafka #日志存放路径,上面创建的目录

    zookeeper.connect=localhost:2181 #zookeeper地址和端口,单机配置部署,localhost:2181

    :wq! #保存退出

    3、配置zookeeper

    mkdir /usr/local/kafka/zookeeper #创建zookeeper目录

    mkdir /usr/local/kafka/log/zookeeper #创建zookeeper日志目录

    cd /usr/local/kafka/config #进入配置目录

    vi zookeeper.properties #编辑修改相应的参数

    dataDir=/usr/local/kafka/zookeeper #zookeeper数据目录

    dataLogDir=/usr/local/kafka/log/zookeeper #zookeeper日志目录

    clientPort=2181

    maxClientCnxns=100

    tickTime=2000

    initLimit=10

    syncLimit=5

    :wq! #保存退出

    四、创建启动、关闭kafka脚本

    cd /usr/local/kafka

    #创建启动脚本

    vi kafkastart.sh #编辑,添加以下代码

    #!/bin/sh

    #启动zookeeper

    /usr/local/kafka/bin/zookeeper-server-start.sh /usr/local/kafka/config/zookeeper.properties &

    sleep 3 #等3秒后执行

    #启动kafka

    /usr/local/kafka/bin/kafka-server-start.sh /usr/local/kafka/config/server.properties &

    :wq! #保存退出

    #创建关闭脚本

    vi kafkastop.sh #编辑,添加以下代码

    #!/bin/sh

    #关闭zookeeper

    /usr/local/kafka/bin/zookeeper-server-stop.sh /usr/local/kafka/config/zookeeper.properties &

    sleep 3 #等3秒后执行

    #关闭kafka

    /usr/local/kafka/bin/kafka-server-stop.sh /usr/local/kafka/config/server.properties &

    :wq! #保存退出

    #添加脚本执行权限

    chmod +x kafkastart.sh

    chmod +x kafkastop.sh

    五、设置脚本开机自动执行

    vi /etc/rc.d/rc.local #编辑,在最后添加一行

    sh /usr/local/kafka/kafkastart.sh & #设置开机自动在后台运行脚本

    :wq! #保存退出

    sh /usr/local/kafka/kafkastart.sh #启动kafka

    sh /usr/local/kafka/kafkastop.sh #关闭kafka

    至此,Linux下Kafka单机安装配置完成。

    展开全文
  • 环境准备 JDK:建议版本在 1.7 及以上...ZooKeeper:Kafka 的安装包中自带 zookeeper,但并不建议使用之,最好另外自行部署一个 zookeeper 环境。 (安装步骤略) 下载Kafka 下载地址:http://kafka.apache.org...

    环境准备

    • JDK:建议版本在 1.7 及以上,否则可能会报如下错误:java.lang.UnsupportedClassVersionError
      (安装步骤略)

    • ZooKeeper:Kafka 的安装包中自带 zookeeper,但并不建议使用之,最好另外自行部署一个 zookeeper 环境。
      (安装步骤略)

    下载Kafka

    下载地址:http://kafka.apache.org/downloads
    本文下载的是当前最新的稳定版:kafka_2.11-1.0.0.tgz

    部署Kafka(单节点)

    修改配置

    • 解压安装包到指定目录下
    tar -zxvf kafka_2.11-1.0.0.tgz -C /home/kafka/
    • 修改配置信息
      打开配置文件
    vi /home/kafka/kafka_2.11-1.0.0/config/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=/tmp/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
    
    • 修改如下配置:

      • 监听器列表
        将 #listeners=PLAINTEXT://:9092 的注释打开即为:
        listeners=PLAINTEXT://:9092
      • 发布在zk上的监听器,供客户端使用
        将 #advertised.listeners=PLAINTEXT://your.host.name:9092 的注释打开,且把 your.host.name 修改成本机的 IP 即为:
        advertised.listeners=PLAINTEXT://158.222.189.76:9092
        注:虽然把 your.host.name 修改成 IP 不够高大上,但是改成对应的主机名时,则须要在对应 client 端机器的 hosts 配置该主机名,极为不便。

      • zookeeper 连接信息
        将 zookeeper.connect=localhost:2181 修改到预计的zookeeper server 上,即为:
        zookeeper.connect=158.222.189.76:2181
        注:若 zookeeper 与 kafka 存在同一机器上,则可不改。

      • 日志目录(可选)
        默认日志存放在 /tmp/kafka-logs 目录下,但 /tmp 目录为 临时文件目录,在重启时会清空该目录,建议修改成其他目录:
        log.dirs=/home/kafka/kafka_2.11-1.0.0/kafka-logs

    启动与停止

    # 进入到 Kafka 的 KAFKA_HOME 目录下:
    cd /home/kafka/kafka_2.11-1.0.0
    # 启动 Kafka 服务
    bin/kafka-server-start.sh config/server.properties
    # 停止 Kafka 服务
    bin/kafka-server-stop.sh

    看到类似如下日志表示启动成功:

    INFO Kafka version : 1.0.0 (org.apache.kafka.common.utils.AppInfoParser)
    INFO Kafka commitId : aaa7af6d4a11b29d (org.apache.kafka.common.utils.AppInfoParser)
    INFO [KafkaServer id=0] started (kafka.server.KafkaServer)
    
    # 后台启动 Kafka
    bin/kafka-server-start.sh config/server.properties &

    部署 Kafka 集群

    Kafka 集群环境的部署与单节点相差无几,同在 config/server.properties 配置文件中仅多出如下步骤:

    • 多节点
      在不同的物理机上都需要一份部署一个 Kafka server(若多个 server 部署在同一机器上,则称为:伪集群)。

    • broker 编号
      配置文件中默认为 0,集群环境需要每个物理节点都不相同,即:若节点 A 为 broker.id=0 那么节点 B 为 broker.id=1,节点 C 为 broker.id=2
      broker.id 的取值范围非负的整数。

    • zookeeper 连接
      连接到指定的 zookeeper server 上(多个以英文逗号分隔)。
      zookeeper.connect=IP1:2181,IP2:2181,IP3:2181

    展开全文
  • 1.使用的是centos 7 从http://kafka.apache.org/downloads.html下载,点击里面的二进制... tar -xzvf kafka_2.10-0.9.0.0.tgz 3.配置下conf下面的文件不然会容易报错: 1)https://blog.csdn.net/xukaics/artic...

    1.使用的是centos 7

    http://kafka.apache.org/downloads.html下载,点击里面的二进制路径,然后再linux上输入weget 路径,就会自己下载

    2.解压

     tar -xzvf kafka_2.10-0.9.0.0.tgz

    3.配置下conf下面的文件不然会容易报错:

    1)https://blog.csdn.net/xukaics/article/details/48543881

    内存不足引起的,修改方法:修改conf下kafka-server-start.shzookeeper-server-start.sh这2个

    使用vi kafka-server-start.sh

    原来:

    export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G"
    

    修改:

    export KAFKA_HEAP_OPTS="-Xmx256M -Xms128M"
    

    2)还有一个报错:

    在producer的console端输入字符串,consumer报Connection refused错误

    解决方案:

     broker, producer和consumer都注册到zookeeper上,producer和consumer的参数明确指定。问题出在broker的配置文件server.properties上:
    
                    # Hostname the broker will bind to. If not set, the server will bind to all interfaces
                    #host.name=localhost
    
            host名称没有指定,就是127.0.0.1,consumer去broker拿数据就有问题。设置为具体服务器ip地址,重启服务就好了

    4.启动服务:

    启动Zookeeper server:

                    bin/zookeeper-server-start.sh config/zookeeper.properties &

                    &是为了能退出命令行

            启动Kafka server:

                    bin/kafka-server-start.sh config/server.properties &

            停止Kafka server:

                    bin/kafka-server-stop.sh

            停止Zookeeper server: 

                    bin/zookeeper-server-stop.sh

    5.创建topic(kafka自带的创建消息生产者,消费消息者)

    bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test

    这个跟其他mq一样,都有有一个topic,然后接收方根据这个topic进行接收

    >this is dajitui 

    >hhh

    这个是输入消息的过程

     

    消费:bin/kafka-console-consumer.sh --zookeeper localhost:2181 —topic test

    会输出你刚刚输入的2条消息

     

    程序的话可以看下:https://blog.csdn.net/tangdong3415/article/details/53432166

    springboot版本的集成https://blog.csdn.net/weixin_38336658/article/details/81432920

    展开全文
  • linux下启动kafka

    2018-09-20 16:08:12
    记录下kafka启动过程,适合傻瓜新手,想弄明白原理的请绕到官网查看文档。 1、首先下载从github上下载 源码。如果机器上装有Git,直接clone更好,省的再解压。 解压命令:tar -zxvf librdkafka-master.tgz 2、...

    前记:墨迹了几天,仍是云里雾里。记录下kafka启动过程,适合傻瓜新手,想弄明白原理的请绕到官网查看文档。

    1、首先下载从github上下载 源码。如果机器上装有Git,直接clone更好,省的再解压。

    解压命令:tar -zxvf librdkafka-master.tgz

    2、下载 lib库。然后解压。与源码置于同意文件夹下。两个版本二选一即可。

    解压命令:tar -zxvf kafka_2.11-0.10.2.0.tgz

    3、我放置源码的目录是:/opt/app/ets/etsalessrc/fy_kafka/librdkafka-master;

    lib文件放置目录为:/opt/app/ets/etsalessrc/fy_kafka/kafka_2.11-0.10.2.0

    为了省事,直接用root账户办接下来的事情。键入命令:su - root,回车,输入root密码。

    4、预备工作完事。开始编译源码。

    先赋予权限:/opt/app/ets/etsalessrc目录下,命令:chmod 777 -R fy_kafka

    进入目录:cd fy_kafka/librdkafka-master/

    编译和安装,依次命令:

    ./configure

    make

    make install

    5、到此,源码处理结束。

    进入目录:/opt/app/ets/etsalessrc/fy_kafka/kafka_2.11-0.10.2.0/config

    修改文件server.properties,将34行首个字符 ‘#’ 号去掉

    6、进入目录:/opt/app/ets/etsalessrc/kafka_2.11-0.10.2.0

    依次执行:./bin/zookeeper-server-start.sh config/zookeeper.properties &,启动zookeeper(&是为了能退出命令行)

    ./bin/kafka-server-start.sh config/server.properties &,启动kafka

    查看端口:netstat -tunlp|egrep "(2181|9092)"

    或者单独查看9092端口:netstat -ant | grep 9092

    查看服务启动情况:jps

    新开的服务QuorumPeerMain是指zookeeper的进程。Kafka是指kafka的进程。

    7、创建主题 XML2DIP:

    ./bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic XML2DIP

    查看主题是否创建结果:

    ./bin/kafka-topics.sh --list --zookeeper localhost:2181

    8、创建生产者:

    ./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic XML2DIP

    9、另开一个终端页面,创建消费者:

    ./bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic XML2DIP

    10、生产者页面随意输入消息回车,可以看到消费者页面出现输入的消息。

    注:消费者开启前,在生产者页面输入的消息,消费者页面不显示。若要查看所有消息,输入命令:

    ./bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic XML2DIP --from-beginning

    关于kafka生产者和消费者的示例代码,在librdkafka里有示例。

    1、C语言可参考代码:https://blog.csdn.net/lijinqi1987/article/details/76582067/,写的挺不错的

    在运行my_producer或my_consumer时可能会报错"error while loading shared libraries xxx.so", 这是因为make的时候将librdkafak.so.1放在了/usr/local/lib下,在Linux的默认共享库路径/lib和/usr/lib下找不到,只要执行下面两句就可以了:

       echo "/usr/local/lib" >> /etc/ld.so.conf
       ldconfig

    因为我建的topic名字是XML2DIP,所以生产者启动命令是:./my_producer localhost:9092 XML2DIP

    消费者启动命令是:./my_consumer localhost:9092 XML2DIP

    2、C++可参考代码:https://blog.csdn.net/jfu22/article/details/78194015

    我将这里面提供的几个代码文件放在目录/opt/app/ets/etsalessrc/fy_kafka/kafka_inter下进行编译,凡是提示错误的直接注释(因为是输出字符串的代码,注释无影响。另外头文件引用路径改成自己的路径;接口改为“localhost:9092”,topic改为XML2DIP)。

    编译命令为:g++ KafkaProducer.cpp Producer.cpp -o Producer -lrdkafka -lz -lpthread -lrt

    执行前先开启XML2DIP的topic。执行命令:./Producer。然后在消费者上面就可以看到代码里写入的字符串了。

    展开全文
  • Linux安装Kafka

    2019-06-11 09:42:37
    本文介绍Linux安装Kafka。 1.Kafka简介 Kafka也是开源与Apache开源基金会的项目,由Scala和Java编写。Kafka是一种高吞吐量的分布式发布订阅消息系统。 在百度百科是这样介绍的: Kafka是由Apache软件基金会开发的...

    本文介绍Linux安装Kafka。

    1.Kafka简介

    Kafka也是开源与Apache开源基金会的项目,由Scala和Java编写。Kafka是一种高吞吐量的分布式发布订阅消息系统。

    在百度百科是这样介绍的:

    Kafka是由Apache软件基金会开发的一个开源流处理平台,由Scala和Java编写。Kafka是一种高吞吐量的分布式发布订阅消息系统,它可以处理消费者规模的网站中的所有动作流数据。 这种动作(网页浏览,搜索和其他用户的行动)是在现代网络上的许多社会功能的一个关键因素。 这些数据通常是由于吞吐量的要求而通过处理日志和日志聚合来解决。 对于像Hadoop的一样的日志数据和离线分析系统,但又要求实时处理的限制,这是一个可行的解决方案。Kafka的目的是通过Hadoop的并行加载机制来统一线上和离线的消息处理,也是为了通过集群来提供实时的消息。

    Kafka官网地址为:http://kafka.apache.org/,感兴趣的可以多多查看官网文档。

    2.准备工作

    2.1 安装环境

    本文所安装的Kafka为2.10版本,Linux系统版本为CentOS 7.2,使用Zookeeper是Kafka自带的,安装目录为/usr/local/software/。

    2.2 准备工具

    1.Java

    Kafka是依赖Java环境运行,所以需要在Linux系统内安装Java环境。

    2.安装Kafka

    步骤大致分为如下几步:

    2.1 下载Kafka

    wget http://labfile.oss.aliyuncs.com/courses/859/kafka_2.10-0.10.2.1.tgz
    

    2.2 解压Kafka

    tar -zxvf kafka_2.10-0.10.2.1.tgz 
    

    2.3 进入配置文件目录

    cd /usr/local/software/kafka_2.10-0.10.2.1/config
    

    2.4 修改配置文件server.properties,添加下面内容:

    broker.id=0
    port=9092 #端口号
    host.name=172.30.0.9 #服务器IP地址,修改为自己的服务器IP
    log.dirs=/usr/local/logs/kafka #日志存放路径,上面创建的目录
    zookeeper.connect=localhost:2181 #zookeeper地址和端口,单机配置部署,localhost:2181
    

    2.5 编写启动脚本

    vi kafkastart.sh
    
    #启动zookeeper
    /usr/local/software/kafka_2.10-0.10.2.1/bin/zookeeper-server-start.sh /usr/local/software/kafka_2.10-0.10.2.1/config/zookeeper.properties &
    #等3秒后执行
    sleep 3 
    #启动kafka
    /usr/local/software/kafka_2.10-0.10.2.1/bin/kafka-server-start.sh /usr/local/software/kafka_2.10-0.10.2.1/config/server.properties &
    

    2.6 编写关闭脚本

    vi kafkastop.sh
    
    #关闭zookeeper
    /usr/local/software/kafka_2.10-0.10.2.1/bin/zookeeper-server-stop.sh /usr/local/software/kafka_2.10-0.10.2.1/config/zookeeper.properties &
    #等3秒后执行
    sleep 3 
    #关闭kafka
    /usr/local/software/kafka_2.10-0.10.2.1/bin/kafka-server-stop.sh /usr/local/software/kafka_2.10-0.10.2.1/config/server.properties &
    

    2.7 启动脚本,关闭脚本赋予权限

    chmod 777 kafkastart.sh
    
    chmod 777 kafkastop.sh
    

    3.安装问题

    安装Kafka过程中没有遇到太大的问题,一路输入就通过了。

    4.可视化管理页面安装

    kafka官网地址:https://github.com/linkedin/kafka-monitor,运行比较简单,只是一个可执行jar(KafkaOffsetMonitor-assembly-0.2.1.jar)。

    4.1 编写启动脚本

    java -Xms128M -Xmx128M -Xss1024K -XX:PermSize=128m -XX:MaxPermSize=128m -cp KafkaOffsetMonitor-assembly-0.2.1.jar com.quantifind.kafka.offsetapp.OffsetGetterWeb --zk localhost:2181 --port 8787 --refresh 10.seconds --retain 7.days 1>/usr/local/software/kafka-monitor/stdout.log 2>/usr/local/software/kafka-monitor/stderr.log &
    

    5.总结

    以上安装都是经过本人亲测可用的,安装过程还是比较简单。

    展开全文
  • kafka的安装及使用需要用到ZooKeeper,所以需要提前安装搭建好ZooKeeper ZooKeeper在Linux下载安装及部署:https://blog.csdn.net/Eternal_Blue/article/details/94762494 - - - --- - - --- - - --- - - --- - ...
  • linux下搭建kafka环境

    2018-05-21 15:08:26
    1、下载kafkahttps://www.apache.org/dyn/closer.cgi?path=/kafka/1.1.0/kafka_2.11-1.1.0.tgz2、上传至linux下并解压3、启动服务3.1、启动zookeeper(启动zk有两种方式,第一种是使用kafka自己带的一个zk。...
  • linux安装kafka

    2019-06-14 14:20:37
    今天来安装kafka 安装kafka前台必须安装zookeeper 不会安装请移步:点我快速进入安装zookeeper文章 一、安装kafka 下载kafka两种方式 1、手动下载 下载地址:http://kafka.apache.org/downloads 下载...
  • 1、https://mirrors.tuna.tsinghua.edu.cn/apache/kafka/ 下载安装文件 我这里下载版本是 kafka_2.10-0.10.2.1.tgz 2、解压安装文件 tar -zxvf kafka_2.10-0.10.2.1.tgz -C /usr/local 3、修改文件夹名字 mv /usr...
  • Kafka Linux环境搭建

    2019-04-29 10:35:30
    Kafka Linux环境搭建 一: 安装JDK1.8 二: 安装Zookeeper 三: 安装Kafka 四: 先启动Zookeeper再启动Kafka 五: 创建主题,生产者,消费者 一: 安装JDK1.8 1:下载jdk压缩包,使用xftp工具放到Linux中,然后解压 在Linux中...
  • 生产命令 ...在linux运行kafka bin/kafka-server-start ../config/server.properties 生产命令 1.创建一个topic KAFKA_HOME/bin/kafka-topics.sh --create --zookeeper 127.0.0.1:2181 --repli...
  • Kafka linux集群部署

    2016-06-07 18:17:39
    Kafka linux集群部署
  • 求关于kafkaLinux 命令行下的java客户端详细编译步骤,网上直看到些程序代码但是具体编译过程很少
  • 第三次安装了,必须做个记录了 首先安装jdk 只要一条命令 简单又好用 yum install java-1.8.0-openjdk* -y 然后需要安装 rz sz 还是yum sudo yum install lrzsz -y ...先安装zookeeper,先把安装包上传到服务器...
  • linuxkafka

    2020-07-09 23:30:27
    linux下部署kafka所需压缩包 版本是kafka_2.11-2.0.1.tgz
  • kafka 相关Linux 命令

    2019-01-08 15:23:01
    ./kafka-topics.sh --create --zookeeper 162-1-115-130:24002,162-1-115-131:24002,162-1-115-132:24002/kafka --partitions 6 --replication-factor 2 --topic ttttt 消费tpoic ./kafka-console-consumer.sh...
  • 1,开启zookeeper集群 startzk.sh ...2,开启kafka可视化界面 kafka-manager : start-kafka-manager.sh 3,生产者操作: kafka-console-producer.sh --broker-list node1:9092 --topic my-kafka-topic //m...
  • LinuxKafka部署

    2019-05-24 17:32:13
    Kafka的运行依赖于zookeeper,请先确保服务器环境里已有zookeeper运行,zookeeper配置文档请查看我的另一篇文章——Linux之zookeeper安装部署 单台机子简单验证Kafka是否可行 参照官网教程即可,需要打开三个终端...
  • /bin/sh # # chkconfig: 345 99 01 # description: Kafka # # File : Kafka # # Description: Starts and stops the Kafka server # source /etc/rc.d/init.d/functions KAFKA_HOME=/opt...
  • linux中如何操作kafka

    2020-07-06 17:13:31
    kafka常用操作命令,启动,新增topic,删除topic,查看topic列表
1 2 3 4 5 ... 20
收藏数 30,009
精华内容 12,003
关键字:

kafka linux