Communication problem with database server

Discussion in 'General' started by minttux, Jun 30, 2016.

  1. minttux

    minttux Member

    hi i had multiple installation server with three server: master - database - mail
    i changed two master and database server ip address now i have Communication problem with database server
    also i changed ip addresses wherever but when i create user or database nothing happen in database server and there is nothing in log:
    Code:
    30.06.2016-15:25 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    30.06.2016-15:25 - DEBUG - Found 1 changes, starting update process.
    30.06.2016-15:25 - DEBUG - Calling function 'db_user_update' from plugin 'mysql_clientdb_plugin' raised by event 'database_user_update'.
    30.06.2016-15:25 - DEBUG - Changing MySQL user password for: user2_test@localhost
    30.06.2016-15:25 - DEBUG - Changing MySQL user password for: [email protected]
    30.06.2016-15:25 - DEBUG - Processed datalog_id 2064
    
    databaserver log is nothing added
    how is mechanism of communication to DB server? because i don't see any remote user or any user connection in database
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The slave server connects to the database of the master server with its ispcsrv* user, the user is defined in the two config.inc.php files of ispconfig. The creation of databases is then done on the slave by using the local mysql root login as defined in /usr/local/ispconfig/server/lib/mysql_clientdb.conf
     
  3. minttux

    minttux Member

    i have these users in master database
    but in /usr/local/ispconfig/server/lib/mysql_clientdb.conf i have username and root password of each server database
    upload_2016-6-30_22-35-31.png
    and correct password how to trace what happening it doesn't create database ?
    there is any log?
     
    Last edited: Jul 1, 2016
  4. minttux

    minttux Member

    also i don't understand ispcsrv* is on master database but database generated on slave database so this username is for slave database to connect to master database (so we make this user on master database ) how is it possible ?
     
  5. minttux

    minttux Member

    I found something new on db slave server when i run: # /usr/local/ispconfig/server/server.sh then i got:
    Code:
    root@mydb:/home/mrg# /usr/local/ispconfig/server/server.sh
    PHP Warning:  mysqli::__construct(): (HY000/2002): Network is unreachable in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 62
    DB::__construct Network is unreachable
    
     
  6. minttux

    minttux Member

    i update this file: /usr/local/ispconfig/interface/lib/config.inc.php and set new master ip also i try to connect to master ip and ispcsrv2 user with password stored in /usr/local/ispconfig/interface/lib/config.inc.php and it could connect:
    upload_2016-6-30_23-8-42.png
    but when i run /usr/local/ispconfig/server/server.sh on slave db server i get:
    Code:
    root@mydb:/home/mrg# /usr/local/ispconfig/server/server.sh
    PHP Warning:  mysqli::__construct(): (HY000/2002): Network is unreachable in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 62
    DB::__construct Network is unreachable
    PHP Warning:  mysqli::__construct(): (HY000/2002): Network is unreachable in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 72
    DB::__construct Network is unreachable
    PHP Warning:  mysqli::__construct(): (HY000/2002): Network is unreachable in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 72
    ^C
    also i have ping to 192.168.1.5:
    Code:
    root@mydb:/home/mrg# ping 192.168.1.5
    PING 192.168.1.5 (192.168.1.5) 56(84) bytes of data.
    64 bytes from 192.168.1.5: icmp_seq=1 ttl=64 time=0.312 ms
    64 bytes from 192.168.1.5: icmp_seq=2 ttl=64 time=0.310 ms
    64 bytes from 192.168.1.5: icmp_seq=3 ttl=64 time=0.320 ms
    also it's not bloacked:
    Code:
    root@mydb:/home/mrg# iptables -L INPUT -n
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination        
    fail2ban-ssh  tcp  --  0.0.0.0/0            0.0.0.0/0            multiport dports 22
     
  7. minttux

    minttux Member

    i put a debug line in this script: /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php
    upload_2016-6-30_23-15-51.png
    and output is:
    Code:
    root@mydb:/home/mrg# /usr/local/ispconfig/server/server.sh
    PHP Warning:  mysqli::__construct(): (HY000/2002): Network is unreachable in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 62
    DB::__construct Network is unreachable
    Debug: 185.81.96.35
    it's strange this ip: 185.81.96.35 didn't change it should be 192.168.1.5
    why?
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Check the /etc/hsts file on the slave. And the database host is never an IP, so ensure that you dont enter an IP address in the config.inc.php files, the name of the master is always the hostname of the master.
     
  9. minttux

    minttux Member

    it's host:
    Code:
    root@mydb:/usr/local/ispconfig# cat /etc/hosts
    127.0.0.1    localhost
    127.0.1.1    mydb.****.com    mydb
    192.168.1.6    mydb.****.com   mydb
    192.168.1.5    server.****.com
    # The following lines are desirable for IPv6 capable hosts
    ::1     localhost ip6-localhost ip6-loopback
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    if you mean by config.inc is /usr/local/ispconfig/interface/lib/config.inc.php it
    it was ip (without i touched) then i changed to 192.168.1.5 and now put host as you said but i get same error
     
    Last edited: Jul 1, 2016
  10. minttux

    minttux Member

    Solved but it was ip in both config file and when i changed to new ip it works. now you say it's better hostname?
     
    Last edited: Jul 1, 2016
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    The files should contain the hostname as requested by the ispconfig installer. If they contain the IP, then you must have either changed that manually before or entered a wrong value during installation.
     

Share This Page