xibosignage / xibo

Xibo Digital Signage
https://xibosignage.com
GNU Affero General Public License v3.0
579 stars 165 forks source link

SQL issues with fresh Xibo installation #3548

Open dspoelstra058 opened 1 week ago

dspoelstra058 commented 1 week ago

Hello,

I have ran into some SQLstate issues by using the tutorial on the Xibo website. Link : https://community.xibo.org.uk/t/xibo-cms-with-docker-on-ubuntu-22-04/9392 The problem was the mysql docker container. The container was restarting and not stable.

After editing the cms-db config in cms_custom-ports.yml the mysql docker container was stable to use. Can you add the following lines on the tutorials and templates :

version: “2.1”

services:
cms-db:
image: mysql:8.0
volumes:
- “./shared/db:/var/lib/mysql:Z”
restart: always
environment:
- MYSQL_DATABASE=cms
- MYSQL_USER=cms
- MYSQL_RANDOM_ROOT_PASSWORD=yes
mem_limit: 1g
env_file: config.env
cms-xmr:
image: [Package xibo-xmr · GitHub](http://ghcr.io/xibosignage/xibo-xmr:0.11)
ports:
- “65500:9505”
restart: always
mem_limit: 256m
env_file: config.env
cms-web:
image: [Package xibo-cms · GitHub](http://ghcr.io/xibosignage/xibo-cms:release-4.1.1)
volumes:
- “./shared/cms/custom:/var/www/cms/custom:Z”
- “./shared/backup:/var/www/backup:Z”
- “./shared/cms/web/theme/custom:/var/www/cms/web/theme/custom:Z”
- “./shared/cms/library:/var/www/cms/library:Z”
- “./shared/cms/web/userscripts:/var/www/cms/web/userscripts:Z”
- “./shared/cms/ca-certs:/var/www/cms/ca-certs:Z”
restart: always
environment:
- MYSQL_HOST=cms-db
- XMR_HOST=cms-xmr
- CMS_USE_MEMCACHED=true
- MEMCACHED_HOST=cms-memcached
env_file: config.env
ports:
- “65501:80”
mem_limit: 1g
cms-memcached:
image: memcached:alpine
command: memcached -m 15
restart: always
mem_limit: 100M
cms-quickchart:
image: ianw/quickchart
restart: always

to

version: “2.1”

services:
cms-db:
image: mysql:8.0
volumes:
- “./shared/db:/var/lib/mysql:Z”
restart: always
environment:
- MYSQL_DATABASE=cms
- MYSQL_USER=cms
- MYSQL_RANDOM_ROOT_PASSWORD=yes
mem_limit: 1g
env_file: config.env
networks:
default:
aliases:
- mysql
cms-xmr:
image: [Package xibo-xmr · GitHub](http://ghcr.io/xibosignage/xibo-xmr:0.11)
ports:
- “65500:9505”
restart: always
mem_limit: 256m
env_file: config.env
cms-web:
image: [Package xibo-cms · GitHub](http://ghcr.io/xibosignage/xibo-cms:release-4.1.1)
volumes:
- “./shared/cms/custom:/var/www/cms/custom:Z”
- “./shared/backup:/var/www/backup:Z”
- “./shared/cms/web/theme/custom:/var/www/cms/web/theme/custom:Z”
- “./shared/cms/library:/var/www/cms/library:Z”
- “./shared/cms/web/userscripts:/var/www/cms/web/userscripts:Z”
- “./shared/cms/ca-certs:/var/www/cms/ca-certs:Z”
restart: always
environment:
- MYSQL_HOST=cms-db
- XMR_HOST=cms-xmr
- CMS_USE_MEMCACHED=true
- MEMCACHED_HOST=cms-memcached
env_file: config.env
ports:
- “65501:80”
mem_limit: 1g
cms-memcached:
image: memcached:alpine
command: memcached -m 15
restart: always
mem_limit: 100M
cms-quickchart:
image: ianw/quickchart
restart: always

Thank you !

dasgarner commented 1 week ago

Sorry, I am not clear what you're suggesting here. Is it that adding a network alias made the SQL container stable?

networks:
  default:
    aliases:
    - mysql
dspoelstra058 commented 1 week ago

Correct, before stablity issues. The mysql container was restarting again, and again and again. After adding the network + alias the container runs stable.

Without a get per minute a restart, with the network + alias config once a 3 - 6 hours a restart ?? Strange but working..