I am moving from an undockerized zabbix installation on one server to a dockerized zabbix installation on one server. To that end I have created a zabbix_dump.sql file that contains the contents of the undockerized zabbix.
How can I import that dump into the dockerized version?
This is what my docker-compose.yaml file looks like:
I tried two thinks: I changed into running container and imported the backup like any normal mysql backup:
And i ran a mysql container and mounted the volume mysql_files.
from where I then ran the same mysql-command.
Both times zabbix wouldn't start when I ran docker-compose:
The instance never comes up. Any ideas on how to successfully do this?
How can I import that dump into the dockerized version?
This is what my docker-compose.yaml file looks like:
Code:
version: '3'
services:
zabbix:
image: zabbix/zabbix-appliance:ubuntu-4.2.4
hostname: zabbix_myenv
environment:
MYHOST: myhost
volumes:
- /etc/localtime:/etc/localtime:ro
- mysql_files:/var/lib/mysql
- ./backups:/backups
ports:
- 580:80
volumes:
mysql_files:
Code:
/usr/bin/mysql -u zabbix--password=zabbix < zabbix_dump.sql
Code:
docker run -v /home/john/docker/zabbix/zabbix_qa/backups:/etc/backup -v zabbix_qa_mysql_files:/var/lib/mysql mysql
Both times zabbix wouldn't start when I ran docker-compose:
Code:
** Deploying Zabbix appliance (nginx) with mysql database ** Preparing the system ** Configuring local MySQL server **** MySQL data directory is not empty. Using already existing installation. ln: failed to create symbolic link '/run/mysqld/mysqld': File exists ** Starting MySQL server in background mode ** Preparing Zabbix server ******************** * DB_SERVER_HOST: localhost * DB_SERVER_PORT: 3306 * DB_SERVER_DBNAME: zabbix * DB_SERVER_ROOT_USER: root * DB_SERVER_ROOT_PASS: * DB_SERVER_ZBX_USER: zabbix * DB_SERVER_ZBX_PASS: zabbix ******************** mysqladmin: [Warning] Using a password on the command line interface can be insecure. **** MySQL server is not available. Waiting 5 seconds... mysqladmin: [Warning] Using a password on the command line interface can be insecure. **** MySQL server is not available. Waiting 5 seconds...
Comment