0

젠킨스 2.82events.pagerduty.com:443 연결 시간 초과 연결

젠킨스 마스터 -이 컴퓨터에서 인터넷/외부 세계에 액세스 할 수 없습니다.

도커 컨테이너 (슬레이브 서버용)를 실행중인 Jenkins 슬레이브 서버는 외부/인터넷에 액세스 할 수 있어야합니다.

PagerDuty Plugin을 설치하고 작업에 올바르게 구성하여 실패 나 상태가 정상으로 돌아 왔을 때 알림을 보냅니다.

작업을 실행하면 다음 오류 메시지가 표시됩니다. com.mashape.unirest.http.exceptions.UnirestException: org.apache.http.conn.ConnectTimeoutException: Connect to events.pagerduty.com:443 [events.pagerduty.com/54.244.255.45, events.pagerduty.com/54.241.36.66, events.pagerduty.com/104.45.235.10] failed: connect timed out.

0:49:44 
10:49:44 Resolving incident 
10:50:14 Error while trying to resolve 
10:50:14 com.mashape.unirest.http.exceptions.UnirestException: org.apache.http.conn.ConnectTimeoutException: Connect to events.pagerduty.com:443 [events.pagerduty.com/54.244.255.45, events.pagerduty.com/54.241.36.66, events.pagerduty.com/104.45.235.10] failed: connect timed out 
10:50:14 Build step 'PagerDuty Incident Trigger' marked build as failure 
10:50:14 Notifying upstream projects of job completion 
10:50:14 Finished: FAILURE 

내가 먼저 슬레이브 시스템에 로그온하고 서버 events.pagerduty.com 옆에있는 IP를 핑 (ping)을 시도 (위에 나열된) 및 ping 괜찮 았는데. 포트 443 (ssh)에서 telnet을 실행하면 유효한 출력이 나타납니다.

슬레이브 서버가 실제로 도커 컨테이너이므로 컨테이너 슬레이브 서버 중 하나에 들어가서 동일한 (핑, 443에서 telnet을 사용하여 events.pagerduty.com IPs, nslookup 및 nc/ncat 등을 실행하고 출력합니다. 좋아 보인다). 내가 docker exec -it shenazi_ninza bash를 실행 인스턴트 메신저 고정 표시기 슬레이브 컨테이너의 호스트 즉 내부 여기

는, 나는 용기의 호스트/IP 내부에서 지금이야 : 젠킨스 작업의 구성에서

[email protected]:/data# hostname                               
da5ca3fef1c8 
[email protected]:/data# hostname; hostname -i                            
da5ca3fef1c8 
172.17.137.77 
[email protected]:/data# nslookup events.pagerduty.com                          
Server:  17.178.6.10 
Address: 17.178.6.10#53 

Non-authoritative answer: 
events.pagerduty.com canonical name = events.gslb.pagerduty.com. 
Name: events.gslb.pagerduty.com 
Address: 54.241.36.66 
Name: events.gslb.pagerduty.com 
Address: 54.245.112.46 
Name: events.gslb.pagerduty.com 
Address: 104.45.235.10 

[email protected]:/data# 
[email protected]:/data# for s in `nslookup events.pagerduty.com|grep "Address: [0-9]"|sed "s/ //g"|cut -d':' -f2`; do echo Server: $s; telnet $s 443; done 
Server: 54.245.112.46 
Trying 54.245.112.46... 
Connected to 54.245.112.46. 
Escape character is '^]'. 
^] 
telnet> quit 
Connection closed. 
Server: 104.45.235.10 
Trying 104.45.235.10... 
Connected to 104.45.235.10. 
Escape character is '^]'. 
^] 
telnet> quit 
Connection closed. 
Server: 54.241.36.66 
Trying 54.241.36.66... 
Connected to 54.241.36.66. 
Escape character is '^]'. 
^] 
telnet> quit 
Connection closed. 
[email protected]:/data# for s in `nslookup events.pagerduty.com|grep "Address: [0-9]"|sed "s/ //g"|cut -d':' -f2`; do echo Server: $s; telnet $s 443; done 
Server: 54.245.112.46 
Trying 54.245.112.46... 
Connected to 54.245.112.46. 
Escape character is '^]'. 
^] 
telnet> quit 
Connection closed. 
Server: 54.241.36.66 
Trying 54.241.36.66... 
Connected to 54.241.36.66. 
Escape character is '^]'. 
^] 
telnet> quit 
Connection closed. 
Server: 54.244.255.45 
Trying 54.244.255.45... 
Connected to 54.244.255.45. 
Escape character is '^]'. 
^] 
telnet> quit 
Connection closed. 
[email protected]:/data# ^C 
[email protected]:/data# nc -v -w 1 events.pagerduty.com 443 
Connection to events.pagerduty.com 443 port [tcp/https] succeeded! 
[email protected]:/data# 

PagerDuty 통합 POST Built Actions 지역에서 사용할 수 있습니다.

제 질문은 슬레이브 서버 (외부 세계에 액세스 할 수있는 컨테이너의 슬레이브이고 events.pagerduty.com 서버에 연결할 수있는 임)에서 전체 작업이 실행되고 있지 않습니까?

Jenkins가 012.섹션 아래에서 events.pagerduty.com (ping/telnet 등)에 액세스 할 수없는 마스터 Jenkins 인스턴스에서 아무 것도 실행하지 않는 것 같습니다. Jenkins 마스터가 외부 세계에 액세스하는 것을 원하지 않기 때문에 어떻게이 문제를 해결할 수 있습니까? 그러면 해당 작업에 빌드가 실패 할 경우 경고를받을 수 있습니까?

답변

0

그래서, 대신에 모든 액세스를 여는 만 events.pagerduty.com 서버를

/sbin/route add -net 50.0.0.0/8 x.x.x.x dev eth0 
/sbin/route add default gw x.y.z.someIP 
/sbin/route add -net 50.0.0.0 netmask 255.0.0.0 gw x.y.z.ip 

에 액세스 할 수 주어진 게이트웨이/경로를 사용하는 경로를 추가하고 이제 마스터 젠킨스에서 내가 볼 수 있어요/events.pagerduty.com 서버/IP에 액세스하십시오.

x.y.z.ip을 입력해야합니다.