首页 > 解决方案 > 无法从浏览器 ERR_CONNECTION_TIMED_OUT 访问 Jenkins

问题描述

我在我的 Ubuntu 服务器上安装了 jenkins。它说它正在运行,但我无法从本地计算机连接浏览器,并且我无权访问服务器的桌面以检查是否可以从本地主机连接。

附加信息:

sudo systemctl status jenkins.service

回报:

● jenkins.service - LSB:在启动时启动 Jenkins 已加载:已加载(/etc/init.d/jenkins;错误;供应商预设:已启用) 活动:自 2018 年 9 月 13 日星期四 14:46:08 起活动(已退出) -03; 1 小时 11 分钟前 文档:man:systemd-sysv-generator(8) 进程:29259 ExecStop=/etc/init.d/jenkins stop (code=exited, status=0/SUCCESS) 进程:29308 ExecStart=/etc/init. d/jenkins start (code=exited, status=0/SUCCESS) 任务:0 内存:0B CPU:0

9 月 13 日 14:46:07 vp-smg2-lnx0010 systemd[1]:启动 LSB:在启动时启动 Jenkins... 9 月 13 日 14:46:07 vp-smg2-lnx0010 jenkins[29308]:找到正确的 java 版本 9 月13 14:46:07 vp-smg2-lnx0010 jenkins[29308]:* 启动 Jenkins 自动化服务器 jenkins 9 月 13 日 14:46:07 vp-smg2-lnx0010 su[29341]:jenkins 成功 su 由 root 9 月 13 日 14:46 :07 vp-smg2-lnx0010 su[29341]: + ??? root:jenkins Sep 13 14:46:07 vp-smg2-lnx0010 su[29341]: pam_unix(su:session): 用户 jenkins 的会话由 (uid=0) Sep 13 14:46:08 vp-smg2-lnx0010 打开詹金斯[29308]:……完成。9 月 13 日 14:46:08 vp-smg2-lnx0010 systemd[1]:启动 LSB:在启动时启动 Jenkins。


netstat -ntulp | grep 8090

回报:

tcp6       0      0 :::8090                 :::*                    LISTEN      -


tail /var/log/jenkins/jenkins.log

返回(最后一行):

2018 年 9 月 13 日下午 2:46:24 org.springframework.context.support.AbstractApplicationContext prepareRefresh 信息:刷新 org.springframework.web.context.support.StaticWebApplicationContext@5220af81:显示名称 [Root WebApplicationContext];启动日期 [Thu Sep 13 14:46:24 BRT 2018];上下文层次结构的根 2018 年 9 月 13 日下午 2:46:24 org.springframework.context.support.AbstractApplicationContext 获得FreshBeanFactory 信息:应用程序上下文的 Bean 工厂 [org.springframework.web.context.support.StaticWebApplicationContext@5220af81]:org.springframework .beans.factory.support.DefaultListableBeanFactory@1dccc1f3 Sep 13, 2018 2:46:24 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons 信息:在 org.springframework.beans.factory.support.DefaultListableBeanFactory 中预实例化单例@1dccc1f3:定义 bean [filter,legacy]; 工厂层次结构的根 2018 年 9 月 13 日下午 2:46:24 jenkins.InitReactorRunner$1 onAttained 信息:已完成初始化 2018 年 9 月 13 日下午 2:46:24 hudson.WebAppMain$3 运行信息:Jenkins 已完全启动并运行

journalctl -xe

回报:

` -- 单元 UNIT 已完成启动。

-- 启动结果完成。9 月 13 日 14:46:07 vp-smg2-lnx0010 systemd [29342]:达到目标默认值。-- Subject: Unit UNIT 已完成启动 --Defined-By: systemd

-- 支持: http: //lists.freedesktop.org/mailman/listinfo/systemd-devel

-- Unit UNIT 已完成启动。

-- 启动结果完成。9 月 13 日 14:46:07 vp-smg2-lnx0010 systemd [29342]:启动在 38 毫秒内完成。-- 主题:系统启动现已完成 -- 定义者:systemd

-- 支持: http: //lists.freedesktop.org/mailman/listinfo/systemd-devel

-- 所有需要排队等待启动的系统服务已经 -- 成功启动。请注意,这并不意味着机器是

-- 现在空闲,因为服务可能仍在忙于完成启动。

-- 内核启动需要 KERNEL_USEC 微秒。

-- 初始 RAM 磁盘启动需要 INITRD_USEC 微秒。

-- 用户空间启动需要 38392 微秒。9 月 13 日 14:46:07 vp-smg2-lnx0010 systemd[1]:为 UID 116 启动用户管理器。--主题:单元 user@116.service 已完成启动--定义者:systemd

-- 支持: http: //lists.freedesktop.org/mailman/listinfo/systemd-devel

-- 单元用户@116.service 已完成启动。

-- 启动结果完成。9 月 13 日 14:46:07 vp-smg2-lnx0010 su[29341]: pam_unix(su:session): 会话为用户 jenkins 关闭 9 月 13 日 14:46:08 vp-smg2-lnx0010 jenkins[29308]: ...完成. 9 月 13 日 14:46:08 vp-smg2-lnx0010 systemd[1]:启动 LSB:在启动时启动 Jenkins。-- 主题:单元 jenkins.service 已完成启动 -- 定义:systemd

-- 支持: http: //lists.freedesktop.org/mailman/listinfo/systemd-devel

-- 单元 jenkins.service 已完成启动。

-- 启动结果完成。9 月 13 日 14:46:08 vp-smg2-lnx0010 sudo[29305]: pam_unix(sudo:session): 用户 root 会话关闭 9 月 13 日 14:46:12 vp-smg2-lnx0010 sudo[29373]: 管理员:TTY=分/0 ; PWD=/var/log/jenkins ; 用户=根;COMMAND=/bin/systemctl 状态 jenkins.service `

我将 jenkins 设置为在端口 8090 上运行,我的 ufw 状态是:

To Action From -- ------ ---- 8081 ALLOW Anywhere 8090 ALLOW Anywhere 22 ALLOW Anywhere 80 ALLOW Anywhere 8080 ALLOW Anywhere 8081 (v6) ALLOW Anywhere (v6) 8090 (v6) ALLOW Anywhere (v6) 22 (v6) ALLOW Anywhere (v6) 80 (v6) ALLOW Anywhere (v6) 8080 (v6) ALLOW Anywhere (v6)

curl -i localhost:8090

回报:

X-Content-Type-Options: nosniff
Set-Cookie: 
JSESSIONID.a54dcd68=node018je3pqsr2xyroubaw1ypmg4e2.node0;Path=/;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/html;charset=utf-8
X-Hudson: 1.395
X-Jenkins: 2.138.1
X-Jenkins-Session: 79f324ac
X-You-Are-Authenticated-As: anonymous
X-You-Are-In-Group-Disabled: JENKINS-39402: use - 
Dhudson.security.AccessDeniedException2.REPORT_GROUP_HEADERS=true or use 
/whoAmI 
to diagnose
X-Required-Permission: hudson.model.Hudson.Administer
Content-Length: 677
Server: Jetty(9.4.z-SNAPSHOT)

<html><head><meta http-equiv='refresh' content='1;url=/login?from=%2F'/> 
<script>window.location.replace('/login?from=%2F');</script></head><body 
style='background-color:white; color:white;'>


Authentication required
<!--
You are authenticated as: anonymous
Groups that you are in:

Permission you need to have (but didn't): hudson.model.Hudson.Administer
-->

</body></html> 

我在同一台服务器上运行在 80 和 8080 端口上的其他浏览器应用程序,我可以正常访问它们。我尝试从 ip-address:8090 和 ip-address:8090/jenkins 访问它,但都因 ERR_CONNECTION_TIMED_OUT 超时错误而失败。可能是什么问题呢?

标签: ubuntujenkinsinstallation

解决方案


我改变了网络(Wi-Fi)来解决这个问题。


推荐阅读