jenkins启动异常:警告: Could not intialize the host network interface on nullbecause of an error

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yunfeng482/article/details/89208091

jenkins启动异常:警告: Could not intialize the host network interface on nullbecause of an error:

在安装启动jenkins时候,日志报错如下:
警告: Could not intialize the host network interface on nullbecause of an error: centos-ci: centos-ci: 未知的名称或服务
java.net.UnknownHostException: centos-ci: centos-ci: 未知的名称或服务

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

ec2926173edf46ecb61dde499d20ac14

This may also be found at: /data/ci/soft/jenkins/secrets/initialAdminPassword

*************************************************************
*************************************************************
*************************************************************

四月 10, 2019 7:58:42 下午 hudson.model.UpdateSite updateData
信息: Obtained the latest update center data file for UpdateSource default
四月 10, 2019 7:58:43 下午 hudson.model.DownloadService$Downloadable load
信息: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller
四月 10, 2019 7:58:43 下午 hudson.util.Retrier start
信息: Performed the action check updates server successfully at the attempt #1
四月 10, 2019 7:58:43 下午 hudson.model.AsyncPeriodicWork$1 run
信息: Finished Download metadata. 12,106 ms
四月 10, 2019 7:58:44 下午 hudson.model.UpdateSite updateData
信息: Obtained the latest update center data file for UpdateSource default
四月 10, 2019 7:58:44 下午 jenkins.InitReactorRunner$1 onAttained
信息: Completed initialization
四月 10, 2019 7:58:44 下午 hudson.WebAppMain$3 run
信息: Jenkins is fully up and running
四月 10, 2019 7:58:44 下午 javax.jmdns.impl.HostInfo newHostInfo
警告: Could not intialize the host network interface on nullbecause of an error: centos-ci: centos-ci: 未知的名称或服务
java.net.UnknownHostException: centos-ci: centos-ci: 未知的名称或服务
	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:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.UnknownHostException: centos-ci: 未知的名称或服务
	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)
	... 10 more

解决办法

在Linux Tomcat下启动Jekins的时候报以上的错误,究其原因是因为服务器配置了自定义的host name 没有在hosts文件中定义.

解决方法如下:

  1. 查看自己服务器的host name
[ci@centos-ci jenkins]$ hostname
centos-ci
  1. 进入etc/hosts 编辑,在下面加一行:

127.0.0.1 centos-ci
3. 保存退出,重启jenkins

猜你喜欢

转载自blog.csdn.net/yunfeng482/article/details/89208091