kafka流处理

Kafka
bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties
bin/kafka-topics.sh --list --zookeeper localhost:2181
bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic seven
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic seven
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic seven --from-beginning
vim /usr/local/etc/kafka/server.properties
brew services start zookeeper
brew services start kafka
zkServer start
kafka-server-start /usr/local/etc/kafka/server.properties
kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
kafka-console-producer --broker-list localhost:9092 --topic test
kafka-console-consumer --bootstrap-server localhost:9092 --topic test --from-beginning
kafka-console-consumer --bootstrap-server localhost:9092 --topic test --group test-consumer1 --from-beginning

#kafka# #mac# #run#

评论3

  • docker-compose scale kafka=3
    docker exec kafka_kafka_1 find / -name \*kafka_\* | head -1 | grep -o '\kafka[^\n]*’
    docker exec kafka_zookeeper_1 pwd
    docker exec kafka_kafka_1 \
    kafka-topics.sh \
    --create --topic topic001 \
    --partitions 4 \
    --zookeeper zookeeper:2181 \
    --replication-factor 2
    docker exec kafka_kafka_1 kafka-topics.sh --list --zookeeper zookeeper:2181

    2019-12-10 10:11:45 回复
  • version: '3'
    services:
    zookeeper:
    image: wurstmeister/zookeeper
    ports:
    - "2181:2181"
    kafka:
    image: wurstmeister/kafka
    ports:
    - "9092:9092"
    environment:
    KAFKA_ADVERTISED_HOST_NAME: 192.168.1.103
    # KAFKA_LISTENERS: SASL_PLAINTEXT://:9092
    # KAFKA_ADVERTISED_LISTENERS: SASL_PLAINTEXT://localhost:9092
    # KAFKA_OPTS: "-Djava.security.auth.login.config=/etc/kafka/kafka_server_jaas.conf"
    # KAFKA_INTER_BROKER_LISTENER_NAME: SASL_PLAINTEXT
    # KAFKA_SASL_ENABLED_MECHANISMS: PLAIN
    # KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL: PLAIN
    KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock
    - ./kafka_server_jaas.conf:/etc/kafka/kafka_server_jaas.conf
    links:
    - zookeeper
    depends_on:
    - zookeeper

    2019-12-10 10:13:12 回复
  • KAFKA_LISTENERS: PLAINTEXT://:9092
    KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka.sqeven.com:9092

    2019-12-10 10:14:05 回复
评论请先登录

最近热帖

  1. PPS代理节点池 69658
  2. PPS代理节点池② 26707
  3. 订阅池记录 8021
  4. 基于 Harbor 搭建 Docker 私有镜像仓库 6463
  5. V2ray免费账号 2358
  6. PPS代理节点池③ 2200
  7. 全栈开发笔记 1665
  8. 百度的无刷新搜索之PJAX 1572
  9. css之rem布局(rem.js) 1491
  10. docker swarm 集群高可用 1308

近期热议

  1. GITHUB项目 55
  2. PPS代理节点池 50
  3. WEB代理地址 43
  4. 全栈开发笔记 42
  5. ROBOT机器人之路 31
  6. C++回归之路 19
  7. OCR识别探索 16
  8. PPS代理节点池② 14
  9. DB到ES同步之路 11
  10. 接码平台地址 9