@stolensun

В чем может быть проблема с MongoDB?

Ubuntu 19.04
Nodejs 8.11.4


Ставлю Rocket.Chat по официальному туториалу с их сайта.

На этапе запуска Rocket.Chat:

root@system:/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                                  |
➔ |                                                                           |
➔ +---------------------------------------------------------------------------+


Как я понимаю - ему нужна репликация на mongoDB, заходим в конфиг монго:

root@system:/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


Репликация есть. Проверяем:

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

В чем может быть проблема? При чем - когда только поставил монго - была 1. Как только запускаю рокет.чат - сразу меняется на 0.

root@system:/# 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: сделал

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


и все заработало. Странно, теперь надо понять, почему не подхватывает конфиг.
  • Вопрос задан
  • 1136 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы