TCPCOPY+ intercept这两个模拟流量转发倒简单。

但,想实现一个mysql-replay-module模块时,失败了。(我现在仔细想想,这个方案,在我们现在的场景里,实用性不大,但弄好点专业些。)

https://github.com/session-replay-tools/mysql-replay-module

https://github.com/session-replay-tools/tcpcopy

安装=================================

一,在assistant server上安装intercept:

  1. git clone git://github.com/session-replay-tools/intercept.git
  2. cd intercept
  3. ./configure --with-resp-payload
  4. make
  5. make install

二,在ONLINE SERVER上安装TCPCOPY:

  1. git clone git://github.com/session-replay-tools/tcpcopy.git
  2. cd tcpcopy
  3. git clone git://github.com/session-replay-tools/mysql-replay-module.git
  4. ./configure --set-protocol-module=mysql-replay-module
  5. make
  6. make install

配置====================================

一,在TARGET SERVER上配置路由:

    For example:

       Assume 10.110.12.18 is the IP address of the assistant server and
    10.110.12.15 is the MySQL client IP address. We set the following route
    command to route all responses to the 10.110.12.15 to the assistant server.

       route add -host 10.110.12.15 gw 10.110.12.18

二,在assistant server上配置端口过滤:

  For example:

      ./intercept -i eth0 -F 'tcp and src port 3306' -d

      intercept will capture response packets of the TCP based application which
  listens on port 3306 from device eth0 

三,在ONLINE SERVER上启动TCPCOPY:

a) set user password pair in conf/plugin.conf in the installion directory

    Format:
       user user1@password1,user2@password2,...,userN@passwordN;

    For example:
       user root@123456;    

  b) start tcpcopy
    ./tcpcopy -x localServerPort-targetServerIP:targetServerPort -s <intercept server,> 

    For example(assume 10.110.12.17 is the IP address of the target server):

      ./tcpcopy -x 3306-10.110.12.17:3306 -s 10.110.12.18 

      tcpcopy would capture MySQL packets(assume MySQL listens on 3306 port) on current
  server, do the necessary modifications and send these packets to the target port
  '3306' on '10.110.12.17'(the target MySQL), and connect 10.110.12.18 for asking
  intercept to pass response packets to it.

最后,一份转两份,真实服务器上有,测试服务器上也有流量。用过压力或冒烟测试,蛮好的。

玩玩TCPCOPY+ intercept+mysql-replay-module(未成功)的更多相关文章

  1. 【原创】MySQL Replay线上流量压测工具

    一. 背景 去年做过一次mysql trace 重放的测试,由于performance schema本身采集样本的长度等限制,实际回放的成功率比较低. 最近找到一款开源的工具,基于TCPCopy实现了 ...

  2. PS2鼠标+LCD12864实验(调试未成功)

    此试验我一人调试许久都未成功,但发送ff时,读出来的数据确是对的,一开始让我窃喜,但发送f4时,读出来的数据确是错的,哎让苦恼啊,能力有限,只能先暂时就这样吧,那位什么还要贴出来呢,有两个原因: 1. ...

  3. Eclipse + Apache Axis2 发布RESTful WebService(三)第一个程序Hello Axis2 !(未成功)

    此路不通 Axis2发布SOAP WebService非常简单,建一个Dynamic Web Project,然后为它建一个Axis的Web Service(Tomcat7+JDK),就会生成Clas ...

  4. Mac安装HomeBridge适配小米Homekit报错:module未找到解决

    Mac安装HomeBridge适配小米Homekit报错:module未找到 具体错误是: module.js:471 throw err; balabalal...... 问了一圈,终于解决,但是又 ...

  5. WebApi 数据保护操作未成功。这可能是由于未为当前线程的用户上下文加载用户配置文件导致的。当线程执行模拟时,可能会出现此情况。","ExceptionType":"System.Security.Cryptography.CryptographicException","StackTrace

    在调用System.Security.Cryptography.ProtectedData.Protect方法来保护私密信息时,IIS可能会报以下错误:CryptographicException: ...

  6. git 取消未成功的 merge

    git 取消未成功的 merge # 合并时遇到冲突想取消操作,恢复index $ git merge --abort # 可以回退到某个提交 $ git reset --hard # 可以撤销某个提 ...

  7. 解Bug之路-主从切换"未成功"?

    解Bug之路-主从切换"未成功"? 前言 数据库主从切换是个非常有意思的话题.能够稳定的处理主从切换是保证业务连续性的必要条件.今天笔者就来讲讲主从切换过程中一个小小的问题. 故障 ...

  8. 在Ubuntu 16.10安装mysql workbench报未安装软件包 libpng12-0错误

    1.安装mysql workbench,提示未安装软件包 libpng12-0 下载了MySQL Workbench 6.3.8   在安装的时候报错: -1ubu1604-amd64.deb 提示: ...

  9. luarocks错误 require ‘luasql.mysql' 报module 'luasql.mysql' not found:

    错误: require 'luasql.mysql'stdin:1: module 'luasql.mysql' not found: no field package.preload['luasql ...

随机推荐

  1. js 解析 bytearray 成 字符串

    function bin2String(array) { return String.fromCharCode.apply(String, array); } var bit=[104,101,108 ...

  2. javascript中涉及到汉字的比较

    在使用js中的"=="进行字符串的比较时,发现在英文情况下是ok的,但在中文比较时则不行了. 在网上搜索,提供了一个解决方法,使用 stringObject.localeCompa ...

  3. UITableView beginUpdate和endUpdate使用的前提

    转载地址:http://blog.csdn.net/vieri_ch/article/details/46893023 UITableView有两个方法,用于单元格动画变化的方法,beginUpdat ...

  4. Python的Ftplib问题:UnicodeEncodeError: 'latin-1' codec can't encode characters的解决方法

    ftplib中有一个方法是cwd,用来切换目录,需要传入一个dirname,经过个人测试,该dirname不能含有汉字,会抛出:UnicodeEncodeError: 'latin-1' codec ...

  5. gridview实现表格编辑功能

    .net开发者对gridview应该非常熟悉,数据展现.数据编辑.数据删除,这些gridview都能很好的完成.最近在做东西的时候遇到 这样的一个需求,就是利用gridview实现类似Excel一样直 ...

  6. (转)HTML表格边框的设置小技巧

    对于很多初学HTML的人来说,表格<table>是最常用的标签了,但对于表格边框的控制,很多初学者却不甚其解. 对于很多初学HTML的人来说,表格<table>是最常用的标签了 ...

  7. SQL觸發器聯級刪除

    Create TRIGGER [dbo].[trigInstructionsDelete] ON dbo.Instructions instead OF DELETE AS BEGIN DECLARE ...

  8. xargs rm -rf 与 -exec rm

    # find ./ -exec rm {} \; # find ./ | xargs rm -rf 两者都可以把find命令查找到的结果删除,其区别简单的说是前者是把find发现的结果一次性传给exe ...

  9. [转]Delphi调用cmd的两种方法

    delphi调用cmd的两种方法vars:string;begins:='cmd.exe /c '+edit1.Text+' >c:\1.txt';winexec(pchar(s),sw_hid ...

  10. javascript--15条规则解析JavaScript对象布局(__proto__、prototype、constructor)

    大家都说JavaScript的属性多,记不过来,各种结构复杂不易了解.确实JS是一门入门快提高难的语言,但是也有其他办法可以辅助记忆.下面就来讨论一下JS的一大难点-对象布局,究竟设计JS这门语言的人 ...