Ad Widget

Collapse

Zabbix deployment with Docker : just no way to get it working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rajstopy
    Junior Member
    • Oct 2019
    • 8

    #1

    Zabbix deployment with Docker : just no way to get it working

    Dear all,

    I've spent more than 3 weeks trying to get a running instance of Zabbix using Docker. This is just running me nuts. It seems the DB process remains stuck at zabbix db creation :

    Code:
    ** Creating 'zabbix' user in MySQL database
    ** Database 'zabbix' does not exist. Creating...
    ** Creating 'zabbix' schema in MySQL
    When I restart the container, the I get the following message and the Zabbix-server container stops :

    Code:
    8:20210427:113800.215 Starting Zabbix Server. Zabbix 5.2.6 (revision 7985065).
    8:20210427:113800.216 ****** Enabled features ******
    8:20210427:113800.216 SNMP monitoring: YES
    8:20210427:113800.216 IPMI monitoring: YES
    8:20210427:113800.216 Web monitoring: YES
    8:20210427:113800.216 VMware monitoring: YES
    8:20210427:113800.216 SMTP authentication: YES
    8:20210427:113800.216 ODBC: YES
    8:20210427:113800.216 SSH support: YES
    8:20210427:113800.216 IPv6 support: YES
    8:20210427:113800.216 TLS support: YES
    8:20210427:113800.216 ******************************
    8:20210427:113800.216 using configuration file: /etc/zabbix/zabbix_server.conf
    8:20210427:113800.220 cannot use database "zabbix": its "users" table is empty (is this the Zabbix proxy database?)
    On the GUI side I get that one :
    • Unable to determine current Zabbix database version: the table "dbversion" was not found.

    I've just no idea at all what's going on this this f... instance...

    Here is my Docker Compose file :

    Code:
    version: "2.1"
    services:
    zabbix-server:
    image: zabbix/zabbix-server-mysql:alpine-5.2-latest
    container_name: zabbix_server
    ports:
    - "10051:10051"
    environment:
    MYSQL_USER: zabbix
    MYSQL_PASSWORD: xxx
    DB_SERVER_HOST: zabbixdb
    DB_SERVER_PORT: 3306
    MYSQL_ROOT_PASSWORD: xxx
    MYSQL_DATABASE: zabbix
    volumes:
    - /zabbix/etc/zabbix/zabbix_agentd.d:/etc/zabbix/zabbix_agentd.d
    - /zabbix/usr/lib/zabbix/alertscripts:/usr/lib/zabbix/alertscripts
    depends_on:
    - mysql
    links:
    - mysql
    
    web-frontend:
    image: zabbix/zabbix-web-apache-mysql:alpine-5.2-latest
    
    container_name: nginx_frontend
    ports:
    - "8080:8080"
    - "8443:8443"
    environment:
    MYSQL_USER: zabbix
    MYSQL_PASSWORD: xxx
    DB_SERVER_HOST: zabbixdb
    DB_SERVER_PORT: 3306
    MYSQL_ROOT_PASSWORD: xxx
    MYSQL_DATABASE: zabbix
    ZBX_SERVER_HOST: zabbix_server
    PHP_TZ: Europe/Paris
    volumes:
    - /cert:/etc/ssl/apache2
    depends_on:
    - mysql
    links:
    - mysql
    
    zabbix-java-gateway:
    image: zabbix/zabbix-java-gateway:alpine-5.2-latest
    depends_on:
    - mysql
    links:
    - mysql
    
    mysql:
    image: mysql:8
    container_name: zabbixdb
    expose:
    - 3306
    environment:
    MYSQL_ROOT_PASSWORD: xxx
    # MYSQL_DATABASE: zabbix
    MYSQL_USER: zabbix
    MYSQL_PASSWORD: xxx
    restart: always
    command: --character-set-server=utf8 --collation-server=utf8_bin --default-authentication-plugin=mysql_native_password

    Quite simple at first glance, but I don't know what is wrong. It's not the first app I'm deploying using Docker, but never struggled like that in the past .....

    Any idea ?

    Note:
    When opening a shell on the mysql docker, I can see the existing zabbix db structure, meaning all the tables have been built normally
  • Rajstopy
    Junior Member
    • Oct 2019
    • 8

    #2
    Hi,

    Actually it seems to work, but after a long long time. DB init seems to take more than 20 minutes.

    That said, I encounter now another issue, with an error message : "Zabbix server is not running : the information displayed may not be current".

    Again no idea why. It a real mess.......

    Comment

    • rameshkumar.junnuru
      Junior Member
      • Apr 2021
      • 5

      #3
      Hello Rajstopy
      Provide the entire container log output to check further your issue. And also can you try to include the following in your docker-compose file as well and re-run the docker-compose file.


      --character-set-server=utf8 --collation-server=utf8_bin
      Last edited by rameshkumar.junnuru; 28-04-2021, 14:53.

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4807

        #4
        Frontend checks servers availability by checking if servers 10051 port is available, if that connection is not available, then you should get that error. I am not too familiar with containers, but I guess you need to make sure that connection is possible.

        Comment

        • saed
          Junior Member
          • Jul 2022
          • 1

          #5
          did anyone solve this error?


          8:20210427:113800.216 using configuration file: /etc/zabbix/zabbix_server.conf 8:20210427:113800.220 cannot use database "zabbix": its "users" table is empty (is this the Zabbix proxy database?)

          Comment

          • PhilMehr
            Junior Member
            • Apr 2023
            • 1

            #6
            Hi all,

            the following worked for me:

            Zabbix Server Version: Zabbix 6.4.1 (revision 546e284)
            mysql Version: 5.7

            Start the mysql server with image version 5.7 and then zabbix, which will still fail but with message "Unable to start Zabbix server due to unsupported MySQL database version (5.07.41)".
            Then stop both and adjust mysql image version in compose file to latest (8.0), mysql will perform a db update automatically.

            Then start zabbix - and its running! (pls don't ask why)

            Best regards,
            Philip

            Comment

            Working...