Tsung:使用端口的客户端连接

有没有办法configuration客户端通过端口进行通信。

我的设置:

  • 我想设置多个tsung客户端来分配负载生成。
  • 崇客户是docker集装箱,每个运行在不同的箱子。 所以从客户端主机到客户端从机的连接方式之一是IP和端口号。

所以我想在configuration文件中的下面的东西。 这里client-master是主要的客户端主机。 client-slave-1和client-slave-2是在主机上运行的docker容器 – 10.0.0.101和10.0.0.102 respy,可通过10.0.0.101:8123和10.0.0.102:8123 respy访问。

<clients> <client host="client-master" use_controller_vm="true" maxusers="10000"/> <client host="client-slave-11" port="8123" weight="3" maxusers="40000" cpu="1"> <ip value="10.0.0.101"></ip> </client> <client host="client-slave-2" port="8123" weight="3" maxusers="40000" cpu="1"> <ip value="10.0.0.102"></ip> </client> </clients> 

像从客户端主,如果我做一个ssh -p 8123 root@10.0.0.101,我可以login到客户端 – 从属1。 但我不知道如何configurationtsung来使用此端口configuration,如果tsung甚至允许。

所以我想要的是 – 如果tsung允许客户端configuration包含端口号,我该如何configuration它。 – 如果没有,那么有没有不同的select来使用容器来做到这一点。

如果没有内置的解决scheme,可以使用〜/ .ssh / config来完成。

在〜/ .ssh / config中:

 Host client-slave-11 Hostname 10.0.0.101 User root Port 8123 Host client-slave-2 Hostname 10.0.0.102 User root Port 8123 

由于tsung行为,Host的值必须是在configuration中为tsung提供的域名的最左边的组件。 当调用ssh二进制时,Tsung将只使用最左边的组件。

或者,您也可以使用包装脚本,并使用-r参数来表示tsung。 这是arg文档:

 -r <command> set remote connector (default is ssh) 

使用您的包装脚本的<command>