xxxxxxxxxx
A replication factor is the number of copies of data over multiple brokers. The replication factor value should be greater than 1 always (between 2 or 3). This helps to store a replica of the data in another broker from where the user can access it.
xxxxxxxxxx
I don't think you can. Normally it would be something like
./kafka-topics.sh --zookeeper localhost:2181 --alter --topic test2 --replication-factor 3
but it says
Option "[replication-factor]" can't be used with option"[alter]"