Master/Slave Setup: CHANGE MASTER command was wrongly executed on Master server

Discussion in 'Installation/Configuration' started by LotNoMore, Apr 13, 2017.

  1. LotNoMore

    LotNoMore Member

    I am setting up two servers in the master/slave cluster fashion. Both are running Ubuntu 16.10 with apache. The master is running now and working well with Let's Encrypt protected login. I am following the ISPconfig manual I bought to do the installation.
    Basically I should have run the following command inside MySQL at the SLAVE server, but wrongly run it on the MASTER server:
    Code:
    CHANGE MASTER TO MASTER_HOST="server1.example.tld", MASTER_USER="slaveuser2", MASTER_PASSWORD="slave_user_password";
    What should I do to UN-DO this on the master server? Should I do this... ?
    Code:
    CHANGE MASTER TO MASTER_HOST="server1.example.tld", MASTER_USER="root", MASTER_PASSWORD="root_password";
     
  2. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    You can stop the slave and re-set the master.
     
  3. LotNoMore

    LotNoMore Member

    Thank you Florian for replying. Appreciate it a lot.
    It turns out I have to re-install the slave server anyway. As to the master server, by "re-set the master" do you mean re-do the whole things - fresh server install, server preparation and re-install of ISPconfig? Hopefully I don't have to do this but simply re-set the MySQL thing on the master server without disrupting my current ISPconfig on it.
     
  4. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    no, just reset the replicaion-settings in mysql.
     
  5. LotNoMore

    LotNoMore Member

    OK, I repeated the replication settings in mysql. I got stuck here...
    Basically I do not see anything, just the -> sign and nothing else. What could be wrong?
     
  6. LotNoMore

    LotNoMore Member

    I do notice this during the whole process: when I did this in MySQL on server1 ...
    Code:
    CREATE USER 'slaveuser2'@'server2.example.tld' IDENTIFIED BY 'slave_user_password';
    CREATE USER 'slaveuser2'@'192.168.0.106' IDENTIFIED BY 'slave_user_password';
    CREATE USER 'slaveuser2'@'2001:db8::2' IDENTIFIED BY 'slave_user_password';
    I got error warning, something like " ERROR 1396 (HY000): Operation CREATE USER failed for 'slaveuser2'@'server2.example.com' " - is it because I had created these users before?
     
    Last edited: Apr 13, 2017
  7. LotNoMore

    LotNoMore Member

    Could it be the IPv6 address? I did not assign any in the first place.
    Now, after adding an IP to the IPv6 subnet, I see two IPv6 addresses - one containing the double separators :: and one with only single : seperator. I guess I should use the one with double :: separators, right?
     
    Last edited: Apr 13, 2017
  8. LotNoMore

    LotNoMore Member

    OK, I see that I need to use the DROP USER command to drop those users first before I can create them. Looks like I should do the same at slave server MySQL as well. I thought the slave will always follow the master, no?
     
    Last edited: Apr 14, 2017
  9. LotNoMore

    LotNoMore Member

    OK, the command should be
    SHOW SLAVE STATUS\G
    I have changed the actual IP to xxx.xxx.xxx.xxx. Is there anything I should be worried about?
     
  10. LotNoMore

    LotNoMore Member

    Slave SQL not running... hmmm...
     
    Last edited: Apr 14, 2017
  11. LotNoMore

    LotNoMore Member

    OK, after repeating the CHANGE MASTER TO MASTER_HOST command, now the slave status becomes...
    Error 'Duplicate entry '1' for key 'PRIMARY'' on query - what does this mean?
     
  12. LotNoMore

    LotNoMore Member

    Now it is...
    Error 'Duplicate entry '7' for key 'PRIMARY'' on query
    Should I completely remove the database dbispconfig on the slave server or the master copy has this problem already?
     
  13. LotNoMore

    LotNoMore Member

    OK, problems fixed by doing this...
     

Share This Page