简体   繁体   English

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

[英]Can't connect remotely to Jenkins being run on a Debian 8 VM

I've recently set up a Debian 8 Jessie VM on Google Cloud. 我最近在Google Cloud上设置了Debian 8 Jessie VM。 I've installed Jenkins and have the service up and running(verified by "sudo service jenkins status"), yet I can't connect to the VM's external IP from another machine. 我已经安装了Jenkins并已启动并运行了该服务(已通过“ sudo service jenkins status”验证),但是我无法从另一台计算机连接到VM的外部IP。 I used to run Jenkins from my personal computer until I decided I needed a dedicated server to run it continuously. 我曾经从个人计算机运行Jenkins,直到我决定需要一台专用服务器来连续运行它。 When I was running it on my personal machine I would just access localhost:8080 and the Jenkins dashboard would load fairly quickly. 当我在个人计算机上运行它时,我将只访问localhost:8080,Jenkins仪表板将很快加载。 However, upon trying to access the external IP address of the VM running Jenkins, I'm usually greeted with "Connection refused" in my web browser. 但是,在尝试访问运行Jenkins的VM的外部IP地址时,通常会在Web浏览器中遇到“拒绝连接”的问题。

At the suggestion of most posts I've seen regarding such issues, I've lifted all firewalls on the VM and have tried to ensure that the VM is listening at the correct IP address, but nothing seems to be able to change the outcome presented by my browser. 在我所见过的有关此类问题的大多数帖子的建议下,我已经抬起了VM上的所有防火墙,并试图确保VM侦听了正确的IP地址,但是似乎没有任何办法可以改变显示的结果通过我的浏览器。 Where does the issue most likely reside: the VM, Google Cloud, or Jenkins? 问题最可能出现在哪里:VM,Google Cloud或Jenkins? I'm at a loss. 我很茫然。

My first guess is a connection/firewall issue. 我的第一个猜测是连接/防火墙问题。 To test this, you could try a port forward using SSH: SSH into your server with a local port forward: ssh -L 8080:localhost:8080 yourserver . 为了测试这一点,您可以尝试使用SSH进行端口转发:SSH进入具有本地端口转发的服务器: ssh -L 8080:localhost:8080 yourserver You should then be able to direct your web browser at http://localhost:8080/ and your packets flow through the SSH connection. 然后,您应该能够在http:// localhost:8080 /上定向Web浏览器,并且数据包通过SSH连接流动。 If that makes it work, have a good look at How to open a specific port such as 9090 in Google Compute Engine . 如果可以,请仔细阅读如何在Google Compute Engine中打开特定端口(例如9090) Or better yet, if you are the only one to use that Jenkins server, just keep using the SSH tunnel. 更好的是,如果您是唯一使用该Jenkins服务器的服务器,则只需继续使用SSH隧道即可。 It's much more secure than opening jenkins to the public world. 这比向公众开放詹金斯人安全得多。

Have you tried installing tcpdump on the VM and doing a packet capture? 您是否尝试过在VM上安装tcpdump并进行数据包捕获? That way you can determine where the traffic is being dropped. 这样,您可以确定流量被丢弃的位置。 If you don't see any traffic, then it is being dropped somewhere in the cloud before it gets to your VM. 如果看不到任何流量,则表示在将其传输到您的VM之前已将其丢弃到云中的某个位置。 If you are seeing traffic, then you need to determine is it Jenkins or some agent on the host (perhaps a firewall but you mentioned you cleared all the rules) ... I would suggest stopping the Jenkins service and then trying to access it again. 如果您看到流量,则需要确定是Jenkins还是主机上的某个代理(也许是防火墙,但您提到您清除了所有规则)...我建议停止Jenkins服务,然后尝试再次访问它。 Do you get the same "Connection Refused" message? 是否收到相同的“拒绝连接”消息? If so, then it is something on the VM. 如果是这样,那就是VM上的东西。 If not, then it something at the application layer, ie Jenkins. 如果不是,那么它在应用程序层(即Jenkins)起作用。

Happy hunting!!! 狩猎愉快!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM