How to make a nodejs with socketio cluster?

I write a chat app with nodejs, express and socketio. It support some chat in one room, and support multiple rooms, And I hold the client data in memory, such as there is global variable rooms, and i store client data like this..

var rooms =  {
  "room1": [
         {username: "user1", socket: user1Socket}, 
         {username: "user2", socket: user2Socket}, 
  ],
  "room2": [
         {username: "user3", socket: user3Socket}, 
         {username: "user4", socket: user4Socket}, 
  ]
}

but there are multiple serverss in cluster, the client didn't know to connect to which server, because this is the job of the load equalizer, then a problem occured, the user1 and the user2 should be in same room, but they may be connect to different server..

What shall I do?

You need to configure your servers with a RedisStore. Have a look here for more information: https://github.com/LearnBoost/Socket.IO/wiki/Configuring-Socket.IO#server