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. 数据库中存储日期的字段类型究竟应该用varchar还是datetime ?

    背景: 前段时间在百度经验看到一篇文章<如何在电脑右下角显示你(爱人)的名字>,之前也听过这个小技巧,但没真正动手设置过.所以出于好奇就实践了一下. 设置完成后的效果例如以下.右下角的时间 ...

  2. android 13 5种click事件不同实现方式 比较

    第一种:不便于管理. <Button android:id="@+id/btn_Gridlayout" android:layout_width="match_pa ...

  3. Linux进程学习(孤儿进程和守护进程)

    孤儿进程和守护进程 通过前面的学习我们了解了如何通过fork()函数和vfork()函数来创建一个进程.现在 我们继续深入来学习两个特殊的进程:孤儿进程和守护进程 一.孤儿进程 1.什么是 孤儿进程如 ...

  4. 用 Qt 中的 QDomDocument类 处理 XML 文件(下)

      QDomDocument doc; 1).创建根节点:QDomElement root = doc.documentElement("rootName " ); 2).创建元素 ...

  5. [转] Creating a Simple RESTful Web App with Node.js, Express, and MongoDB

    You can find/fork the sample project on GitHub Hey! This and all my other tutorials will soon be mov ...

  6. Map的迭代操作

    Map的迭代操作 public static void main(String[] args) { Map<String, List<Integer>> map = new H ...

  7. Java_Activiti5_菜鸟也来学Activiti5工作流_之入门简单例子(一)

    // VacationRequest.java /** * author : 冯孟活 ^_^ * dates : 2015年9月1日 下午10:32:58 * class : 演示简单的公司请假流程 ...

  8. hibernate中使用HQL进行数据库查询

    1.写的规则比较简单,我讲一下,如图Station这个不是数据库中的表,而是entity包中的类名Station,可以省略 select * 2.返回的类型自动转化为String类型,不用你自己再转化 ...

  9. U3D 通过预置对象实现手动创建精灵

    一: 这种可以在游戏的一开始,不显示某些物体,而且通过某种时机,来显示所需要显示的物体 这里就用到了实例化预置对象. 实例化更多通常用于实例投射物(如子弹.榴弹.破片.飞行的铁球等),AI敌人,粒子爆 ...

  10. 关于XML(一)。

    关于XML 什么是XML? XML是可扩展标记语言.类似于HTML,XML的宗旨是旨在传输数据,而非显示数据.其标签没有预定义,您需要自行定义标签.XML具有自我描述性,是W3C的推荐标准. XML与 ...