我在红帽企业6.3上安装了詹金斯。詹金斯正在通过听端口8080
。
[root@linux]# service jenkins status
jenkins (pid 7526) is running...
JENKINS_PORT="8080"
JENKINS_LISTEN_ADDRESS="0.0.0.0"
但是,我无法通过Web浏览器或卷发连接到Jenkins。HTTP连接的TCP连接是" stoperiashed",但是HTTP获取请求是永远等待的,Web浏览器一直在加载。
[root@linux]# netstat -an | grep 8080
tcp 0 0 :::8080 :::* LISTEN
tcp 0 0 ::ffff:172.22.146.9:8080 ::ffff:171.70.233.226:58029 ESTABLISHED
tcp 1 0 ::ffff:172.22.146.9:8080 ::ffff:171.70.233.226:58045 CLOSE_WAIT
tcp 1 0 ::ffff:172.22.146.9:8080 ::ffff:171.70.233.226:58103 CLOSE_WAIT
tcp 0 0 ::ffff:172.22.146.9:8080 ::ffff:171.70.233.226:58112 ESTABLISHED
mylaptop$ ping 172.22.146.9
PING 172.22.146.9 (172.22.146.9): 56 data bytes
64 bytes from 172.22.146.9: icmp_seq=0 ttl=57 time=6.384 ms
64 bytes from 172.22.146.9: icmp_seq=1 ttl=57 time=4.521 ms
64 bytes from 172.22.146.9: icmp_seq=2 ttl=57 time=4.095 ms
^C
--- 172.22.146.9 ping statistics ---enter code here
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 4.095/5.000/6.384/0.994 ms
mylaptop$ curl http://172.22.146.9:8080
<Pending forever here....>
nmap扫描看起来还不错:
mylaptop$ nmap -p 8080 172.22.146.9
Starting Nmap 6.47 ( http://nmap.org ) at 2015-05-07 11:05 PDT
Nmap scan report for snmplab-linux9.cisco.com (172.22.146.9)
Host is up (0.0018s latency).
PORT STATE SERVICE
8080/tcp open http-proxy
Nmap done: 1 IP address (1 host up) scanned in 0.11 seconds
这是一个网络问题。Jenkins的默认HTTP连接超时为10,但是请求'/pluginmanager/插件的成本超过10秒,因为响应约为500kb,很大。
var pluginManagerErrorTimeoutMillis = 10 * 1000;
...
exports.availablePlugins = function(handler) {
jenkins.get('/pluginManager/plugins', function(response) {
if(response.status !== 'ok') {
handler.call({ isError: true, errorMessage: response.message });
return;
}
handler.call({ isError: false }, response.data);
}, {
timeout: pluginManagerErrorTimeoutMillis,
error: function(xhr, textStatus, errorThrown) {
handler.call({ isError: true, errorMessage: errorThrown });
}
});
};
您可以通过浏览器的开发人员工具更改pluginManagerErrorTimeoutMillis
。