首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >连接到events.pagerduty.com:443连接超时

连接到events.pagerduty.com:443连接超时
EN

Stack Overflow用户
提问于 2017-10-07 03:53:59
回答 1查看 408关注 0票数 0

Jenkins 2.82

Jenkins master -从这台机器上,我不能访问互联网/外部世界。

Jenkins从服务器,运行docker容器(用于从服务器),可以访问外部世界/互联网。

我安装了PagerDuty插件,并在作业中正确配置了它,以便在每次失败时发送通知,并在状态恢复正常时发送通知。

当我运行作业时,我得到了以下错误消息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

代码语言:javascript
复制
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

我首先登录到从机,并尝试ping events.pagerduty.com服务器旁边的IP(如上所述),ping工作正常。在端口443 (ssh)上执行telnet也会给出有效的输出。

因为从服务器实际上是docker容器,所以我进入了一个容器从服务器并执行了同样的操作(对那些events.pagerduty.com IP执行ping、telnet、nslookup和nc / ncat等操作,输出看起来很好)。

在这里,我在docker从容器的主机中,即我运行了docker exec -it shenazi_ninza bash,现在我在容器的主机/IP中:

代码语言:javascript
复制
root@da5ca3fef1c8:/data# hostname                                                                                                                          
da5ca3fef1c8
root@da5ca3fef1c8:/data# hostname; hostname -i                                                                                                             
da5ca3fef1c8
172.17.137.77
root@da5ca3fef1c8:/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

root@da5ca3fef1c8:/data# 
root@da5ca3fef1c8:/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.
root@da5ca3fef1c8:/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.
root@da5ca3fef1c8:/data# ^C
root@da5ca3fef1c8:/data# nc -v -w 1 events.pagerduty.com 443
Connection to events.pagerduty.com 443 port [tcp/https] succeeded!
root@da5ca3fef1c8:/data# 

Jenkins作业配置中的PagerDuty集成在POST Built Actions区域下可用。

我的问题是,整个作业不是都在从属服务器上运行吗(也就是容器的从属服务器,我可以从那里访问外部世界,并且能够连接到events.pagerduty.com服务器)?

似乎Jenkins在我无法访问events.pagerduty.com的主Jenkins实例上的POST Build Data部分下运行了任何东西(ping/telnet等)?由于我们不希望Jenkins master拥有外部世界的访问权限,那么如何解决这个问题,以便在构建该作业失败时能够得到警报?

EN

回答 1

Stack Overflow用户

发布于 2017-10-25 03:46:48

因此,不是开放所有访问,而是添加了使用给定网关/路由仅访问events.pagerduty.com服务器的路由

代码语言:javascript
复制
/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

现在,从master Jenkins我只能看到/访问events.pagerduty.com服务器/它的IP地址。

x.y.z.ip是您必须放入的内容。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46613051

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档