Starting with MySQL 5.7 we introduced the Query Rewrite Plugin.
That tool is really useful for changing queries. Of course the
best location to modify the query is the source code of the
application, but this is not always possible. Either the
application is not under your control or queries are generated
from a framework like Hibernate and sometimes it is hard to
change the query generation.
If you are interested in details about the Query Rewrite Plugin,
I recommend this blogpost from the MySQL
Engineering: http://mysqlserverteam.com/the-query-rewrite-plugins/
Recently I was asked how this works in replication environments.
Which query goes into the binlog?
If you are using the Rewriter plugin that comes with MySQL 5.7,
the answer is easy: This plugin only supports rewriting SELECT
queries. SELECT queries don't get into the binlog …
Swanhart-Tools includes FlexCDC, a change data capture tool for MySQL. FlexCDC follows a server’s binary log and usually writes “changelogs” that track the changes to tables in the database. I say usually because the latest version of Swanhart-Tools (only in github for now) supports FlexCDC plugins, which allow you to send the updates to a remote data source, or to any other place of your liking. You can find out more about FlexCDC basics in a previous blog post.
Please note that FlexCDC still needs to have source and destination instances defined in the configuration, even when using plugins. This is because the FlexCDC state (how much into …
[Read more]Swanhart-Tools includes FlexCDC, a change data capture tool for MySQL. FlexCDC follows a server’s binary log and usually writes “changelogs” that track the changes to tables in the database. I say usually because the latest version of Swanhart-Tools (only in github for now) supports FlexCDC plugins, which allow you to send the updates to a remote data source, or to any other place of your liking. You can find out more about FlexCDC basics in a previous blog post.
Please note that FlexCDC still needs to have source and destination instances defined in the configuration, even when using plugins. This is because the FlexCDC state (how much into which …
[Read more]Jean-François talks about binlog servers. Take a look here: http://blog.booking.com/mysql_slave_scaling_and_more.html
Starting in version 5.7.3 MySQL added SSL support to
mysqlbinlog client program. This feature allows system
administrators to perform remote binlog queries (using
--read-from-remote-server option) over secure
connections.
So, the behavior of mysqlbinlog client program using SSL
options is now the same as other MySQL client tools, with same
SSL options and same SSL defaults. See the References section if you want more information
about MySQL SSL options.
Overview
The remote administration of MySQL servers is a very common task
as many MySQL servers are deployed in remote hosting facilities
or in remotely located data centers.
There are many problems with remote administration of servers.
With respect to security, the major concerns are:
- If the traffic between the administrative console and the remote server passes …
Send to Kindle
Recentemente respondi algumas questões referente a lag(atraso) na replicação, o que percebi é que muita gente não intende corretamente como este processo funciona internamente no MySQL e o porque do lag acontecer:
- MySQL replication: most important config parameters for performance on slave server?
- mysql replication delay very serious
Veja a figura abaixo, ela representa replicação assíncrona no MySQL, recomendo que você leia meu outro post sobre o assunto:
…
[Read more]Send to Kindle
These days I’ve answer some questions about replication lag, and I realized that most of people does not correctly understand how this process works internally on MySQL, and why does delays happen:
- MySQL replication: most important config parameters for performance on slave server?
- mysql replication delay very serious
See the bellow image, it represents asynchronous replication on MySQL, I highly recommend you to read my other post:
…
[Read more]Send to Kindle
See the bellow image, it represents how asynchronous replication
works on MySQL
Bearing in mind the number on the image, let’s see how the process works:
- Item 1 in the image represents the clients executing queries
on master, note that the master is capable to handle multiple
simultaneous connections (it can be configurable by
max_connections
variable). - Master process these queries, and save it to his binary log(item number 2 in the image), then it can later on be replied on the slave.
- The slave has 2 threads reubuntu mount ext4
partitionsponsible to deal with replication :
-
…
-
Send to Kindle
Got a packet bigger than ‘slave_max_allowed_packet’ bytes and binlog_format=STATEMENT|MIXED
Since version 5.1.64 MySQL introduces a new variable named slave_max_allowed_packet, which was introduced to allow large updates using row-based replication do not cause replication to fail when exceeded max_allowed_packet.
The problem is if you have you replication using binlog_format=STATEMENT or binlog_format=MIXED it ignores this option and use as limit for queries what is on max_allowed_packet variable but still reporting on slave_max_allowed_packet causing the IO_THREAD to report the wrong message.
Solution:
Run the …
Send to Kindle
Hi guys, Early February Oracle released the new version of MySQL named 5.6, one of the enhancements is the GTID (Global Transaction ID)
GTID is an unique identifier which will be added at each transaction, and will be very useful on the slave. remember before we needed to set MASTER_LOG_FILE and MASTER_LOG_POS, now we don’t need them anymore.
Let’s see some new variables which we need to add to our cnf
file:
gtid-mode : It will enable GTID, in order to
this function work, we need to turn on log-bin and
log-slave-updates
enforce-gtid-consistency : It will guarantee
that only allowed command will be executed ( more information
here)
Basicly, is only this what we need to enable GTID, for this tutorial I will …
[Read more]