После того как Вы покупаете доменное имя, Вы просто добавляете запись DNS (хост, Запись), чтобы то доменное имя указало на Ваш IP-адрес. Например, при покупке доменного имени (foo.com) у Godaddy (где когда-либо Вы купили его у), затем будет раздел их веб-сайта, который позволяет Вам создать записи DNS.
Ищите раздел справки или ищите веб-сайт поставщиков.
Записи MX для почтовых серверов.
Записи для веб-серверов.
Надежда, которая помогает
MySQL Replication suffers from two major problems
MySQL Replication is Asynchronous. This may introduce replication delay. This manifests itself with communication problems between a Master and the Slave via the Slave I/O Thread. This may logically and numerically be seen in Seconds_Behind_Master
.
Data Drift
. This is a intermittent condition where a Master and Slave are simply out-of-sync because of factors outside the realm of MySQL Replication. For example, please note one way to better synchronize replication: use the option sync-binlog
. When you set sync-binlog
to 1, mysqld will perform a flush of the current binary log for every entry you record in the binary log. That can ridiculously slow down a Master. By default, sync-binlog
is 0.
sync-binlog=0
, who is responsible for flushing the binary log to disk?The direct answer here is no because pt-table-sync
was designed to detect the I/O thread of a Slave by means of the --sync-to-master
option.
The direct answer here is no because MySQL Replication demands to know
Master_Log_File
from SHOW SLAVE STATUS\G
)Read_Master_Log_Pos
from SHOW SLAVE STATUS\G
)If you simply want your binary logs to get out of the way, you can do one of two things
expire-logs-days
to 3 to keep the last 3 days worth of binary logs
expire-logs-days = 3
в /etc/my.cnf SET GLOBAL expire_logs_days = 3;
ПОКАЗАТЬ СТАТУС ПОДЧИНЕННОГО \ G
на ведомом. Возьмите значение Relay_Master_Log_File
. и используйте его для очистки двоичных журналов на Мастере до этого файла журнала.
SHOW SLAVE STATUS\G
on the SlaveRelay_Master_Log_File: mysql-bin.000035
PURGE BINARY LOGS TO 'mysql-bin.000035';
If you want to have more faith in pt-table-sync, try using the --print
option and redirecting to a text file instead of the --execute
option. This will generate the SQL that would normally execute on the Master. You could just run the SQL directly on that Slave thereafter. Think of it as a dress rehearsal for --execute
.
но я думал, что весь смысл репликации состоит в том, чтобы позаботиться о synchronization of data for you
Yes, MySQL replication does try to synchronize a replicated database. However, MySQL replication is tricky and the replication can fail for various reasons. Replication errors in my experience are rare, but they do happen during unexpected server crashes, when users hit "Control-C" in the middle of a big insert on the master, etc. MySQL.com does not provide good tools to deal with many of these problems. Luckily, a few engineers such as Baron Schwartz (Original author of the Percona Toolkit (formerly known as Maatkit) have developed tools to make MySQL administration easier.
For example, I currently have a table with 50 million rows. A handful of rows are out of sync due to a server crash a few weeks ago. I need to discover which rows are out of sync, but that would be painful to do manually. I use pt-table-checksum to check for replication errors on the replica, and pt-table-sync to discover which rows are missing on the replica.
If you are considering MySQL replication, I highly recommend that you investigate and use the Percona Toolkit. If we had started off with the Percona Toolkit, the administration of our MySQL databases would have been much simpler.
I read the documentation and got confused:
The documentation for Percona Toolkit is written like a technical manual. It unfortunately does not do a good job at describing how to use the tools, how do they help you, etc. http://www.mysqlperformanceblog.com has some of this information, but it's largely focused on the Percona fork of MySQL (This is how they make a living), which requires the reader to do some translation.
Ответ на вопрос 1
pt-table-sync
(вместе с контрольная сумма pt-table
) может использоваться для исправления ошибок репликации, таких как повреждение данных. , кто-то напрямую изменяет данные на ведомом устройстве, сбои сервера, изменения схемы в неправильном порядке и т. д.
Однако pt-table-sync
также можно использовать без репликации для синхронизации таблиц в режиме, близком к реальному времени, если данные не меняются слишком сильно.
Правильный ответ на вопрос 2
Конечно, вы можете использовать его и в среде без репликации, это также упоминается в руководстве . Я использую его из cron, чтобы «синхронизировать» 3 сервера mysql каждые 5 минут. У них есть одна и та же копия данных, которая изменяется только иногда (на первом сервере), поэтому репликация для этой цели была бы излишней.
Вы можете указать отдельные базы данных или отдельные таблицы для синхронизации. У вас может быть несколько целевых серверов. pt-table-sync
использует несколько эффективных алгоритмов для обнаружения изменений в таблицах базы данных и копирования только изменений (он разбивает изменения на 4 группы: удаления, замены, вставки, обновления).