Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

View-Specific MySQL Replication

$
0
0

I'm trying to replicate only a portion of a table on Computer A (running an instance of MySQL) to a MySQL instance on Computer B, something that could easily be represented by a view. I know it is not possible to use replication with views, so I attempted to use the blackhole engine as a workaround.

I created a blackhole database on Computer A. I added a trigger to the upper-level table that I wanted to replicate, and put my conditional logic on the trigger (i.e. only insert rows into the blackhole table with specific column value). I then tried to replicate the blackhole table on Computer B. This does not work because the Statement Based Replication scheme does not recognize this insert statement as having originated from the blackhole database, and so it is not logged (or replicated). The only way to log the changes is to log and replicate the entire database, which is what I am trying to avoid. As the documentation states, Row Based Replication is not an option with the blackhole engine period.

Is there any way to achieve what I am aiming for without having to create a duplicate table on Computer A? There is quite a bit of data coming into this upper-level table (it is network intrusion traffic) so I would like to avoid duplicating large amounts of data on the same computer.

I did read something about setting up a dummy mysqld process on Computer A. Is this the only solution, and how do I go about doing that?


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>