Ad Widget

Collapse

Zabbix Server - Can't connect to the database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dougpss
    Junior Member
    • Mar 2023
    • 2

    #1

    Zabbix Server - Can't connect to the database

    Hello Guys,

    I've set Zabbix HA with 2 nodes and MySQL InnoDB Cluster with the Router in the same servers with Zabbix-Server.

    From "Zabbix Server/MySQL Router" I can connect to the dababase from the shell using mysql client both directly or using the Router "127.0.0.1:6446"



    #################
    root@zabserver2:~# mysql -uadmin -p -h127.0.0.1 -P 6446
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 50024
    Server version: 8.0.32-cluster MySQL Cluster Community Server - GPL

    Copyright (c) 2000, 2023, Oracle and/or its affiliates.

    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    mysql> show databases;
    +-------------------------------+
    | Database |
    +-------------------------------+
    | information_schema |
    | mysql |
    | mysql_innodb_cluster_metadata |
    | performance_schema |
    | sys |
    | zabbix |
    +-------------------------------+
    6 rows in set (0.00 sec)

    mysql>
    ###################


    Zabbix connect to the database if I use any of the MySQL Servers node IP directly not complaining about RSA key, but if I set the MySQL Router "127.0.0.1" and port "6446" in zabbix_server.conf then I get the error bellow when I try to start Zabbix-Server:


    7243:20230315:153333.460 Starting Zabbix Server. Zabbix 6.4.0 (revision 5b2736b6027).
    7243:20230315:153333.460 ****** Enabled features ******
    7243:20230315:153333.460 SNMP monitoring: YES
    7243:20230315:153333.460 IPMI monitoring: YES
    7243:20230315:153333.460 Web monitoring: YES
    7243:20230315:153333.460 VMware monitoring: YES
    7243:20230315:153333.460 SMTP authentication: YES
    7243:20230315:153333.460 ODBC: YES
    7243:20230315:153333.460 SSH support: YES
    7243:20230315:153333.460 IPv6 support: YES
    7243:20230315:153333.460 TLS support: YES
    7243:20230315:153333.460 using configuration file: /etc/zabbix/zabbix_server.conf
    7243:20230315:153333.463 [Z3001] connection to database 'zabbix' failed: [2061] Couldn't read RSA public key from server
    7243:20230315:153333.463 Cannot connect to the database. Exiting...​

    Any Idea on how can I fix this?

    Thank you!​
  • Sub
    Junior Member
    • Feb 2019
    • 12

    #2
    Hello Dougpss, I have the same installation and the same issue ...
    Based on your and my test, I confirm that the issue is related to mysql-router 8.0.31 version
    I've performed a Wireshark trace on the loopback address, you can see an authentication behavior difference between 8.0.31 et 8.0.32 version:​
    • on 8.0.32 (with the connection issue):
    Click image for larger version

Name:	mysql-router-community-8.0.32.png
Views:	1321
Size:	192.8 KB
ID:	461249
    • on 8.0.31, no issue:
    Click image for larger version

Name:	mysql-router-community-8.0.31.png
Views:	1297
Size:	814.1 KB
ID:	461251

    There is an additional packet (n°80 - Auth Switch Request) visible. This behavior difference makes the issue I guess.

    I've reinstalled the 8.0.31 version on my CentOS 9 stream and it works fine for I:
    Code:
    dnf install mysql-router-community-8.0.31-1.el9.x86_64
    I hope it's just a bug in 8.0.31 and it will be fixed in the 8.0.33. Perhaps, it deserves to create a case on https://bugs.mysql.com/

    Cheers,
    Attached Files

    Comment

    • dougpss
      Junior Member
      • Mar 2023
      • 2

      #3
      Hello Sub, I tested with 8.0.31 version and it worked for me as well.

      Thanks!

      Comment

      • Sub
        Junior Member
        • Feb 2019
        • 12

        #4
        Obviously, there is the same issue during the installation process. It leads to a 504 error from Nginx. Workaround applied with success.

        In the meanwhile, a MySQL bug has been created: https://bugs.mysql.com/bug.php?id=110623

        Comment

        • mohammed ashraf
          Junior Member
          • Sep 2023
          • 1

          #5
          I am using mysql operator version 8.1.0-2.1.0 and when i try to use mysql utility to connect to mysql router i get the same error
          ERROR 2061 (HY000): Couldn't read RSA public key from server
          but if i tried to connect to mysql db server it works fine so is there a way to fix this issue

          Comment

          Working...