【问题标题】:Not able to curl jenkins service from other ec2 instances无法从其他 ec2 实例卷曲 jenkins 服务
【发布时间】:2019-05-31 15:00:26
【问题描述】:

我在其中一个 ec2 实例上安装了 jenkins。我能够在 same ec2 上运行以下命令并确认连接成功。

curl -vk 'http://<private ip>:9009/jenkins'
curl -vk 'http://localhost:9009/jenkins'

但是,即使附加到 jenkins ec2 实例的安全组允许各种入站连接,我也无法从任何其他 ec2 实例执行这些命令。

当我尝试从其他 ec2 实例连接时出现以下错误。

[root@ip-<private ip> ~]# curl -vk 'http://<private ip>:9009/jenkins'
* About to connect() to <private ip> port 9009 (#0)
*   Trying <private ip>...
* No route to host
* Failed connect to <private ip>:9009; No route to host
* Closing connection 0
curl: (7) Failed connect to <private ip>:9009; No route to host

谁能告诉我这里出了什么问题?

操作系统-红帽 7

【问题讨论】:

  • 2 个 ec2 实例是同一个 VPC 吗?
  • @ThanhNguyenVan。是的,它们在同一个 VPC 中。
  • 你在服务器上停止firewalld了吗?
  • 你说的是 iptables 吗?
  • 是的。输出是什么firewall-cmd --list-all

标签: amazon-web-services jenkins amazon-ec2


【解决方案1】:

在 Red Hat 7 上,firewalld 默认启用。所以,请在 Red Hat 7 上禁用 firewalld

或仅根据需要打开端口 9009:

firewall-cmd --permanent --add-port=9009/tcp

firewall-cmd --reload

【讨论】:

    猜你喜欢
    • 2014-03-30
    • 2016-01-04
    • 2017-09-18
    • 2012-04-20
    • 2017-05-16
    • 1970-01-01
    • 1970-01-01
    • 2019-07-28
    • 2020-09-24
    相关资源
    最近更新 更多