Zookeeper starts the client and reports an error: java.net.connectexception: connection rejected

1. Check the error status:
./zkserver.sh status

check the error reason:
./zkserver.sh start forest

The default server port number is 8080, which has been occupied.
go to the configuration file to modify the default server port number:
admin. Serverport = 2180

Read More: