Find the answer to your Linux question:
Results 1 to 6 of 6
Building a couple of mysql 5.0.77 servers for replication testing and eventual deployment. This is a very new concept for me and I have a couple of questions. 1) I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! lockon's Avatar
    Join Date
    Jun 2008
    Location
    USA
    Posts
    25

    Mysql replication


    Building a couple of mysql 5.0.77 servers for replication testing and eventual deployment. This is a very new concept for me and I have a couple of questions.

    1) I am looking for any tutorials available if you know of anything good that will get me up and runnig fairly quick that would be awesome.
    2) I am playing around trying to set up the master:slave and I get utter failure when I start the slave:

    I have run the CAHNGE MASTER TO command and this does not work, I have edited the my.conf as follows for the slave and master:
    master:
    Code:
    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    
    old_passwords=1
    
    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid
    server-id=1
    log-bin=test-bin
    innodb_flush_log_at_trx_commit=1
    sync_binlog=1
    Code:
    mysqlmaster> SHOW MASTER STATUS;
    Empty set (0.00 sec)
    slave:
    Code:
    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    old_passwords=1
    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid
    server-id=2
    log-bin=test-bin
    innodb_flush_log_at_trx_commit=1
    sync_binlog=1
    Code:
    mysqlslave> start slave;
    ERROR 1200 (HY000): The server is not configured as slave; fix in config file or with CHANGE MASTER TO


    any ideas on why this is failing. all the forums and other web docs point to the server-id not being unique on each server but as you can see that isn't the case here.

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,756
    Google: mysql replication howto

    Doesn't get any easier than this.

  3. #3
    Just Joined! lockon's Avatar
    Join Date
    Jun 2008
    Location
    USA
    Posts
    25
    That is a good tutorial, and the one I followed to originally setup the replication, problem being it wors the exact same the second time I watch it and follow it. I still get the following in the master when I run show master status:
    Code:
    mysql> show master status;
    Empty set (0.00 sec)
    I assume that there is a setting somewhere that is being missed but I can't find anything useful on the interwebs. Has anyone encountered this before and if so how did you resolve?

  4. #4
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,756
    General troubleshooting: review the log for messages/errors. If you are not sure where the log is, you can Google for mysql replication troubleshooting.

  5. #5
    Just Joined! lockon's Avatar
    Join Date
    Jun 2008
    Location
    USA
    Posts
    25
    Found the problem, had to swap the position on a couple of lines in the my.cnf.

    Thanks for the help with this, now on to clustering and HA

  6. #6
    Just Joined! lockon's Avatar
    Join Date
    Jun 2008
    Location
    USA
    Posts
    25
    Actually I do have another question, though I may get the answer upon my further reading.

    If I am to set up replication on a database that is already created and has data in it, will the slave be brought up to date with the existing info upon initialization of the replication or will I need to do a dump of the master db and put that on the slave prior to starting replication ( i.e. have identical data sets prior to beginning)?

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •