Summary
There is another question like this in the forum but it doesn’t answer my question, that one being a Docker question.
In my Amazon EC2 container, after configuring Postgres RDS connection in config.json, when I start the service, no matter what I do, it still tries to connect to Postgres on 127.1:5432 .
Steps to reproduce
I tried configuration, according to the guide, by editing config.json. Mine looks sorta like this:
cat /opt/mattermost/config/config.json | grep postgres
"DriverName": "postgres",
"DataSource": "postgres:SECRET@mattermost.SECRET.us-east-1.rds.amazonaws.com:5432/mattermost?sslmode=disable&connect_timeout=10",
I also tried the suggestion from that other Docker thread, like so, but this didn’t override it either.
export MM_USERNAME=postgres
export MM_PASSWORD=SECRET
export DB_HOST=mattermost.SECRET.us-east-1.rds.amazonaws.com
export DB_PORT=5432
export MM_DBNAME=mattermost
export MM_SQLSETTINGS_DATASOURCE="postgres://$MM_USERNAME:$MM_PASSWORD@$DB_HOST:$DB_PORT/$MM_DBNAME?sslmode=disable&connect_timeout=10"
cd /opt/mattermost/
sudo -u mattermost ./bin/mattermost
Expected behavior
During initial start of the server, I just expected it to connect to my Postgres RDS instance.
Observed behavior
During startup, the log looks like this:
**ubuntu@ip-SECRET** : **/opt/mattermost** $ ./entryPoint.sh
{"level":"info","ts":1585277262.8005755,"caller":"utils/i18n.go:83"
,"msg":"Loaded system translations","for locale":"en","from locale":"/opt/mattermost/i18n/en.json"}
{"level":"info","ts":1585277262.8008142,"caller":"app/server_app_adapters.go:58"
,"msg":"Server is initializing..."}
{"level":"info","ts":1585277262.8097615,"caller":"sqlstore/supplier.go:221"
,"msg":"Pinging SQL","database":"master"}
{"level":"error","ts":1585277262.8409588,"caller":"sqlstore/supplier.go:233"
,"msg":"Failed to ping DB","error":"dial tcp 127.0.0.1:5432: connect: connection refused","retrying in seconds":10}
Using server version 5.21.0