I have one problem in running Kafka in the cluster. I explain it one by one. First, When I run Kafka commands on the cluster CSSH from my computer, I get this error:
Error while executing topic command : Replication factor: 2 larger than available brokers: 1. [2019-01-06 15:12:36,587] ERROR org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 2 larger than available brokers: 1. (kafka.admin.TopicCommand$)
In fact, I run CSSH on my computer to access to the cluster, after running Zookeeper and Kafka server on the cluster, when I run command of creating a topic I get the error. In the cluster, I have these setting on the server.properties on node1:
broker.id=1
port=9092
listeners=PLAINTEXT://150.20.11.137:9092
num.network.threads=3
num.io.threads=8
socket.send.buffer.bytes=102400
socket.receive.buffer.bytes=102400
sockeet.request.max.bytes=104857600
log.dirs=/tmp/kafka-logs
num.partitions=1
num.recovery.threads.per.data.dir=1
offsets.topic.replication.factor=1
transaction.state.log.replication.factor=1
transaction.state.log.min.isr=1
log.retention.hours=168
log.segment.bytes=10073741824
log.retention.check.interval.ms=300000
zookeeper.connect= 150.20.11.134:2186, 150.20.11.137:2186,
150.20.11.157:2186
zookeeper.connection.timeout.ms=6000
group.initial.rebalance.delay.ms=0
In zookeeper.properties of each node I have this setting:
dataDir=/tmp/zookeeper
clientPort=2186
maxClientCnxns=0
Also, I run each command on the cluster nodes to run Kafka and Zookeeper:
./bin/zookeeper-server-start.sh ./config/zookeeper.properties
./bin/kafka-server-start.sh ./config/server.properties
After that, I want to create a topic with this command in the cluster and then I get above error on each node:
./bin/kafka-topics.sh --create --zookeeper localhost:2186 --
replication-factor 2 --partitions 3 --topic testFlink
Would you please tell what the problem is exactly? And what is wrong in my cluster setting?
Thanks in advance.