Ad Widget

Collapse

Error connecting to database (111)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • p0lYc0M20!
    Junior Member
    • Jul 2015
    • 2

    #1

    Error connecting to database (111)

    Hello,

    I have inherited a Zabbix installation and have been going through and trying to determine the cause of the error I'm getting that reads "Error connecting to database : Unknown MySQL server host 'zabbix-db' (111). There are other databases on the zabbix-db server that are currently servicing other apps and they seem to have no issues. I have a main zabbix server, a MySQL database server (which would be called zabbix-db) and a zabbixpoller machine. So in all there are 3 zabbix hosts in my setup. Database, main server, and a poller. All are VMs. Saturday 11-5 (6:45) evening I stopped getting any more notifications from the system. I didn't notice this until the next day have been trying to track down the issue of why there isn't a database connection any longer. I have checked MySQL and the database is still present on the server.

    There have been no DNS changes, software updates, or IP address changes. The servers have been very dependable for close to a year. I'm looking for the best place to start troubleshooting this issue since nothing has changed and the only person to make such a change would be me. I have all servers backed up with Veeam as they are all virtual but would like to get to the root of the issue before just restoring the VM (whichever one has the issue). I'm new to zabbix and would appreciate if someone could point me in the right direction here.

    I will add to this and post some logs. MySQL is running and listening on the zabbix-db server. Not having set this up from scratch I'll be taking a look at the application server PHP config to make sure nothing has changed.



    Thanks,

    J
    Last edited by p0lYc0M20!; 08-11-2016, 15:31.
  • plui
    Junior Member
    • Sep 2016
    • 10

    #2
    In /etc/zabbix/zabbix_server.conf, there are DB connection details that Zabbix uses to connect, such as:

    Code:
    DBHost=localhost
    DBName=zabbixdb
    DBUser=zabbix
    DBPassword=zabbix
    Did you try using the above to login?

    Comment

    • p0lYc0M20!
      Junior Member
      • Jul 2015
      • 2

      #3
      Thanks for the response. I checked the configuyration file as well as the MySQL permissions on the database server just to be sure.

      On the zabbixdb server (the server actually has a FQDN that the permissions for the user "zabbix" has the host property of "%" which means it shouldn't matter what host thye login comes from.

      In the zabbix application server application server configuration file properties are as follows:

      DBName=zabbix
      DBUser=zabbix
      DBPassword=mypassword

      There is another entry in the configuration file

      DBHost=zabbixdb.domain.local

      Thi is the correct host name for the server that hold the MySQL databases that the application server needs to see.

      I have logged into MySQL locally with the zabbix user account that the application server is attempting to use. However, it looks like I'm not getting access denied but rather some sort of DNS error. I have checked the DNS records and they have not changed at all. If I was able to access the database at all from the application server I would think I would be getting permission denied if there was an issues with the account.

      I can ping the host name of the zabbixdb server from the application server. However for some reason it will not see this host as a MySQL Server host. I have verified that the service is running by doing:

      sudo netstat -plutn | grep -i sql

      The output is (edited for security): tcp 0 0 'zabbixdb ip':3306 0.0.0.0.0 LISTEN 1210/mysqld

      Networking wise...everything looks fine to me.

      Comment

      Working...