You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/11/17 02:28:14 UTC

[GitHub] [rocketmq] duhenglucky commented on issue #3480: the client consumers in docker enviroment of two machines leads the same clientid on the consuming side because of the same returning ip

duhenglucky commented on issue #3480:
URL: https://github.com/apache/rocketmq/issues/3480#issuecomment-971116631


   > i want to know whether two ip is the same in docker overlay mode of two machines
   
   Under HOST networking mode, all dockers managed by Rancher are with the same docker0 IP, which is 172.17.0.1. Thus, RemotingUtil.getLocalAddress() always returns "172.17.0.1" for those dockers, which leads to a collision between consumers with the same PID, if using default "IP@pid" clientId.
   
   But it's recommended you bump up your client version to the lastest, because the instanceName change to a new one with nanoTime to prevent this collision:
   ` if (this.instanceName.equals("DEFAULT")) {
               this.instanceName = UtilAll.getPid() + "#" + System.nanoTime();
      }`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org