If you need to change the port number for collaborative editing of Confluence, you need to add following line on <confluence home directory>/bin/setenv.sh
CATALINA_OPTS="-Dsynchrony.port=9004 ${CATALINA_OPTS}"
Once you change like above
For example, the below is what I have done in setenv.sh
Note the port number on confluence won't be changed even though you changed it, because that is just for your reference provided by atlassian.
http://<your domain name>/admin/confluence-collaborative-editor-plugin/configure.action
If you run two confluence server on the same machine, Synchrony port might be conflicted, so you need to change the value on one of them, or you need to turn it off on the menu.