So what will Kafka do if one replica(follower) goes down? Will Kafka create a new replica, or just waiting the failed one comes back?
It will wait for some broker to come back up, whether it was the original lost one or another.
And at this time, if producer continue write data to broker, will cause data lost?
No, replication is not splitting the data, but duplicating it across the cluster. So, as long as one broker remains then you should be okay.
Note that it seems that you are thinking of partitions, which are a way of splitting the data out for scalability. Replication is about redundancy. One final note is that if you set the Producer acks
to all
then it will require full replication or else it will not accept any messages. This could also happen with min.insync.replicas
being set to a higher value on the broker.
TL;DR; with the default settings then there should be no problem as long as you have at least one server running.