S
S
stolensun2019-06-12 17:19:35
MongoDB
stolensun, 2019-06-12 17:19:35

What could be the problem with MongoDB?

Ubuntu 19.04
Nodejs 8.11.4

I install Rocket.Chat according to the official tutorial from their website.
At the Rocket.Chat launch stage:

[email protected]:/opt/Rocket.Chat# node main.js
LocalStore: store created at
LocalStore: store created at
LocalStore: store created at
LocalStore: store created at
LocalStore: store created at
LocalStore: store created at
Setting default file store to GridFS
Warning: connect.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.
{"line":"120","file":"migrations.js","message":"Migrations: Not migrating, already at version 147","time":{"$date":1560348562938},"level":"info"}
Loaded the Apps Framework and loaded a total of 0 Apps!
Updating process.env.MAIL_URL
Using GridFS for custom sounds storage
Using GridFS for custom emoji storage
➔ server.js:207 System ➔ error
➔ +---------------------------------------------------------------------------+
➔ |                                SERVER ERROR                               |
➔ +---------------------------------------------------------------------------+
➔ |                                                                           |
➔ |  Rocket.Chat Version: 1.1.1                                               |
➔ |       NodeJS Version: 8.11.4 - x64                                        |
➔ |      MongoDB Version: 4.0.10                                              |
➔ |       MongoDB Engine: mmapv1                                              |
➔ |             Platform: linux                                               |
➔ |         Process Port: 3000                                                |
➔ |             Site URL: http://127.0.0.1:3000/                           |
➔ |     ReplicaSet OpLog: Disabled                                            |
➔ |          Commit Hash: 80341ed12f                                          |
➔ |        Commit Branch: HEAD                                                |
➔ |                                                                           |
➔ |  OPLOG / REPLICASET IS REQUIRED TO RUN ROCKET.CHAT, MORE INFORMATION AT:  |
➔ |  https://go.rocket.chat/i/oplog-required                                  |
➔ |                                                                           |
➔ +---------------------------------------------------------------------------+

As I understand it, it needs replication to mongoDB, go to the mongo config:
[email protected]:/opt/Rocket.Chat# cat /etc/mongod.conf
# mongod.conf

storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true
  engine: mmapv1

systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

net:
  port: 27017
  bindIp: 127.0.0.1

processManagement:
  timeZoneInfo: /usr/share/zoneinfo

replication:
  replSetName: rs01

There is a replication. We check:
rs01:PRIMARY> rs.initiate()
{
        "operationTime" : Timestamp(1560348938, 1),
        "ok" : 0,
        "errmsg" : "already initialized",
        "code" : 23,
        "codeName" : "AlreadyInitialized",
        "$clusterTime" : {
                "clusterTime" : Timestamp(1560348938, 1),
                "signature" : {
                        "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                        "keyId" : NumberLong(0)
                }
        }
}

"ok":0
What could be the problem? At what - when I just installed mongo - it was 1. As soon as I launch rocket.chat - it immediately changes to 0.
[email protected]:/# cat /lib/systemd/system/rocketchat.service
[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://localhost:27017/rocketchat?replicaSet=rs01
MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=rs01
ROOT_URL=http://localhost:3000/
PORT=3000
[Install]
WantedBy=multi-user.target

UPD: did
export PORT=3000
export ROOT_URL=http://0.0.0.0:3000/
export MONGO_URL=mongodb://localhost:27017/rocketchat

and everything worked. Strange, now we need to understand why the config does not pick up.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question