【问题标题】:jenkins.war stop error “Name or service not known”jenkins.war 停止错误“名称或服务未知”
【发布时间】:2018-08-02 18:25:33
【问题描述】:

我有一个在 linux 中运行的 jenkins 服务(没有 docker),有时服务没有响应 当我执行“service --status-all”命令时,show .war 停止 在詹金斯日志中显示此消息

WARNING: Could not intialize the host network interface on nullbecause of an error: myserver: myserver: Name or service not known
java.net.UnknownHostException: myserver: myserver: Name or service not known
        at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
        at javax.jmdns.impl.HostInfo.newHostInfo(HostInfo.java:75)
        at javax.jmdns.impl.JmDNSImpl.<init>(JmDNSImpl.java:407)
        at javax.jmdns.JmDNS.create(JmDNS.java:60)
        at hudson.DNSMultiCast$1.call(DNSMultiCast.java:33)
        at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
        at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.UnknownHostException: myserver: Name or service not known
        at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
        at java.net.InetAddress.getLocalHost(InetAddress.java:1500)

如果我重启服务运行正常但是这个问题很不方便

【问题讨论】:

  • 它表示无法解析名为myserver 的主机名。不确定何时以及为何查找此内容,但最好将真实主机名放在您指定此字符串的位置。
  • 在哪里可以更改此主机名?你知道吗?

标签: linux jenkins dns


【解决方案1】:

将您的 hostname 添加到 /etc/hosts 可能会有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-02-28
    • 2018-12-18
    • 1970-01-01
    • 1970-01-01
    • 2018-06-02
    • 2019-03-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多