linux - 无法远程连接到在 Debian 8 VM 上运行的 Jenkins

标签 linux jenkins google-cloud-platform debian-jessie

我最近在 Google Cloud 上设置了一个 Debian 8 Jessie VM。我已经安装了 Jenkins 并启动并运行了服务(通过“sudo service jenkins status”验证),但我无法从另一台机器连接到 VM 的外部 IP。我曾经在我的个人电脑上运行 Jenkins,直到我决定我需要一个专用服务器来持续运行它。当我在我的个人机器上运行它时,我只需访问 localhost:8080,Jenkins 仪表板就会加载得相当快。但是,在尝试访问运行 Jenkins 的虚拟机的外部 IP 地址时,我的网络浏览器通常会收到“连接被拒绝”的提示。

根据我看到的关于此类问题的大多数帖子的建议,我解除了 VM 上的所有防火墙并尝试确保 VM 在正确的 IP 地址上监听,但似乎无法改变我的浏览器呈现的结果。问题最有可能出在哪里:VM、Google Cloud 还是 Jenkins?我很茫然。

最佳答案

我的第一个猜测是连接/防火墙问题。要对此进行测试,您可以尝试使用 SSH 进行端口转发:使用本地端口转发将 SSH 连接到您的服务器:ssh -L 8080:localhost:8080 yourserver。然后,您应该能够将 Web 浏览器指向 http://localhost:8080/ 并且您的数据包流经 SSH 连接。如果这使它起作用,请好好看看 How to open a specific port such as 9090 in Google Compute Engine .或者更好的是,如果您是唯一使用该 Jenkins 服务器的人,请继续使用 SSH 隧道。它比向公众开放 jenkins 安全得多。

关于linux - 无法远程连接到在 Debian 8 VM 上运行的 Jenkins,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45525298/

相关文章:

linux - 使用 linux 脚本将第 6 个反斜杠后的所有内容向上移动一行

google-cloud-platform - Google Cloud Platform HTTP 函数是否支持路由参数?

google-cloud-platform - Google Cloud Platform jupyter notebook 在关闭本地 PC 后仍在运行

javascript - Karma Chrome Headless 无法在 Jenkins 上运行

ubuntu - 哪一个最适合托管 Jenkins - Ubuntu 或 Centos

google-compute-engine - GCE-我们无法在端口22上连接到VM

linux - 在 bash 中多次调用 getopts

linux - 使用我自己的 Image 程序构建 Yocto Linux Image

linux - Emacs、Linux 和国际键盘布局

linux - 在 Ubuntu 18.04.4 上安装 Jenkins。 Jenkins 没有开始