[英]unable to connect to Jenkins server on redhat linux
我在Red Hat Enterprise 6.3上安裝了Jenkins。 jenkins通過監聽端口8080
運行。
[root@linux]# service jenkins status
jenkins (pid 7526) is running...
JENKINS_PORT="8080"
JENKINS_LISTEN_ADDRESS="0.0.0.0"
但是,我無法通過Web瀏覽器或cURL連接到Jenkins。 HTTP連接的TCP連接為“ ESTABLIASHED”,但HTTP GET請求始終處於等待狀態,並且網絡瀏覽器一直處於加載狀態。
[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連接超時為10s,但是請求“ / pluginManager / plugins”花費的時間超過10s,因為響應約為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
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.