无法通过主机名(IP地址)访问Jenkins服务器 [英] Jenkins server is not accessible by host name (ip address)

查看:1366
本文介绍了无法通过主机名(IP地址)访问Jenkins服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac OS X上使用自制软件设置了詹金斯,它可以通过http://localhost:8080http://127.0.0.1:8080正常运行 我无法通过主机名/ip地址访问jenkins实例:

I setup jenkins on my Mac OS X with homebrew and it works just fine via http://localhost:8080 or http://127.0.0.1:8080 I couldn't access jenkins instance via hostname/ipaddress:

 1. http://myjenkinshost.local:8080
 2. http://192.168.0.100:8080

即使从本地计算机(jenkins主机本身)也无法访问这两个链接. 同时命令ping 192.168.0.100ping myjenkinshost.local可以正常工作.

Both links are not accessible even from local computer (jenkins host itself). Same time commands ping 192.168.0.100 and ping myjenkinshost.local work just fine.

推荐答案

事实证明,启动代理配置为仅侦听127.0.0.1(或本地主机). 要修复该编辑詹金斯代理的plist,请执行以下操作:

It turned out that launch agent was configured to listen only 127.0.0.1 (or localhost). To fixed that edit jenkins agent's plist:

nano /Users/admin/Library/LaunchAgents/homebrew.mxcl.jenkins.plist

,然后将httpListenAddress修改为0.0.0.0,而不是127.0.0.1

and modify httpListenAddress to 0.0.0.0 instead of 127.0.0.1

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs$
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>homebrew.mxcl.jenkins</string>
    <key>ProgramArguments</key>
    <array>
      <string>/usr/bin/java</string>
      <string>-Dmail.smtp.starttls.enable=true</string>
      <string>-jar</string>
      <string>/usr/local/opt/jenkins/libexec/jenkins.war</string>
      <string>--httpListenAddress=0.0.0.0</string>
      <string>--httpPort=8080</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
  </dict>
</plist>

这篇关于无法通过主机名(IP地址)访问Jenkins服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆