installing-a-web-email-and-mysql-dbcluster-on-debian6

Discussion in 'HOWTO-Related Questions' started by zephyrnet, Jun 5, 2012.

  1. zephyrnet

    zephyrnet New Member

    Hi,

    Im following this tutorial http://www.howtoforge.com/installing-a-web-email-and-mysql-database-cluster-on-debian-6.0-with-ispconfig-3

    Ive followed up to foillowing steps:
    scp -pr /var/lib/mysql/* [email protected]:/var/lib/mysql/
    scp -pr /etc/mysql/debian.cnf [email protected]:/etc/mysql/debian.cnf
    Now we start MySQL on the master server again:
    /etc/init.d/mysql start
    Log into the MySQL shell as root user...
    mysql -u root -p

    ... and execute this command in the MySQL shell...

    SHOW MASTER STATUS;
    ... to get the MySQL master status:

    mysql> SHOW MASTER STATUS;
    +------------------+----------+--------------+------------------+
    | File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
    +------------------+----------+--------------+------------------+
    | mysql-bin.000005 | 106 | | |
    +------------------+----------+--------------+------------------+
    1 row in set (0.00 sec)


    after
    Show SLave Status \g

    I get ....

    SHOW SLAVE STATUS \G
    *************************** 1. row ***************************
    Slave_IO_State: Connecting to master
    Master_Host: xxx.xxx.xxx.60
    Master_User: slaveuser
    Master_Port: 3306
    Connect_Retry: 60
    Master_Log_File: mysql-bin.000005
    Read_Master_Log_Pos: 106
    Relay_Log_File: mysqld-relay-bin.000001
    Relay_Log_Pos: 4
    Relay_Master_Log_File: mysql-bin.000005
    Slave_IO_Running: No
    Slave_SQL_Running: Yes
    Replicate_Do_DB:
    Replicate_Ignore_DB:
    Replicate_Do_Table:
    Replicate_Ignore_Table:
    Replicate_Wild_Do_Table:
    Replicate_Wild_Ignore_Table:
    Last_Errno: 0
    Last_Error:
    Skip_Counter: 0
    Exec_Master_Log_Pos: 106
    Relay_Log_Space: 106
    Until_Condition: None
    Until_Log_File:
    Until_Log_Pos: 0
    Master_SSL_Allowed: No
    Master_SSL_CA_File:
    Master_SSL_CA_Path:
    Master_SSL_Cert:
    Master_SSL_Cipher:
    Master_SSL_Key:
    Seconds_Behind_Master: NULL
    Master_SSL_Verify_Server_Cert: No
    Last_IO_Errno: 2013
    Last_IO_Error: error connecting to master '[email protected]:3306' - retry-time: 60 retries: 86400
    Last_SQL_Errno: 0
    Last_SQL_Error:

    SO slave IO is not running :-(

    When I tried the next part :

    On server 2:
    Log into the MySQL shell as root user...
    mysql -u root -p

    I get this error message :
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    I think its because the tutorial said to switch off mysql on server 2 in a previous step, and never mentions to restart it. As if i start it again, it lets me log in. If so, Ive a feeling that server 2 should have either not been turned off, or turned on at some point before and possibly cause of previous errors. Ive been over and over it wit a fresh pair of eyes 5 times hence Master_Log_File: mysql-bin.000005

    Is anyone able to point me in the right direction? I think Ive missed a really simple obvious step, but cant see where. Possibly one missing from howto? DO I need to reformat and start from scratch or can these be saved ?:eek:
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Start the mysql on as first step after "On server 2:" and the error on the master will go away.
     
  3. zephyrnet

    zephyrnet New Member

    Thanks Till. Really appreciate your assistance.
    (server 2)
    That error has gone away on but now I get

    ERROR 29 (HY000): File '/var/lib/mysql/master.info' not found (Errcode: 13)
    when running

    STOP SLAVE;
    CHANGE MASTER TO MASTER_HOST='xx.xx.xx.59', MASTER_USER='slaveuser', MASTER_PASSWORD='xxxxx', MASTER_LOG_FILE='mysql-bin.000005', MASTER_LOG_POS=106;
    START SLAVE;

    Ive googled it, but only suffered brain melt as a result.

    (server 1)
    When i run SHOW SLAVE STATUS \G i get the following - notice the bold bits :-(

    Slave_IO_State:
    Master_Host: x.x.x.60
    Master_User: slaveuser
    Master_Port: 3306
    Connect_Retry: 60
    Master_Log_File: mysql-bin.000005
    Read_Master_Log_Pos: 106
    Relay_Log_File: mysqld-relay-bin.000001
    Relay_Log_Pos: 4
    Relay_Master_Log_File: mysql-bin.000005
    Slave_IO_Running: No
    Slave_SQL_Running: Yes

    Replicate_Do_DB:
    Replicate_Ignore_DB:
    Replicate_Do_Table:
    Replicate_Ignore_Table:
    Replicate_Wild_Do_Table:
    Replicate_Wild_Ignore_Table:
    Last_Errno: 0
    Last_Error:
    Skip_Counter: 0
    Exec_Master_Log_Pos: 106
    Relay_Log_Space: 106
    Until_Condition: None
    Until_Log_File:
    Until_Log_Pos: 0
    Master_SSL_Allowed: No
    Master_SSL_CA_File:
    Master_SSL_CA_Path:
    Master_SSL_Cert:
    Master_SSL_Cipher:
    Master_SSL_Key:
    Seconds_Behind_Master: NULL
    Master_SSL_Verify_Server_Cert: No
    Last_IO_Errno: 1236
    Last_IO_Error: Got fatal error 1236 from master when reading dat a from binary log: 'Could not find first log file name in binary log index file'

    Last_SQL_Errno: 0
    Last_SQL_Error:
     
  4. zephyrnet

    zephyrnet New Member

    Ive tried everything i can think of, getting the last error I mentioned.

    Ill have to start from beginning I think as im in a hurry, but would have been great to learn from my mistakes so idont make it again :)

    SO if anyone encounters same thing , and finds out why it happened, please do let me know :D
     
  5. zephyrnet

    zephyrnet New Member

    installing web mailmysq database cluster debian - adding 2nd Slave

    Hi,
    The 2nd time around I followed this tutorial it worked :D SO many thanks

    I now have 2 mirrored servers, although they are both in the same place.

    How can I add a third server (2nd slave) into the mix ? For complete redundancy.

    Also does anyone have any suggestions for some sort of automated backup? Of databases & files. Or is it easy to restore a failed server into the mix? I can only see some older tutorials, and technology moves so fast.....

    Im guessing id need to, (well like to) image both master & slaves. For speedy recover in a crisis.

    D
     

Share This Page