Xibo docker-composer on cenOS cannot connect to mysql

Hi,
I’m struggling to setup a fresh xibo with docker-composer on CentOS, istallation went ok so far.
During startup, the cms cannot connect to the database:
cms-db_1 | Version: ‘5.6.46’ socket: ‘/var/run/mysqld/mysqld.sock’ port: 3306 MySQL Community Server (GPL)
cms-web_1 | Waiting for MySQL to start - max 300 seconds
cms-web_1 | Waiting for MySQL to start - max 300 seconds
cms-web_1 | MySQL started
cms-web_1 | Updating settings.php
cms-web_1 | ERROR 2002 (HY000): Can’t connect to MySQL server on ‘mysql’ (115)
cms-web_1 | New install
cms-web_1 | Provisioning Database
cms-web_1 | ERROR 2002 (HY000): Can’t connect to MySQL server on ‘mysql’ (115)

Please find below my composer file
services:
cms-db:
image: mysql:5.6
command: “–innodb_use_native_aio=0”
volumes:
- “./shared/db:/var/lib/mysql”
environment:
- MYSQL_DATABASE=cms
- MYSQL_USER=cms
- MYSQL_RANDOM_ROOT_PASSWORD=yes
mem_limit: 2g
env_file: config.env
restart: always
ports:
- 3306:3306
cms-xmr:
image: xibosignage/xibo-xmr:release-0.7
ports:
- “9505:9505”
restart: always
mem_limit: 256m
env_file: config.env
cms-web:
image: xibosignage/xibo-cms:release-2.2.1
volumes:
- “./shared/cms/custom:/var/www/cms/custom”
- “./shared/backup:/var/www/backup”
- “./shared/cms/web/theme/custom:/var/www/cms/web/theme/custom”
- “./shared/cms/library:/var/www/cms/library”
- “./shared/cms/web/userscripts:/var/www/cms/web/userscripts”
restart: always
links:
- cms-db:mysql
- cms-xmr:50001
environment:
- XMR_HOST=cms-xmr
env_file: config.env
ports:
- “80:80”
mem_limit: 2g
cms-quickchart:
image: ianw/quickchart
restart: always

any suggestions are higly appreciated

Welcome to the community PeterF!

I’ve been looking at your yml file and it appears that there have been some modifications to your cms-db service. For example the memory limit is higher than the default and ports appear to have been defined where they had not been before. There is also the command line that you have added which is recommended for Docker Toolbox installs on Windows as opposed to CentOS.

My first recommendation would be to run docker-compose down to make sure all containers are not running. Next download a new copy of the docker-compose.yml file and replace it with the one in your original message to correct the cms-db modifications.

Next make sure you have a password in your config.env file. Now delete the shared/db directory and you should be ready to give the docker-compose up -d command another try. Please note that depending on how your User account is configured you may need to add sudo to the beginning of your docker commands.

If you encounter another issue trying to up your CMS, please let me know what errors or messages you receive.

Many Thanks.

Hi,
When you launch your docker-compose, a network bridge is create. When you use ifconfig command you should find it (br-xxxxxx).

Next try to put it in the trusted zone with the firewalld command.
firewall-cmd --zone=trusted --add-interface=br-xxxxxx

For the security, i’m not sure but it’s work for me.

Be careful. Each time that you will restart you docker-compose, a new bridge will be create. A solution exist to create a custom bridge and add into your docker-compose file the configuration to connect to it.

Best regards

c47

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.