Externalize mongodb : connection refused

Hi,

I’m trying to externalize mongodb to my local server but i’m getting the following error:

2021/06/08 11:33:51 Waiting for: tcp://localhost:27017
2021/06/08 11:33:51 Waiting for: http://elasticsearch:9200
2021/06/08 11:33:51 Problem with dial: dial tcp 127.0.0.1:27017: connect: connection refused. Sleeping 5s
2021/06/08 11:33:51 Received 200 from http://elasticsearch:9200
2021/06/08 11:33:56 Problem with dial: dial tcp 127.0.0.1:27017: connect: connection refused. Sleeping 5s
2021/06/08 11:34:01 Problem with dial: dial tcp 127.0.0.1:27017: connect: connection refused. Sleeping 5s

Here is my config.yml

LANGUAGE_CODE: en
LMS_HOST: local.overhang.io
MONGODB_HOST: localhost
MONGODB_PASSWORD: root
MONGODB_PORT: 27017
MONGODB_USERNAME: root
MYSQL_ROOT_PASSWORD: *****
OPENEDX_MYSQL_PASSWORD: *****
OPENEDX_SECRET_KEY: ****
PLATFORM_NAME: My Open edX
PLUGINS:
- xqueue
RUN_MONGODB: false
XQUEUE_AUTH_PASSWORD: *****
XQUEUE_MYSQL_PASSWORD: *****
XQUEUE_SECRET_KEY: ******

I try multiple host like 127.0.0.1 , root:root@localhost, mongodb etc… I have also try to change passwords, create an other user…

I can connect to my local server using NodeJS, Compass and the mongo shell…but not Tutor.

Has anyone manage to externalize the mongodb database ?

You must understand that the MongoDb client is attempting to reach your mongodb server from inside a container. Thus, setting MONGODB_HOST: localhost will not work, as localhost will point to the container itself. You should try to set this configuration setting to the IP address of your MongoDb server.