Ad Widget

Collapse

Zabbix Docker zabbix-proxy-mysql broken (and also docker-compose)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • doogie
    Junior Member
    • May 2020
    • 15

    #1

    Zabbix Docker zabbix-proxy-mysql broken (and also docker-compose)

    Hi there,

    Trying to get a proxy-mysql going, and not having a lot of fun. The issue seems to be with the zabbix deploying of the database schema. For completeness here are the details:

    MySQL:

    Code:
    docker run -d     --name zabbix-mysql -t     -e MYSQL_DATABASE="zabbix_proxy"     -e MYSQL_USER="zabbix"     -e MYSQL_PASSWORD="a"     -e MYSQL_ROOT_PASSWORD="b"     --network zabbix     --restart unless-stopped     zabbix/mysql:latest     --character-set-server=UTF8MB4 --collation-server=UTF8MB4_bin --secure-file-priv=NULL --default-authentication-plugin=mysql_native_password
    MySQL starts up fine - and is ready for connections.

    Zabbix Proxy MySQL

    Code:
    docker run     --name zabbix-proxy-mysql -t     -e DB_SERVER_HOST="zabbix-mysql"     -e MYSQL_USER="zabbix"     -e MYSQL_PASSWORD="b"     -e ZBX_SERVER_HOST="zabbix.b.com"     -e ZBX_CONFIGFREQUENCY=60     -e ZBX_HOSTNAME="zabbix-proxy.b.com"     --network zabbix     -p 10051:10051     --restart unless-stopped     zabbix/proxy-mysql:centos-latest
    Also starts up fine, finds the database, and starts to upgrade it:

    Code:
    * DB_SERVER_HOST: zabbix-mysql
    * DB_SERVER_PORT: 3306
    * DB_SERVER_DBNAME: zabbix_proxy
    ********************
    ** Database 'zabbix_proxy' already exists. Please be careful with database COLLATE!
    ** Creating 'zabbix_proxy' schema in MySQL
    ERROR 1050 (42S01) at line 1: Table 'users' already exists
    And fails with the following:

    Code:
     6:20200725:082654.270 [Z3005] query failed: [1146] Table 'zabbix_proxy.config' doesn't exist [show columns from config like 'server_check_interval']
    6:20200725:082654.270 Cannot upgrade database: the database must correspond to version 2.0 or later. Exiting ...
    It only ends up with 20 tables in the database when querying mysql:

    Code:
    mysql> use zabbix_proxy;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    
    Database changed
    mysql> show tables;
    +------------------------+
    | Tables_in_zabbix_proxy |
    +------------------------+
    | applications |
    | dchecks |
    | drules |
    | group_discovery |
    | group_prototype |
    | hosts |
    | hstgrp |
    | httpstep |
    | httptest |
    | interface |
    | items |
    | maintenances |
    | screen_user |
    | screen_usrgrp |
    | screens |
    | screens_items |
    | slides |
    | slideshow_user |
    | slideshow_usrgrp |
    | slideshows |
    | users |
    | valuemaps |
    +------------------------+
    22 rows in set (0.00 sec)
    
    mysql>
    Not sure how I can work around this. I have also tried the docker compose file and that plain doesn't work - all services cannot connect to the mysql server.

    Help?

    Cheers,
    Doogie
  • doogie
    Junior Member
    • May 2020
    • 15

    #2
    Also while playing around with trying to get mysql to initialize with the schema file, I got this error:

    Code:
    ERROR 1071 (42000) at line 348: Specified key was too long; max key length is 3072 bytes
    The line in question is this:

    Code:
    CREATE INDEX `items_1` ON `items` (`hostid`,`key_`(1021));

    Comment

    • doogie
      Junior Member
      • May 2020
      • 15

      #3
      And to answer my own question... this was solved by changing the collation - you are 'supposed' to be using UTF8MB4 - but it clearly breaks it, so for the moment I'll leave the mysql running with that collation.

      Comment

      Working...