The problem can be reproduced by running a server with the following type of config file:
and then trying to do "zkServer.sh status"
Here I specified the servers using the new config format but still used the static config file and didn't include the "clientPort" key.
zkServer.sh already supports the new configuration format, but expects server spec to appear in the dynamic config file if it uses the new format.
So in the example above it will not find the client port.
The current logic for executing something like 'zkServer.sh status' is:
1. Look for clientPort keyword in the static config file
2. Look for the client port in the server spec in the dynamic config file
The attached patch adds an intermediate step:
1'. Look for the client port in the server spec in the static config file