|
| 1 | +#A TCPCopy module for MySQL Replay |
| 2 | + |
| 3 | +mysql-replay-module is a TCPCopy module that can be used to replay MySQL sessions to support real testing of MySQL applications. |
| 4 | + |
| 5 | +Please refer to [TCPCopy](https://github.com/session-replay-tools/tcpcopy) for more details before reading the following. |
| 6 | + |
| 7 | +##Installation |
| 8 | + |
| 9 | +###Getting intercept installed on the assistant server |
| 10 | +1. git clone git://github.com/session-replay-tools/intercept.git |
| 11 | +2. cd intercept |
| 12 | +3. ./configure --with-resp-payload |
| 13 | +4. make |
| 14 | +5. make install |
| 15 | + |
| 16 | + |
| 17 | +###Getting tcpcopy installed on the online server |
| 18 | +1. git clone git://github.com/session-replay-tools/tcpcopy.git |
| 19 | +2. cd tcpcopy |
| 20 | +3. git clone git://github.com/session-replay-tools/mysql-replay-module.git |
| 21 | +4. ./configure --set-protocol-module=mysql-replay-module |
| 22 | +5. make |
| 23 | +6. make install |
| 24 | + |
| 25 | + |
| 26 | +##Usage guide |
| 27 | + |
| 28 | +###1) On the target server which runs MySQL applications: |
| 29 | + Set route command to route response packets to the assistant server |
| 30 | + |
| 31 | + For example: |
| 32 | + |
| 33 | + Assume 10.110.12.18 is the IP address of the assistant server and |
| 34 | + 10.110.12.15 is the MySQL client IP address. We set the following route |
| 35 | + command to route all responses to the 10.110.12.15 to the assistant server. |
| 36 | + |
| 37 | + route add -host 10.110.12.15 gw 10.110.12.18 |
| 38 | + |
| 39 | +###2) On the assistant server which runs intercept(root privilege is required): |
| 40 | + |
| 41 | + ./intercept -F <filter> -i <device,> |
| 42 | + |
| 43 | + Note that the filter format is the same as the pcap filter. |
| 44 | + |
| 45 | + For example: |
| 46 | + |
| 47 | + ./intercept -i eth0 -F 'tcp and src port 3306' -d |
| 48 | + |
| 49 | + intercept will capture response packets of the TCP based application which |
| 50 | + listens on port 3306 from device eth0 |
| 51 | + |
| 52 | + |
| 53 | +###3) On the online source server (root privilege is required): |
| 54 | + a) set user password pair in conf/plugin.conf in the installion directory |
| 55 | + |
| 56 | + Format: |
| 57 | + user user1@password1,user2@password2,...,userN@passwordN; |
| 58 | + |
| 59 | + For example: |
| 60 | + user root@123456; |
| 61 | + |
| 62 | + b) start tcpcopy |
| 63 | + ./tcpcopy -x localServerPort-targetServerIP:targetServerPort -s <intercept server,> |
| 64 | + |
| 65 | + For example(assume 10.110.12.17 is the IP address of the target server): |
| 66 | + |
| 67 | + ./tcpcopy -x 3306-10.110.12.17:3306 -s 10.110.12.18 |
| 68 | + |
| 69 | + tcpcopy would capture MySQL packets(assume MySQL listens on 3306 port) on current |
| 70 | + server, do the necessary modifications and send these packets to the target port |
| 71 | + '3306' on '10.110.12.17'(the target MySQL), and connect 10.110.12.18 for asking |
| 72 | + intercept to pass response packets to it. |
| 73 | + |
| 74 | +##Note |
| 75 | +1. Both MySQL instances in the target server and online server must have the same user accounts and their privileges although passwords could be different |
| 76 | +2. Only the complete sesssion could be replayed |
| 77 | + |
| 78 | + |
| 79 | +##Release History |
| 80 | ++ 2014.09 v1.0 mysql-replay-module released |
| 81 | + |
| 82 | + |
| 83 | +##Bugs and feature requests |
| 84 | +Have a bug or a feature request? [Please open a new issue](https://github.com/session-replay-tools/mysql-replay-module/issues). Before opening any issue, please search for existing issues. |
| 85 | + |
| 86 | + |
| 87 | +## Copyright and license |
| 88 | + |
| 89 | +Copyright 2014 under [the BSD license](LICENSE). |
| 90 | + |
| 91 | + |
0 commit comments