AJP 连接失败

AJP 连接失败

前几天晚上,Apache 负载平衡的 Tomcat 实例集群在尝试通过 AJP 进行通信时失败。

我无法弄清楚为什么会发生这种情况,当我没有发现明显的问题时,我也无法让 Apache 进行通信。

编辑

我唯一不确定的是,端口扫描的 8010 端口显示 XMPP 服务。它应该这样显示吗?我想我从来没有注意到过。

我的环境:

  • 2 台 CentOs 服务器
  • 每个有 2 个 tomcat 实例
  • 1个tomcat AJP是8009,另一个是8010

所有的tomcat都会响应各自的HTTP端口。

Nmap结果:

$ ansible integra -a "nmap -p8009-8010 hip-integratc01 hip-integratc02"
hip-integratc02 | SUCCESS | rc=0 >>

Starting Nmap 6.40 ( http://nmap.org ) at 2016-05-13 11:26 EDT
Nmap scan report for hip-integratc01 (10.56.8.226)
Host is up (0.00028s latency).
rDNS record for 10.56.8.226: hip-integratc01.cat.local
PORT     STATE SERVICE
8009/tcp open  ajp13
8010/tcp open  xmpp

Nmap scan report for hip-integratc02 (10.56.8.227)
Host is up (0.00016s latency).
rDNS record for 10.56.8.227: hip-integratc02.cat.local
PORT     STATE SERVICE
8009/tcp open  ajp13
8010/tcp open  xmpp

Nmap done: 2 IP addresses (2 hosts up) scanned in 0.05 seconds

hip-integratc01 | SUCCESS | rc=0 >>

Starting Nmap 6.40 ( http://nmap.org ) at 2016-05-13 11:26 EDT
Nmap scan report for hip-integratc01 (10.56.8.226)
Host is up (0.00016s latency).
rDNS record for 10.56.8.226: hip-integratc01.cat.local
PORT     STATE SERVICE
8009/tcp open  ajp13
8010/tcp open  xmpp

Nmap scan report for hip-integratc02 (10.56.8.227)
Host is up (0.00030s latency).
rDNS record for 10.56.8.227: hip-integratc02.cat.local
PORT     STATE SERVICE
8009/tcp open  ajp13
8010/tcp open  xmpp

Nmap done: 2 IP addresses (2 hosts up) scanned in 6.54 seconds

Netstat 结果:

$ ansible integra -a "netstat -npl" --become
hip-integratc01 | SUCCESS | rc=0 >>
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
...       
tcp6       0      0 :::8009                 :::*                    LISTEN      7954/java           
tcp6       0      0 :::8010                 :::*                    LISTEN      11190/java   

hip-integratc02 | SUCCESS | rc=0 >>
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
...        
tcp6       0      0 :::8009                 :::*                    LISTEN      17514/java          
tcp6       0      0 :::8010                 :::*                    LISTEN      21084/java  

Apache error_log 的要点

[Fri May 13 10:24:44.177672 2016] [proxy:error] [pid 11077] (111)Connection refused: AH00957: AJP: attempt to connect to 10.56.8.227:8010 (hip-integratc02.cat.local) failed
[Fri May 13 10:24:44.177733 2016] [proxy:error] [pid 11077] AH00959: ap_proxy_connect_backend disabling worker for (hip-integratc02.cat.local) for 60s
[Fri May 13 10:24:44.177743 2016] [proxy_ajp:error] [pid 11077] [client 10.56.8.138:6422] AH00896: failed to make connection to backend: hip-integratc02.cat.local
[Fri May 13 10:24:44.177818 2016] [proxy:error] [pid 11077] (111)Connection refused: AH00957: AJP: attempt to connect to 10.56.8.226:8010 (hip-integratc01) failed
[Fri May 13 10:24:44.177830 2016] [proxy:error] [pid 11077] AH00959: ap_proxy_connect_backend disabling worker for (hip-integratc01) for 60s
[Fri May 13 10:24:44.177835 2016] [proxy_ajp:error] [pid 11077] [client 10.56.8.138:6422] AH00896: failed to make connection to backend: hip-integratc01

相关内容