Deploying in 2 separate servers


I’ve been asked at work to test-drive deploying it in two separate servers.

I’ve installed and configured mongo.db on server A along with rocket chat and everything seems to be working, I can connect from the browser and use the clients successfully. I followed the guide in the doc step by step.

I’m now trying to install server B, which in fact was cloned from server A. My intention is having in server B to connect to mongo.db in server A.

This is my /lib/systemd/system/rocketchat.service in server B:

Description=The Rocket.Chat server
ExecStart=/usr/local/bin/node /opt/Rocket.Chat/main.js
Environment=MONGO_URL=mongodb:// MONGO_OPLOG_URL=mongodb:// ROOT_URL= PORT=3000

Where is the IP of Server A (where mongo.db resides)

But when I try to start the service, I get this error message:

Apr 30 06:40:06 ufichjda0 rocketchat: /opt/Rocket.Chat/programs/server/node_modules/fibers/future.js:313
Apr 30 06:40:06 ufichjda0 rocketchat: throw(ex);
Apr 30 06:40:06 ufichjda0 rocketchat: ^
Apr 30 06:40:06 ufichjda0 rocketchat: MongoNetworkError: failed to connect to server [] on first connect [MongoNetworkError: connect ECONNREFUSED]
Apr 30 06:40:06 ufichjda0 rocketchat: at Pool. (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/topologies/server.js:564:11)

Why is it attempting to connect to localhost? What am I missing?

Server Setup Information

  • Version of Rocket.Chat Server: 3.2.0
  • Operating System: CentOS Linux 7 (Core)
  • Deployment Method: tar (manual)
  • Number of Running Instances: 2
  • DB Replicaset Oplog:
  • NodeJS Version: v8.11.4
  • MongoDB Version: 4.0.13
  • Proxy:
  • Firewalls involved:

Any additional Information

I’d like do follow this topic as I think I’ll have to do the same. Do you upload files into Mongo? Looks like it is not a good idea. And if you switch to filesystem you will need to sync files somehow.

I’ll try to deal with that later. I want to have the database connection sorted first. I can’t understand why it claims it can’t connect to localhost if I’m explicitly telling Rocket.Chat that it’s elsewhere, so there must be some key bit of info I might have misunderstood.

Amyways, I think we’ll use a NFS mounted filesystem in both machines and have the files stored there.

Thank you very much for the solution.