詹金斯拒绝在端口 8080 上连接

Lov*_*dav 6 linux jenkins

我已经在 Ubuntu 服务器上配置了 Jenkins,一切正常运行了将近 2 个月,Jenkins 正在构建作业并运行测试用例。但是最近我增加了测试用例的数量。一段时间后,当我通过网络浏览器打开 Jenkins 时,它开始拒绝连接。

IP:8080 给出错误“连接被拒绝”。

我尝试通过以下方式重新启动 Jenkins 服务:

sudo service jenkins restart
Run Code Online (Sandbox Code Playgroud)

它正常重新启动,但仍然没有在浏览器上打开 jenkins。

然后我检查了 jenkins 的默认设置/etc/default/jenkins

# defaults for jenkins continuous integration server
# pulled in from the init script; makes things easier.
NAME=jenkins

# location of java
JAVA=/usr/bin/java

# arguments to pass to java
JAVA_ARGS="-Djava.awt.headless=true"  # Allow graphs etc. to work even when an X server is present
JAVA_ARGS="-Xmx1024m"
#JAVA_ARGS="-Djava.net.preferIPv4Stack=true" # make jenkins listen on IPv4 address

PIDFILE=/var/run/$NAME/$NAME.pid

# user and group to be invoked as (default to jenkins)
JENKINS_USER=$NAME
JENKINS_GROUP=$NAME

# location of the jenkins war file
JENKINS_WAR=/usr/share/$NAME/$NAME.war

# jenkins home location
JENKINS_HOME=/var/lib/$NAME

# set this to false if you don't want Hudson to run by itself
# in this set up, you are expected to provide a servlet container
# to host jenkins.
RUN_STANDALONE=true

# log location.  this may be a syslog facility.priority
JENKINS_LOG=/var/log/$NAME/$NAME.log
#JENKINS_LOG=daemon.info

# OS LIMITS SETUP
#   comment this out to observe /etc/security/limits.conf
#   this is on by default because http://github.com/jenkinsci/jenkins/commit/2fb288474e980d0e7ff9c4a3b768874835a3e92e
#   reported that Ubuntu's PAM configuration doesn't include pam_limits.so, and as a result the # of file
#   descriptors are forced to 1024 regardless of /etc/security/limits.conf
MAXOPENFILES=8192

# set the umask to control permission bits of files that Jenkins creates.
#   027 makes files read-only for group and inaccessible for others, which some security sensitive users
#   might consider benefitial, especially if Jenkins runs in a box that's used for multiple purposes.
#   Beware that 027 permission would interfere with sudo scripts that run on the master (JENKINS-25065.)
#
#   Note also that the particularly sensitive part of $JENKINS_HOME (such as credentials) are always
#   written without 'others' access. So the umask values only affect job configuration, build records,
#   that sort of things.
#
#   If commented out, the value from the OS is inherited,  which is normally 022 (as of Ubuntu 12.04,
#   by default umask comes from pam_umask(8) and /etc/login.defs

# UMASK=027

# port for HTTP connector (default 8080; disable with -1)
HTTP_PORT=8080


# servlet context, important if you want to use apache proxying  
PREFIX=/$NAME

# arguments to pass to jenkins.
# --javahome=$JAVA_HOME
# --httpPort=$HTTP_PORT (default 8080; disable with -1)
# --httpsPort=$HTTP_PORT
# --argumentsRealm.passwd.$ADMIN_USER=[password]
# --argumentsRealm.roles.$ADMIN_USER=admin
# --webroot=~/.jenkins/war
# --prefix=$PREFIX

JENKINS_ARGS="--webroot=/var/cache/$NAME/war --httpPort=$HTTP_PORT"
Run Code Online (Sandbox Code Playgroud)

在这个文件中一切似乎都很好,文件war也在给定的位置上。

当我重新启动服务器 3-4 次时,它又开始打开了。但是这个问题还是一次又一次的出现。我每次都必须重新启动服务器才能打开 Jenkins。

有人可以帮我找到这个问题并告诉我如何解决它。

小智 -6

跑步:

systemctl stop firewalld.service
Run Code Online (Sandbox Code Playgroud)

然后再试一次

  • 你是认真的?“无法连接到 Jenkins?只需禁用防火墙”。这不是一个解决方案。这太糟糕了。 (9认同)