![]() | |
#11
| |||
| |||
|
|
data? |
|
Regards, Devin |
#12
| |||
| |||
|
|
On Oct 28, 1:56 pm, Jerry Stuckle<jstuck... (AT) attglobal (DOT) net> wrote: On 10/28/2010 4:28 PM, Devin M wrote: On Oct 28, 1:25 pm, The Natural Philosopher<t... (AT) invalid (DOT) invalid wrote: Devin M wrote: Hello, I am wondering what would be the most efficient way to synchronize two slave databases to a master database.. Basically I need an efficient way to find if a database is out of sync and a way to sync it back to the master. Any help would be appreciated, Devin Morin Real time? Or some sort of backup? as far as backup goes, you can, as I have discovered, rsync ISAM files. Ugly but it works, especially if you stop the mysqld process while you do it. Real time syncing is another matter. Real time, would probably like to have it compare every 5 min with a cron job and then sync if it needs to. TNP is incorrect (as usual). You can't just rsync the files without stopping MySQL. A lot of data may still be held in the buffers and not written to disk yet. The result will be an inconsistent database. Have you looked into replication? -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstuck... (AT) attglobal (DOT) net ================== Looks like my reply got lost, Basically I have a few DNS servers that need to pull the records from a master database server and keep them on a local mysql server. I have not looked into replication but basically what I am thinking about doing is writing a daemon in C that can run on the two different servers, check for any missing or incorrect data on the slave side and use the master server as the data source. The only problem I have with this is a lack of experience with the C library. Can you recommend a efficient way to compare and send data? Regards, Devin |
#13
| |||
| |||
|
|
Devin M wrote: On Oct 28, 1:56 pm, Jerry Stuckle <jstuck... (AT) attglobal (DOT) net> wrote: On 10/28/2010 4:28 PM, Devin M wrote: On Oct 28, 1:25 pm, The Natural Philosopher<t... (AT) invalid (DOT) invalid wrote: Devin M wrote: Hello, I am wondering what would be the most efficient way to synchronize two slave databases to a master database.. Basically I need an efficient way to find if a database is out of sync and a way to sync it back to the master. Any help would be appreciated, Devin Morin Real time? Or some sort of backup? as far as backup goes, you can, as I have discovered, rsync ISAM files. Ugly but it works, especially if you stop the mysqld process while you do it. Real time syncing is another matter. Real time, would probably like to have it compare every 5 min with a cron job and then sync if it needs to. TNP is incorrect (as usual). You can't just rsync the files without stopping MySQL. A lot of data may still be held in the buffers and not written to disk yet. The result will be an inconsistent database. which is more or less what I said, of course.... |
#14
| |||
| |||
|
|
The Natural Philosopher wrote: Devin M wrote: On Oct 28, 1:56 pm, Jerry Stuckle <jstuck... (AT) attglobal (DOT) net> wrote: On 10/28/2010 4:28 PM, Devin M wrote: On Oct 28, 1:25 pm, The Natural Philosopher<t... (AT) invalid (DOT) invalid wrote: Devin M wrote: Hello, I am wondering what would be the most efficient way to synchronize two slave databases to a master database.. Basically I need an efficient way to find if a database is out of sync and a way to sync it back to the master. Any help would be appreciated, Devin Morin Real time? Or some sort of backup? as far as backup goes, you can, as I have discovered, rsync ISAM files. Ugly but it works, especially if you stop the mysqld process while you do it. Real time syncing is another matter. Real time, would probably like to have it compare every 5 min with a cron job and then sync if it needs to. TNP is incorrect (as usual). You can't just rsync the files without stopping MySQL. A lot of data may still be held in the buffers and not written to disk yet. The result will be an inconsistent database. which is more or less what I said, of course.... No... not really. I said "Ugly but it works, especially if you stop the mysqld process |
#15
| |||
| |||
|
|
Norman Peelman wrote: The Natural Philosopher wrote: Devin M wrote: On Oct 28, 1:56 pm, Jerry Stuckle <jstuck... (AT) attglobal (DOT) net> wrote: On 10/28/2010 4:28 PM, Devin M wrote: On Oct 28, 1:25 pm, The Natural Philosopher<t... (AT) invalid (DOT) invalid wrote: Devin M wrote: Hello, I am wondering what would be the most efficient way to synchronize two slave databases to a master database.. Basically I need an efficient way to find if a database is out of sync and a way to sync it back to the master. Any help would be appreciated, Devin Morin Real time? Or some sort of backup? as far as backup goes, you can, as I have discovered, rsync ISAM files. Ugly but it works, especially if you stop the mysqld process while you do it. Real time syncing is another matter. Real time, would probably like to have it compare every 5 min with a cron job and then sync if it needs to. TNP is incorrect (as usual). You can't just rsync the files without stopping MySQL. A lot of data may still be held in the buffers and not written to disk yet. The result will be an inconsistent database. which is more or less what I said, of course.... No... not really. I said "Ugly but it works, especially if you stop the mysqld process while you do it. " Two things to note. If its a linux or *nix host, which mine is. as long as the data has been passed to the operating system, whether its been actually written to the disk or not, is not an issue. The operating system will still return the correct data been if its in the OS disk buffers. Once more Stuckle ignorance is plain to see. Secondly, the next time you sync, any inconsistent data will be corrected. So if its purely a backup, it *is* adequate. if you briefly STOP the mysqld process, thereby flushing any buffers it has, the sync is correct. There are no issues whastoever. Iv'e done this on many occasions. Zero corruption. . I would also say that if mysqld does NOT flush its actual real file update buffers at the end of every connection to the OS, its a pretty unsafe bit of kit, unexpected machine power loss or program crash is bad enough at the best of times. No point in making it worse.. There is absolutely no point in retaining disk write buffers anyway: the OS caches those as well as or better than MYSQL can. What Msqld needs to do is retain copies of what has been passed to the OS, i.e. a record of what is in the OS cache or on the disk. Which it certainly does. It wont update data it doesn't need to. Further investigation unveiled this. (http://lists.mysql.com/mysql/177466) |
|
periodic flush to disk), then some of the data will not be committed to disk, and if we had a subsequent power failure, then any data since the last flush would be lost? We have innodb_flush_log_at_trx_commit set to 1." |
#16
| |||
| |||
|
|
On Oct 28, 1:56 pm, Jerry Stuckle<jstuck... (AT) attglobal (DOT) net> wrote: On 10/28/2010 4:28 PM, Devin M wrote: On Oct 28, 1:25 pm, The Natural Philosopher<t... (AT) invalid (DOT) invalid wrote: Devin M wrote: Hello, I am wondering what would be the most efficient way to synchronize two slave databases to a master database.. Basically I need an efficient way to find if a database is out of sync and a way to sync it back to the master. Have you looked into replication? No I have not looked into replication. |
![]() |
| Thread Tools | |
| Display Modes | |
| |