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. 经常使用虚拟现实仿真软件总汇(zz)

     经常使用虚拟现实仿真软件总汇(zz)http://hi.baidu.com/busycai/blog/item/fe57e41e5f25fa1c403417b2.html 2007年09月07日 星 ...

  2. 搜索框中“请输入搜索keyword”

    $(function(){    $("#ctl00_txtKey").val("请输入搜索keyword").addClass("search&qu ...

  3. 实战DeviceIoControl 之中的一个:通过API訪问设备驱动程序

    P.bhw98 { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 9pt; PADDING-BOTTOM: 0px; MARGIN: 10px 0 ...

  4. objective c 学习(一)

    问题一:我在程序中看到大量的减号.中括号和NS****这种东西,他们是什么玩意儿? 1 减号(或者加号) 减号表示一个函数.或者方法.或者消息的开始,怎么说都行. 比如c#中,一个方法的写法可能是: ...

  5. 关于封装的一个小问题和TA的例子

    写个小例子吧 --  很多细节(如校验.判断等等)都略了 其实不是有意写成这样,而是很多朋友都这么写(当然里面也有点夸张的写法) 这么写其实也没什么不好,简单明了,不用动脑子,一看就很直白, 但是如果 ...

  6. Sql2008中使用DataTable作为存储过程的参数

    使用DataTable作为存储过程的参数   最近工作中写了几个存储过 程,需要向存储过程中传递字符串,因为SQL Server 2000中没有内置类似于 split 的函数,只好自己处理,将前台数据 ...

  7. HBuilder+移动APP开发实例

    mui: 官网:http://dcloudio.github.io/mui/ 说明:一般要把官网内容通读一遍,这是开发的基础 开始 1.新建项目 在首页点击新建移动App,如下: 或者在项目管理器内右 ...

  8. oracle 查看用户表数目,表大小,视图数目等

    查看当前用户的缺省表空间 SQL>select username,default_tablespace from user_users; 查看当前用户的角色 SQL>select * fr ...

  9. 类 Array Arraylist List Hashtable Dictionary

    总结C# 集合类 Array Arraylist List Hashtable Dictionary Stack Queue  我们用的比较多的非泛型集合类主要有 ArrayList类 和 HashT ...

  10. DATEDIFF interval=ms的用法

    datediff(ms,@CurrDateTime,@Date)>0 当上面的日期超过24天,用上面的sql会有问题 要修改成如下: (CONVERT(VARCHAR,@CurrDateTime ...