Question:
To test the integration of sparkstreaming and Kafka in the code, you need to create two topics in Kafka in advance, but the following errors are reported during the execution of the creation script
kafka-topics.sh --zookeeper linux1:2181,linux2:2181,linux3:2181 --create --topic wufabao_topic01 --replication-factor 2 --partitions 3
WARNING: Due to limitations in metric names, topics with a period ('.') or underscore ('_') could collide. To avoid issues it is best to use either, but not both.
Error while executing topic command : Replication factor: 2 larger than available brokers: 0.
[2022-02-09 17:27:18,432] ERROR org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 2 larger than available brokers: 0.
(kafka.admin.TopicCommand$)
reason:
The path of metadata stored in zookeeper configured by Kafka is incorrect. The metadata path I configured in Kafka is:
zookeeper connect=linux1:2181,linux2:2181,linux3:2181/myKafka
Solution:
Modify the path of Kafka metadata in the script as follows:
kafka-topics.sh --zookeeper linux1:2181,linux2:2181,linux3:2181/myKafka --create --topic wufabao_topic01 --replication-factor 2 --partitions 3
created successfully
Read More:
- [Solved] Kafka Error: InvalidReplicationFactorException: Replication factor:
- [Solved] Kafka Error: kafka.common.InconsistentClusterIdException…
- kafka Error: Error while fetching metadata with correlation
- [Solved] Win 10 Kafka error: failed to construct Kafka consumer
- Kafka error: ERROR There was an error in one of the threads during logs loading: java.lang.NumberFormatException: For input string: “derby” (kafka.log.LogManager)
- [Solved] kafka Startup Error: ERROR Shutdown broker because all log dirs in /…/kafka/logs have failed (kafka.log.LogManager)
- How to Solve canal & MYSQL or “Kafka cannot consume data” Error
- [Solved] kafka startup Error: java.net.ConnectException: Connection refused
- How to Solve Kafka Error: no leader
- [Solved] Kafka Start Log Error: WARN Found a corrupted index file due to requirement failed: Corrupt index found
- Kafka Error while fetching metadata with correlation id 1 : {alarmHis=LEADER_NOT_AVAILABLE}
- [Solved] Kafka2.3.0 Error: Timeout of 60000ms expired before the position for partition could be determined
- [Solved] Group coordinator lookup failed,The coordinator is not available
- Kafka Creates and Writes Logs Error [How to Solve]
- [Solved] hbase Create Sheet Error: ERROR: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing
- Mac M1 Start Virtual Machine Centos8 with PD to install Kafka error: Error: VM option ‘UseG1GC‘
- Huawei kafka Authentication error: Server not found in Kerberos database (7) – LOOKING_UP_SERVER
- [Solved] Caused by: java.lang.ClassNotFoundException: org.apache.flink.api.common.typeinfo.TypeInformation
- [Solved] @webservice Error: org.apache.cxf.common.i18n.UncheckedException: No operation was found with
- [Solved] hbase Create Sheet Error: ERROR: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing