Description
I’ve been asked at work to test-drive rocket.chat 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 rocket.chat in server B to connect to mongo.db in server A.
This is my /lib/systemd/system/rocketchat.service in server B:
[Unit] Description=The Rocket.Chat server After=network.target remote-fs.target nss-lookup.target nginx.target mongod.target [Service] ExecStart=/usr/local/bin/node /opt/Rocket.Chat/main.js StandardOutput=syslog StandardError=syslog SyslogIdentifier=rocketchat User=rocketchat Environment=MONGO_URL=mongodb://10.240.243.111:27017/rocketchat?replicaSet=rs01 MONGO_OPLOG_URL=mongodb://10.240.243.111:27017/local?replicaSet=rs01 ROOT_URL=http://10.240.243.116:3000/ PORT=3000 [Install] WantedBy=multi-user.target
Where 10.240.243.111 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 [127.0.0.1:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017] 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: