【问题标题】:Unable to create kafka topic无法创建 kafka 主题
【发布时间】:2017-08-12 01:09:35
【问题描述】:

我正在尝试在 ec2 实例上创建一个 kafka 主题, 我正在关注此文档https://aws.amazon.com/blogs/big-data/real-time-stream-processing-using-apache-spark-streaming-and-apache-kafka-on-aws/ 但我收到以下错误请帮助

ec2-user@ip-10-100-53-218 bin]$ ./kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test

OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
Error while executing topic command : replication factor: 1 larger than available brokers: 0
[2017-03-20 12:25:30,045] ERROR org.apache.kafka.common.errors.InvalidReplicationFactorException: replication factor: 1 larger than available brokers: 0
 (kafka.admin.TopicCommand$)

【问题讨论】:

    标签: amazon-web-services apache-kafka apache-zookeeper


    【解决方案1】:

    kafka 代理没有运行。 SSH 进入 Kafka Broker 实例并检查 kafka-server-start.sh 是否正在运行。

    ps -ef | grep kafka-server-start
    

    如果没有运行,启动它。

    nohup /app/kafka/kafka_2.9.2-0.8.2.1/bin/kafka-server-start.sh /app/kafka/kafka_2.9.2-0.8.2.1/config/server.properties
    

    【讨论】:

    • 它正在运行,但仍然出现同样的错误 [ec2-user@ip-10-100-52-58 config]$ ps -ef | grep kafka-server-start ec2-user 30375 27676 0 13:52 pts/0 00:00:00 grep --color=auto kafka-server-start
    • 你能贴出 ps -ef 的全部输出吗?应该有 2 行作为输出。您给出的 1 行是您运行的 grep。
    猜你喜欢
    • 1970-01-01
    • 2018-02-22
    • 1970-01-01
    • 1970-01-01
    • 2019-12-19
    • 1970-01-01
    • 2020-01-22
    • 2020-03-11
    相关资源
    最近更新 更多