MYsql replication questions.
Have a question about replication. I read this statement on MYsql's website:
"•Data security - because data is replicated to the slave, and the slave can pause the replication process, it is possible to run backup services on the slave without corrupting the corresponding master data. "
Question 1: Does this mean everytime a backup script is run in ispconfig 2 there is a chance I could corrupt my databases? Is it a minute possiblity or is it fairly common?
Question 2: I found a few different replication tutorials on HowToForge, one covering master-slave and one covering master-master. Is a master-master vulnerable to the same corruption? Is a master-slave scenario safer all the way around?
Question 3: In falko's tutorial "http://www.howtoforge.com/mysql5_master_master_replication_debian_etch" he mentions:
"The advantages of master-master replication over the traditional master-slave replication are that you don't have to modify your applications to make write accesses only to the master"
Does this mean if I use a master-slave replication I have to tell ISPConfig 2 to only wrtite to the master or something like that?
Thanks as always folks,
now you tell your applications to shoot inserts, deletes, updates etc to the master, and selects to the slave .. or use your master for everything, and just keep your slave solely for backing up your data.
Thanks alot for the answers Mark,
I think I will start off with just a slave for backups only. Then as I get better with Linux, I will try the whole splitting commands between the master and slave thing lol
You could write a mysql class like i did .. what it does it checks if the query starts with SELECT or something else, depending on what it runs the query on the correct server.
A few more questions if I could.
I encountered an error on my slave. A few questions I would ask if possible:
1. Error was this:
Aug 31 12:11:16 server2 mysqld: 100831 12:11:16 [ERROR] Slave: Error 'Duplicate entry 'random data' for key 1' on query. Default database: 'web4db1'. Query: 'INSERT INTO `jos_session` ( `session_id`,`time`,`username`,`gid`,`guest`,`clie nt_id` ) VALUES ( 'random data','random data','','0','1','0' )', Error_code: 1062
Aug 31 12:11:16 server2 mysqld: 100831 12:11:16 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000001' position 8683
I several sites installed on ISPConfig some playing around with Drupal, some with joomla etc etc. For instance web1db1 and web4db1 both are Joomla so both have a table "jos_session" since they are completely different databases that shouldn't be a problem correct? What usually causes this error and where should I investigate first?
2. While researching this error some sites have said to insert "slave-skip-errors = 1062" into config file for slave. Is this wise or just mearly a bandaid type of thing?
Thanks as always for the help folks,
skipping slave errors should only be used if you know the problem that occured won't be of any problem for the rest of the replication .. the error tells you that there is already a record in that table with the same key ..
1. Do you have "read only" in your slave config?
2. Remember that a SUPER user is exempt for "read only" (they can always edit data on a read only server)
3. if you're sure you can continue do:
SHOW SLAVE STATUS;
and check if the "Seconds Behind master" field is decreasing..
Man this is sad.
Well I think I must have horrid mysql karma or something lol
So I followed your instructions, all seemed well. I then saw a new tutorial by falko of setting up master slave replication with ssl. Now I'm just on a private network playing around and stuff so I don't NEED security lol but figured what the hell lets play around with it.
Now I get this error in syslog:
Sep 2 05:00:05 server2 mysqld: 100902 5:00:05 [ERROR] Slave I/O thread: error connecting to master 'email@example.com:3306': Error: 'Access denied for user 'slave_user'@'10.1.10.124' (using password: YES)' errno: 1045 retry-time: 60 retries: 86400
After searching the forums I found a post where it was possibly a firewall problem. Now before the ssl the slave was working just fine until it hit that duplication error, so I wouldn't think it is a firewall issue. I found this command as well:
mysql -u firstname.lastname@example.org -pmypassword
This returns with this error:
ERROR 1045 <28000>: Access denied for user 'email@example.com.'@'localhost' <using password: YES>
It cuts off the host after 5 digits, don't know if that is normal either?
So any ideas folks?
Thanks as always for your time,
lol alls well that ends well.
Well when I followed the tutorial I copied and pasted falko's commands into notepad then made my changes to db names, ip's etc and saved the file. I went back through it and there were no typos.
I went through both master and slave and reversed all changes I had made. then opened up notepad and repasted the commands from the tutorial, the error went away lol
I'm thinking maybe I grabbed an extra space or something copying and pasting back and forth between notepad, thats the only thing I can think of.
Thanks as always folks,
|All times are GMT +2. The time now is 04:44.|
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.