2

I have setup mongodb cluster with enabled oplog.

I have setup two instances of rocketchat.

rocketchat00(10.0.0.1):

[Unit]
Description=Rocket.Chat Server
After=syslog.target
After=network.target
[Service]
Type=simple
Restart=always
StandardOutput=syslog
SyslogIdentifier=RocketChat
User=rocketchat
Group=rocketchat
Environment=MONGO_URL=mongodb://rcUser:*****@mongodb00:27017,mongodb01:27017,mongodb02:27017/app_rocket_chat?authSource=app_rocket_chat&replicaSet=rs0
Environment=MONGO_OPLOG_URL=mongodb://oplogger:*****@mongodb00:27017,mongodb01:27017,mongodb02:27017/local?authSource=admin&replicaSet=rs0
Environment=ROOT_URL=https://chat.localhost
Environment=INSTANCE_IP=10.0.0.1
Environment=BIND_IP=0.0.0.0
Environment=NODE_ENV=production
Environment=PORT=3000
WorkingDirectory=/var/lib/rocket.chat
ExecStart=/usr/local/n/versions/node/4.5.0/bin/node /var/lib/rocket.chat/bundle/main.js
[Install]
WantedBy=multi-user.target

rocketchat01(10.0.0.2):

[Unit]
Description=Rocket.Chat Server
After=syslog.target
After=network.target
[Service]
Type=simple
Restart=always
StandardOutput=syslog
SyslogIdentifier=RocketChat
User=rocketchat
Group=rocketchat
Environment=MONGO_URL=mongodb://rcUser:*****@mongodb00:27017,mongodb01:27017,mongodb02:27017/app_rocket_chat?authSource=app_rocket_chat&replicaSet=rs0
Environment=MONGO_OPLOG_URL=mongodb://oplogger:*****@mongodb00:27017,mongodb01:27017,mongodb02:27017/local?authSource=admin&replicaSet=rs0
Environment=ROOT_URL=https://chat.localhost
Environment=INSTANCE_IP=10.0.0.2
Environment=BIND_IP=0.0.0.0
Environment=NODE_ENV=production
Environment=PORT=3000
WorkingDirectory=/var/lib/rocket.chat
ExecStart=/usr/local/n/versions/node/4.5.0/bin/node /var/lib/rocket.chat/bundle/main.js
[Install]
WantedBy=multi-user.target

http://rocketchat00:3000 Administration -> Info

Broadcast Connected Instances
Address 10.0.0.2:3000
Auth    
Current Status > Connected  
Current Status > Retry Count    2
Current Status > Status waiting
Instance Record > ID    D*************
Instance Record > PID   33493
Instance Record > Created at    December 27, 2017 9:47 AM
Instance Record > Updated at    December 27, 2017 11:14 AM

http://rocketchat01:3000 Administration -> Info

Broadcast Connected Instances
Address 10.0.0.1:3000
Auth    
Current Status > Connected  
Current Status > Retry Count    2
Current Status > Status waiting
Instance Record > ID    K*************
Instance Record > PID   33576
Instance Record > Created at    December 27, 2017 9:42 AM
Instance Record > Updated at    December 27, 2017 9:47 AM

In mongodb I can see instances, but PID is different

rs0:PRIMARY> db.instances.find()
{ "_id" : "Q**********", "pid" : 33937, "name" : "rocket.chat", "extraInformation" : { "host" : "10.0.0.1", "port" : "3000" }, "_createdAt" : ISODate("2017-12-27T11:14:08.164Z"), "_updatedAt" : ISODate("2017-12-27T11:54:45.307Z") }
{ "_id" : "S**********", "pid" : 33809, "name" : "rocket.chat", "extraInformation" : { "host" : "10.0.0.2", "port" : "3000" }, "_createdAt" : ISODate("2017-12-27T11:14:26.238Z"), "_updatedAt" : ISODate("2017-12-27T11:54:44.688Z") }

The main issue with notifications. One user connected to rocketchat00. Another user connected to rocketchat01. If the first user mentions second user via @ - message arrived, but the notification does not show. Also, I try to dump traffic between instances on port 3000 and there is no any traffic.

1 Answers1

0

Please provide your Rocket.Chat version as well.

As you can see on Current Status > Status waiting instances are not successfully connected to each other, notifications will not work until that.

Make sure instances can connect to each other using the INSTANCE_IP from the other, in your case make sure instance with IP 10.0.0.1 can communicate with instance IP 10.0.0.2.

  • Yep. I have already checked that `curl http://10.0.0.2:3000` in rocketchat00 works perfectly. In rocketchat01 the same. – Maksym Nohin Dec 27 '17 at 13:34