JMeter(活动?)FTP 到 VLTrader [英] JMeter (Active?) FTP to VLTrader

查看:22
本文介绍了JMeter(活动?)FTP 到 VLTrader的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

情况:我正在使用 JMeter 对我的通信应用程序 (Cleo VLTrader) 进行负载测试.我是 JMeter 的新手,并且能够使 HTTP 通信正常工作,但不能使 FTP 正常工作.当我尝试使用 JMeter FTP 请求采样器时,我可以在服务器端看到 JMeter 正在发出PASV"命令,此后不久由于502 PASV 命令不可用"错误而失败.

Situation: I'm using JMeter to load test my communications application (Cleo VLTrader). I'm new to JMeter, and have been able to get HTTP communication working, but not FTP. When I attempt to use a JMeter FTP Request sampler, I can see on the server side that the JMeter is issuing a "PASV" command, and failing shortly thereafter due to a "502 PASV command not available" error.

问题:我需要如何配置我的 JMeter FTP 请求采样器以连接到我的 FTP 服务器?

Question: How do I need to configure my JMeter FTP Request sampler to connect to my FTP server?

推荐答案

1. 对此很抱歉,但只是为了确保:您是否确保手动 FTP 连接成功,即不是来自 jmeter 中的 FTP 请求脚本,但通过控制台/telnet 连接或任何 FTP 客户端实用程序?

1. Sorry for this but just to ensure: have you ensured that FTP connection succeeds manually, i.e. not from FTP Request in jmeter script but via console/telnet connection or any FTP client utility?


2. FTP 被动模式

可能的原因:
由于您的 FTP 请求在 PASV 命令执行期间失败,可以假设根本原因是您的 ftp 服务器不支持被动模式,而 jmeter 的 FTP 请求默认使用被动模式.

Possible cause:
Since your FTP Request fails during PASV command execution can suppose that the root cause is that your ftp server doesn't support passive mode while jmeter's FTP Request uses passive mode by default.

为了确保在从控制台连接到 ftp 后尝试切换到被动模式,例如

To ensure this try to switch into Passive mode after connecting to your ftp from console, e.g.

telnet your.ftp.server.url 21
USER yourusername
PASS yourpassword
PASV

ftp -d your.ftp.server.url
USER yourusername
PASS yourpassword
passive

或使用任何具有选择连接模式(主动/被动)选项的 ftp 客户端实用程序.

or using any ftp client utility which have option to select mode (active/passive) for connection.

如果在此期间出现同样的问题 - 好吧,问题是您的 ftp 服务器不支持 FTP 请求使用的被动模式.

If the same issue appears during this - well, the problem is that your ftp server doesn't support passive mode which is used by FTP Request.

参见例如this 用于解释在两种模式.

See e.g. this for explanation of differences in both the modes.


可能的解决方案:
根据 jmeter 来源:

ftp.enterLocalPassiveMode();

默认使用切换到被动模式,并且不可能在 中外部设置模式FTP 请求配置屏幕.

switch to passive mode is used by default and there is no possibility to set mode externally in FTP Request configuration screen.

但是你可以自己实现ftp request,避免使用FTP Request.
可以使用FTPClient实现来自 Apache Commons NetBeanShell 采样器.

But you can implement ftp request yourself, avoiding usage of FTP Request.
You can use FTPClient realization from Apache Commons Net and script ftp connection in BeanShell Sampler.

非常简化,这可能看起来像:

Very simplified this may look like:

import org.apache.commons.net.ftp.*;

FTPClient client = new FTPClient();
client.setDataTimeout(3600000);
client.connect(ftpHost,ftpPort);
client.login(userName, userName);
client.setFileType(FTPClient.BINARY_FILE_TYPE);

...

// FTPClient uses 'active mode' by default
if (ftp_passive_mode) {
    client.enterLocalPassiveMode();
} else {
    client.enterLocalActiveMode();
}

...

client.logout();
client.disconnect();

也许我也错了,你问题的原因隐藏在另一个地方.
希望这能帮助您诊断和解决您的问题.

Maybe also I'm wrong and the reason of your issue hides in another place.
Hope this will help you to diagnose and solve your problem.

这篇关于JMeter(活动?)FTP 到 VLTrader的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆