Two server cluster setup is not working as guide/manual ref.

Discussion in 'Installation/Configuration' started by strang3r, Apr 14, 2015.

  1. strang3r

    strang3r Member

    Hi,

    I followed this Howto https://www.howtoforge.com/installi...tabase-cluster-on-debian-6.0-with-ispconfig-3
    for setting up two server. I have tested on both Debian 7 and ubuntu 14.04. (not in debian 6) but I believe they are both nearly same. Also I did initial setup as suggested in guide.

    The problem that I am facing in both OS is MySQL won't start after attempting to start/restarting it after doing this step sucessfully:
    Code:
    scp -pr /var/lib/mysql/* [email protected]:/var/lib/mysql/
    scp -pr /etc/mysql/debian.cnf [email protected]:/etc/mysql/debian.cnf
    I needed to start mysql:
    Code:
    /etc/init.d/mysql start
    But it is giving me error:
    Code:
    [FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
    I believe it is connection time out error as not able to getting connect to localhost.

    This is what I see in /var/log/syslog..

    Code:
    Apr 14 18:40:44 server1 mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended
    Apr 14 18:40:56 server1 /etc/init.d/mysql[12388]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
    Apr 14 18:40:56 server1 /etc/init.d/mysql[12388]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
    Apr 14 18:40:56 server1 /etc/init.d/mysql[12388]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
    Apr 14 18:40:56 server1 /etc/init.d/mysql[12388]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
    Apr 14 18:40:56 server1 /etc/init.d/mysql[12388]: 

    But I am not understanding how that is possible.. As I was able to connect to sync master and slave and able to copy over table.

    I think this all started right after I configured MySQL nodes (Because reverting to default allows me to start mysql again)

    So this is what I added within my.cnf and yes Also uncommented localhost within it for both master and slave.

    MASTER:
    Code:
    #
    # The MySQL database server configuration file.
    #
    # You can copy this to one of:
    # - "/etc/mysql/my.cnf" to set global options,
    # - "~/.my.cnf" to set user-specific options.
    # 
    # One can use all long options that the program supports.
    # Run program with --help to get a list of available options and with
    # --print-defaults to see which it would actually understand and use.
    #
    # For explanations see
    # http://dev.mysql.com/doc/mysql/en/server-system-variables.html
    
    # This will be passed to all mysql clients
    # It has been reported that passwords should be enclosed with ticks/quotes
    # escpecially if they contain "#" chars...
    # Remember to edit /etc/mysql/debian.cnf when changing the socket location.
    [client]
    port		= 3306
    socket		= /var/run/mysqld/mysqld.sock
    
    # Here is entries for some specific programs
    # The following values assume you have at least 32M ram
    
    # This was formally known as [safe_mysqld]. Both versions are currently parsed.
    [mysqld_safe]
    socket		= /var/run/mysqld/mysqld.sock
    nice		= 0
    
    [mysqld]
    #
    # * Basic Settings
    #
    user		= mysql
    pid-file	= /var/run/mysqld/mysqld.pid
    socket		= /var/run/mysqld/mysqld.sock
    port		= 3306
    basedir		= /usr
    datadir		= /var/lib/mysql
    tmpdir		= /tmp
    lc-messages-dir	= /usr/share/mysql
    skip-external-locking
    #
    # Instead of skip-networking the default is now to listen only on
    # localhost which is more compatible and is not less secure.
    #bind-address		= 127.0.0.1
    #
    # Ispconfig master server to slave connect
    server-id = 1
    replicate-same-server-id = 0
    auto-increment-increment = 2
    auto-increment-offset = 1
     
    master-host = 192.168.0.106
    master-user = xxxxxxxx
    master-password = XXXXXXXXX
    master-connect-retry = 60   
     
    expire_logs_days        = 10
    max_binlog_size         = 500M
    log_bin                        = /var/log/mysql/mysql-bin.log  
    #
    # * Fine Tuning
    #
    key_buffer		= 16M
    max_allowed_packet	= 16M
    thread_stack		= 192K
    thread_cache_size       = 8
    # This replaces the startup script and checks MyISAM tables if needed
    # the first time they are touched
    myisam-recover         = BACKUP
    #max_connections        = 100
    #table_cache            = 64
    #thread_concurrency     = 10
    #
    # * Query Cache Configuration
    #
    query_cache_limit	= 1M
    query_cache_size        = 16M
    #
    # * Logging and Replication
    #
    # Both location gets rotated by the cronjob.
    # Be aware that this log type is a performance killer.
    # As of 5.1 you can enable the log at runtime!
    #general_log_file        = /var/log/mysql/mysql.log
    #general_log             = 1
    #
    # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.
    #
    # Here you can see queries with especially long duration
    #log_slow_queries	= /var/log/mysql/mysql-slow.log
    #long_query_time = 2
    #log-queries-not-using-indexes
    #
    # The following can be used as easy to replay backup logs or for replication.
    # note: if you are setting up a replication slave, see README.Debian about
    #       other settings you may need to change.
    #server-id		= 1
    #log_bin			= /var/log/mysql/mysql-bin.log
    #expire_logs_days	= 10
    #max_binlog_size         = 100M
    #binlog_do_db		= include_database_name
    #binlog_ignore_db	= include_database_name
    #
    # * InnoDB
    #
    # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
    # Read the manual for more InnoDB related options. There are many!
    #
    # * Security Features
    #
    # Read the manual, too, if you want chroot!
    # chroot = /var/lib/mysql/
    #
    # For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
    #
    # ssl-ca=/etc/mysql/cacert.pem
    # ssl-cert=/etc/mysql/server-cert.pem
    # ssl-key=/etc/mysql/server-key.pem
    
    
    
    [mysqldump]
    quick
    quote-names
    max_allowed_packet	= 16M
    
    [mysql]
    #no-auto-rehash	# faster start of mysql but no tab completition
    
    [isamchk]
    key_buffer		= 16M
    
    #
    # * IMPORTANT: Additional settings that can override those from this file!
    #   The files must end with '.cnf', otherwise they'll be ignored.
    #
    !includedir /etc/mysql/conf.d/
    



    to be continued.... second page please.
     
  2. strang3r

    strang3r Member

    SLAVE:
    Code:
    #
    # The MySQL database server configuration file.
    #
    # You can copy this to one of:
    # - "/etc/mysql/my.cnf" to set global options,
    # - "~/.my.cnf" to set user-specific options.
    #
    # One can use all long options that the program supports.
    # Run program with --help to get a list of available options and with
    # --print-defaults to see which it would actually understand and use.
    #
    # For explanations see
    # http://dev.mysql.com/doc/mysql/en/server-system-variables.html
    
    # This will be passed to all mysql clients
    # It has been reported that passwords should be enclosed with ticks/quotes
    # escpecially if they contain "#" chars...
    # Remember to edit /etc/mysql/debian.cnf when changing the socket location.
    [client]
    port     = 3306
    socket     = /var/run/mysqld/mysqld.sock
    
    # Here is entries for some specific programs
    # The following values assume you have at least 32M ram
    
    # This was formally known as [safe_mysqld]. Both versions are currently parsed.
    [mysqld_safe]
    socket     = /var/run/mysqld/mysqld.sock
    nice     = 0
    
    [mysqld]
    #
    # * Basic Settings
    #
    user     = mysql
    pid-file   = /var/run/mysqld/mysqld.pid
    socket     = /var/run/mysqld/mysqld.sock
    port     = 3306
    basedir     = /usr
    datadir     = /var/lib/mysql
    tmpdir     = /tmp
    lc-messages-dir   = /usr/share/mysql
    skip-external-locking
    #
    # Instead of skip-networking the default is now to listen only on
    # localhost which is more compatible and is not less secure.
    #bind-address     = 127.0.0.1
    #
    # Ispconfig slave to master
    server-id = 2
    replicate-same-server-id = 0
    auto-increment-increment = 2
    auto-increment-offset = 2
       
    master-host =192.168.0.105
    master-user = xxxxxxx
    master-password = xxxxxxxx
    master-connect-retry = 60
    expire_logs_days  = 10
    max_binlog_size  = 500M
    log_bin  = /var/log/mysql/mysql-bin.log
    #
    # * Fine Tuning
    #
    key_buffer     = 16M
    max_allowed_packet   = 16M
    thread_stack     = 192K
    thread_cache_size  = 8
    # This replaces the startup script and checks MyISAM tables if needed
    # the first time they are touched
    myisam-recover  = BACKUP
    #max_connections  = 100
    #table_cache  = 64
    #thread_concurrency  = 10
    #
    # * Query Cache Configuration
    #
    query_cache_limit   = 1M
    query_cache_size  = 16M
    #
    # * Logging and Replication
    #
    # Both location gets rotated by the cronjob.
    # Be aware that this log type is a performance killer.
    # As of 5.1 you can enable the log at runtime!
    #general_log_file  = /var/log/mysql/mysql.log
    #general_log  = 1
    #
    # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.
    #
    # Here you can see queries with especially long duration
    #log_slow_queries   = /var/log/mysql/mysql-slow.log
    #long_query_time = 2
    #log-queries-not-using-indexes
    #
    # The following can be used as easy to replay backup logs or for replication.
    # note: if you are setting up a replication slave, see README.Debian about
    #  other settings you may need to change.
    #server-id     = 1
    #log_bin       = /var/log/mysql/mysql-bin.log
    #expire_logs_days   = 10
    #max_binlog_size  = 100M
    #binlog_do_db     = include_database_name
    #binlog_ignore_db   = include_database_name
    #
    # * InnoDB
    #
    # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
    # Read the manual for more InnoDB related options. There are many!
    #
    # * Security Features
    #
    # Read the manual, too, if you want chroot!
    # chroot = /var/lib/mysql/
    #
    # For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
    #
    # ssl-ca=/etc/mysql/cacert.pem
    # ssl-cert=/etc/mysql/server-cert.pem
    # ssl-key=/etc/mysql/server-key.pem
    
    
    
    [mysqldump]
    quick
    quote-names
    max_allowed_packet   = 16M
    
    [mysql]
    #no-auto-rehash   # faster start of mysql but no tab completition
    
    [isamchk]
    key_buffer     = 16M
    
    #
    # * IMPORTANT: Additional settings that can override those from this file!
    #  The files must end with '.cnf', otherwise they'll be ignored.
    #
    !includedir /etc/mysql/conf.d/
    
    This is what my ps -ef |grep mysql stats:
    Code:
    root@server2:~# ps -ef |grep mysql
    root  24970  1748  0 14:46 pts/0  00:00:00 grep mysql
    
    and my sql version ->
    Master:
    Code:
    mysql  Ver 14.14 Distrib 5.5.41, for debian-linux-gnu (x86_64) using readline 6.2
    
    Slave:
    Code:
    mysql  Ver 14.14 Distrib 5.5.41, for debian-linux-gnu (i686) using readline 6.2
    
    Any help would be really appreciate please.

    Thanks.
     
  3. florian030

    florian030 Well-Known Member HowtoForge Supporter

    Please check, that /var/lib/mysql belongs to user and group mysql.
    Your mysql-configs are for an outdated mysql-version. You must remove the master*-settings from the configfiles and set the values within mysql.
     
  4. strang3r

    strang3r Member


    Hi floarian030, Thank you for your great response!. I have followed up your suggestion and added those values within mysql. So I passed the stage for installing ispconfig on first server (master). But Now I am getting problem on installing ispconfig on second server (slave) in expert mode. After following the installation promots I needed to type my master mysql root username, password, database name, hostname, I have inserted all information regarding server1.domain.tld mysql auth. But It is telling me that unable to connect to mysql server. I believe that password is same. And it supposed to be same for both Master and Slave.
    There is nothing I could find in syslog... Except something random which I never seen before..... and Idk is it..... Happening after getting this above error.

    Code:
    Apr 15 08:25:36 server2 named[3916]: client 202.73.99.2#19809: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:36 server2 named[3916]: client 202.73.99.2#62915: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:36 server2 named[3916]: client 202.73.99.4#10738: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:36 server2 named[3916]: client 68.111.104.200#58338: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:36 server2 named[3916]: client 68.111.104.200#58338: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:36 server2 named[3916]: client 202.73.99.2#9296: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:36 server2 named[3916]: client 68.111.104.200#58338: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:37 server2 named[3916]: client 202.73.99.4#28416: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:37 server2 named[3916]: client 202.73.99.2#62727: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:37 server2 named[3916]: client 61.247.0.130#30470: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:37 server2 named[3916]: client 202.73.99.2#5545: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:37 server2 named[3916]: client 61.247.0.130#5870: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:37 server2 named[3916]: client 61.247.0.130#41534: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:38 server2 named[3916]: client 61.247.0.130#51690: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:38 server2 named[3916]: client 61.247.0.130#5978: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:39 server2 named[3916]: client 202.73.99.4#64471: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:39 server2 named[3916]: client 202.73.99.4#53800: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:39 server2 named[3916]: client 202.73.99.4#17333: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:39 server2 named[3916]: client 202.73.99.4#22280: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:40 server2 named[3916]: client 202.73.99.4#21325: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:41 server2 named[3916]: client 68.111.104.200#58367: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:41 server2 named[3916]: client 68.111.104.200#58367: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:41 server2 named[3916]: client 87.216.0.174#36282: query (cache) 'gampink.com/A/IN' denied
    Apr 15 08:25:41 server2 named[3916]: client 68.111.104.200#58367: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:41 server2 named[3916]: client 87.216.0.174#53928: query (cache) 'gampink.com/A/IN' denied
    Apr 15 08:25:43 server2 named[3916]: client 202.73.99.2#53751: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:43 server2 named[3916]: client 202.73.99.2#26708: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:43 server2 named[3916]: client 202.73.99.2#12603: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:43 server2 named[3916]: client 202.73.99.2#63810: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:44 server2 named[3916]: client 202.73.99.2#22850: query (cache) 'dirkitchen.com/A/IN' denied
    Apr 15 08:25:49 server2 named[3916]: client 87.216.0.174#51557: query (cache) 'gampink.com/A/IN' denied
    Apr 15 08:25:49 server2 named[3916]: client 87.216.0.174#22301: query (cache) 'gampink.com/A/IN' denied
    
    This are not my websites and nither my ips. Idk where they came from either.

    This are some error I have in Server 1 Syslog right after trying to connecting from slave while trying to installing ispconfig:
    Code:
    Apr 15 12:51:01 server1 /USR/SBIN/CRON[22674]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 > /dev/null | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done)
    Apr 15 12:51:01 server1 dovecot: auth: Fatal: Unknown database driver 'mysql'
    Apr 15 12:51:01 server1 dovecot: master: Error: service(auth): command startup failed, throttling for 60 secs
    
    Also kindly let me know how can I connet to master mysql. As this is not letting me to do it... Is this because I removed master*-settings from my.cnf? But I have added them in mysql.


    Thanks.
     
    Last edited: Apr 15, 2015
  5. florian030

    florian030 Well-Known Member HowtoForge Supporter

    Can you connect as root from server2 to mysql server1? Maybe root is not allowed to login from server2.
    I just this setup a few years ago. IIRC you must have a mysql-master-master-replication up and running before installing ispconfig.
     

Share This Page