Gitlab Mattermost does not use remote database server
OS: Ubuntu 16.04
Gitlab-CE: 8.11.6-ceo.0
OmniPackage: dpkg-query -W gitlab
only returns gitlab
, but I use the repository
We are using remote database, nfs and redis server. Now we want to use the mattermost service on the same VM as gitlab. This is the config we are using:
external_url 'https://gitlab.example.com'
gitlab_rails['db_adapter'] = "postgresql"
gitlab_rails['db_encoding'] = "utf8"
gitlab_rails['db_username'] = "gitlab"
gitlab_rails['db_password'] = '<password>'
gitlab_rails['db_host'] = "<database host>"
postgresql['enable'] = false
mattermost_external_url 'http://mattermost.example.com'
After calling 'gitlab-ctl reconfigure' without errors. The log shows following entries:
2016-09-16_13:09:19.83164 [2016/09/16 15:09:19 CEST] [INFO] Current working directory is /opt/gitlab/embedded/service/mattermost
2016-09-16_13:09:19.83182 [2016/09/16 15:09:19 CEST] [INFO] Loaded config file from /var/opt/gitlab/mattermost/config.json
2016-09-16_13:09:19.83185 [2016/09/16 15:09:19 CEST] [INFO] Server is initializing...
2016-09-16_13:09:19.83189 [2016/09/16 15:09:19 CEST] [INFO] Pinging sql master database
2016-09-16_13:09:19.83199 [2016/09/16 15:09:19 CEST] [CRIT] Failed to ping db err:dial unix /var/opt/gitlab/postgresql/.s.PGSQL.5432: connect: no such file or directory
After checking the config file of mattermost at /var/opt/gitlab/mattermost/config.json
the problem is clear:
"SqlSettings": {
"DriverName": "postgres",
"DataSource": "user=gitlab_mattermost host=/var/opt/gitlab/postgresql port=5432 dbname=mattermost_production",
"DataSourceReplicas": ["user=gitlab_mattermost host=/var/opt/gitlab/postgresql port=5432 dbname=mattermost_production"],
"MaxIdleConns": 10,
"MaxOpenConns": 10,
"Trace": false,
"AtRestEncryptKey": "<encryption key"
},
Please use the remote database defined for gitlab if no other server is supplied. Further it would help much if you could add more documentation for this entries in gitlab.rb
:
mattermost['sql_driver_name']
mattermost['sql_data_source']
mattermost['sql_data_source_replicas']
Edited by 🤖 GitLab Bot 🤖