zoukankan      html  css  js  c++  java
  • Apache-kafka以及zookeepeer单机安装

    因为重新做了一个所以记录一下,这里先不介绍集群安装

    环境需求:jdk1.8+

    一、安装Zookeepeer

    官网地址:http://kafka.apache.org/downloads.html,下载对应版本

    [root@ecs- ~]# wget https://mirror.bit.edu.cn/apache/kafka/2.6.0/kafka_2.12-2.6.0.tgz
    --2020-09-07 09:29:18--  https://mirror.bit.edu.cn/apache/kafka/2.6.0/kafka_2.12-2.6.0.tgz
    Resolving mirror.bit.edu.cn (mirror.bit.edu.cn)... 219.143.204.117, 202.204.80.77, 2001:da8:204:1205::22
    Connecting to mirror.bit.edu.cn (mirror.bit.edu.cn)|219.143.204.117|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 65671917 (63M) [application/octet-stream]
    Saving to: ‘kafka_2.12-2.6.0.tgz’
    
    100%[====================================================================================================>] 65,671,917  12.0MB/s   in 6.7s
    
    2020-09-07 09:29:25 (9.38 MB/s) - ‘kafka_2.12-2.6.0.tgz’ saved [65671917/65671917]
    
    [root@ecs ~]# tar -zxvf kafka_2.12-2.6.0.tgz
    [root@ecs ~]# mv kafka_2.12-2.6.0 /opt
    [root@ecs ~]# cd /opt/kafka_2.12-2.6.0/conifg
    [root@ecs config]# vim zookeeper.properties
    
    

    
    dataDir=/data/zookeeper kfk data
    # the port at which the clients will connect
    clientPort=2181
    # disable the per-ip limit on the number of connections since this is a non-production config
    maxClientCnxns=0
    maxClientCnxns=0
    tickTime=2000
    initLiimit=10
    svncLimit=5
    # Disable the adminserver by default to avoid port conflicts.
    # Set the port to something non-conflicting if choosing to enable this
    admin.enableServer=false
    # admin.serverPort=8080
    
    

    启动一下

    [root@ecs config]# nohup /opt/kafka_2.12-2.6.0/bin/zookeeper-server-start.sh /opt/kafka_2.12-2.6.0/config/zookeeper.properties &>> /opt/kafka_2.12-2.6.0/zookeeper.log &
    

    查看日志没问题zookeepeer及OK

    二、kafka配置

    [root@ecs config]# cd /opt/kafka_2.12-2.6.0/
    [root@ecs kafka_2.12-2.6.0]# mkdir kafka-logs-1
    [root@ecs kafka_2.12-2.6.0]# cd /opt/kafka_2.12-2.6.0/config/
    [root@ecs config]# vim server.properties
    
    

    启动一下

    [root@ecs config]# nohup /opt/kafka_2.12-2.6.0/bin/kafka-server-start.sh /opt/kafka_2.12-2.6.0/config/server.properties &>> /opt/kaf     ka_2.12-2.6.0/kafka.log &
    
    

    测试一下

    [root@ecs-88e7-0006 config]# /opt/kafka_2.12-2.6.0/bin/kafka-topics.sh --create --zookeeper 127.0.0.1:3181 --replication-factor 1 --partitions      1 --topic test
    Created topic test.
    

    OK

  • 相关阅读:
    iis WebSocket 搭建环境及配置
    RESTful API 设计最佳实践
    laravel/lumen 单元测试
    后台管理UI的选择
    lumen Response
    计算机网络——OSI、TCP/IP协议族详解
    Java中'&'与、'|'或、'^'异或、'<<'左移位、'>>'右移位
    Servlet、Struts2、SpringMVC执行流程
    final修饰符,finally,finalize区别
    JSP的九个隐式(内置)对象
  • 原文地址:https://www.cnblogs.com/shook/p/13625750.html
Copyright © 2011-2022 走看看