通过负载均衡器 cd 进行的 FTP 连接有效 ls 失败

通过负载均衡器 cd 进行的 FTP 连接有效 ls 失败

以下是配置。

Client is a linux server IP: 10.204.21.143. This server is only reachable to HA Proxy server.

HA Proxy Server IP: 10.204.24.71 (Its a Solaris 11.3 Server) 

Back end Server where the FTP Server is running : 10.212.22.31 This server is only reachable to HA Proxy Server only and not to Client Server.

HA 代理配置:

$ cat haproxy.cfg
global
      maxconn 15000
      pidfile dmshaproxy.pid
      daemon
      stats socket dmshaproxy.sock mode 0600 level admin
      spread-checks 5

defaults
      mode tcp
      retries 3
      maxconn 15000
      contimeout 5s
      clitimeout 300s
      srvtimeout 300s
      option contstats

listen FTP 10.204.24.71:2121
    server ftp-serv00 10.212.22.31:21 check inter 20s
$

现在我可以从客户端连接,执行 cd 命令并且它可以工作。但是 ls 不起作用。

[root@qa-lt143 ~]# ftp 10.204.24.71 2121
Connected to 10.204.24.71 (10.204.24.71).
220 ::ffff:10.212.22.31 FTP server ready
Name (10.204.24.71:root): oracle
331 Password required for oracle
Password:
230 User oracle logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd RMAN_BKP
250 CWD command successful
ftp> pwd
257 "/export/home/oracle/RMAN_BKP" is the current directory
ftp> ls
227 Entering Passive Mode (10,212,22,31,137,99).    <--- This IP is of backend server. but it should be of HA-Proxy Server. Not sure why its taking the backend server.
ftp: connect: Connection timed out
ftp>

我发现当我执行 ls 时,它使用后端 IP 进行连接,而客户端服务器无法访问该 IP。不确定它为什么不使用 HA-Proxy 服务器 IP。

我也尝试了相同的方法,但还是不行。这次它使用了本地服务器 IP。

[root@qa-lt143 ~]# ftp -A 10.204.24.71 2121
Connected to 10.204.24.71 (10.204.24.71).
220 ::ffff:10.212.22.31 FTP server ready
Name (10.204.24.71:root): oracle
331 Password required for oracle
Password:
230 User oracle logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd RMAN_BKP
250 CWD command successful
ftp> pwd
257 "/export/home/oracle/RMAN_BKP" is the current directory
ftp> ls
500 Illegal PORT command
ftp: bind: Address already in use
ftp> debug
Debugging on (debug=1).
ftp> ls
---> PORT 10,204,21,143,180,120
500 Illegal PORT command
ftp>

请帮忙。

相关内容