大网数据广告活动
服务器运维问答

Unable to access Jenkins (Centos 7)

· 52CE 我爱测

I've just installed Jenkins with its default configs on a Centos 7 physical box. Port 8080 is open on the firewall: sudo iptables -L -n [...] ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:8080 [...] It also looks like Jenkins is actu…

问题原文

原帖链接 · Panos · CC BY-SA 3.0

I've just installed Jenkins with its default configs on a Centos 7 physical box.

Port 8080 is open on the firewall:

sudo iptables -L -n
[...]
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:8080
[...]

It also looks like Jenkins is actually listening on all interfaces:

sudo netstat -an | grep "LISTEN "
[...]
tcp6       0      0 :::8080                 :::*                    LISTEN
[...]

I can curl localhost:8080 locally (from the Centos box) without a problem, but from anywhere else in the network I get a Connection refused.

Am I missing something?

已采纳解答

原帖链接 · Bombaci · CC BY-SA 3.0

The above looks like Jenkins is defaulting to ipv6 only.

Try the following, this will probably fix your problem:

run: $ /sbin/sysctl net.ipv6.bindv6only

You will probably get an output with value net.ipv6.bindv6only = 1.

If this is the case, you will need to disable the setting:

sudo /sbin/sysctl net.ipv6.bindv6only=0

After the command above you will get an answer like net.ipv6.bindv6only = 0, restart Jenkins: sudo systemctl restart jenkins and try to connect to Jenkins again.

If this worked for you, you should put this in a sysctl config-file. Because this is not a persistent fix. After a reboot the setting you just have modified will be defaulted to 1 again.

Check /etc/sysctl.conf and /etc/sysctl.d/* and add net.ipv6.bindv6only = 0 in order to make this setting permanent and run sudo sysctl -p or restart after changing it.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-09-01)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。