该Jenkins实例似乎已离线

时间:2019-01-22 10:02:39

标签: jenkins

我看着这个:Why does Jenkins say "This Jenkins instance appears to be offline"

我在CentOS Linux版本7.5.1804(核心)上安装了jenkins,它是Mac上的虚拟机。

我尝试修改以下网址:

/var/lib/jenkins/hudson.model.UpdateCenter.xml

三个网址一一对应(我在中国):

http://updates.jenkins.io/update-center.json
https://updates.jenkins.io/update-center.json
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/current/update-center.json
<?xml version='1.1' encoding='UTF-8'?>
<sites>
  <site>
    <id>default</id>
    <url>http://updates.jenkins.io/update-center.json</url>
  </site>
</sites>

然后我重新启动詹金斯:

 ⚡ root@centos-linux > service jenkins restart
Restarting jenkins (via systemctl):                        [  OK  ]

但仍处于离线状态,我不知道为什么:

This Jenkins instance appears to be offline.

This Jenkins instance appears to be offline.

防火墙已关闭:

 ✘ ⚡ root@centos-linux > systemctl status firewalld
● firewalld.service
   Loaded: masked (/dev/null; bad)
   Active: inactive (dead)

Jan 22 16:44:01 localhost.localdomain systemd[1]: Cannot add dependency job for unit firewalld.service, ignoring: Unit is masked.
Jan 22 16:44:01 localhost.localdomain systemd[1]: Cannot add dependency job for unit firewalld.service, ignoring: Unit is masked.
Jan 22 16:44:01 localhost.localdomain systemd[1]: Cannot add dependency job for unit firewalld.service, ignoring: Unit is masked.
Jan 22 16:51:09 centos-linux.shared systemd[1]: Cannot add dependency job for unit firewalld.service, ignoring: Unit is masked.
Jan 22 16:52:38 centos-linux.shared systemd[1]: Cannot add dependency job for unit firewalld.service, ignoring: Unit is masked.
Jan 22 16:52:50 centos-linux.shared systemd[1]: Cannot add dependency job for unit firewalld.service, ignoring: Unit is masked.
Jan 22 16:55:37 centos-linux.shared systemd[1]: Cannot add dependency job for unit firewalld.service, ignoring: Unit is masked.
Jan 22 16:57:26 centos-linux.shared systemd[1]: Cannot add dependency job for unit firewalld.service, ignoring: Unit is masked.
Warning: firewalld.service changed on disk. Run 'systemctl daemon-reload' to reload units.

并且未安装iptables:

 ⚡ root@centos-linux > service iptables status
Redirecting to /bin/systemctl status iptables.service
Unit iptables.service could not be found.

Java版本是新的:

 ✘ ⚡ root@centos-linux > which java
/bin/java
 ⚡ root@centos-linux > /bin/java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

我可以得到这三个update-center.json:

 ⚡ root@centos-linux > wget http://updates.jenkins.io/update-center.json
--2019-01-22 17:15:05--  http://updates.jenkins.io/update-center.json
Resolving updates.jenkins.io (updates.jenkins.io)... 52.202.51.185
Connecting to updates.jenkins.io (updates.jenkins.io)|52.202.51.185|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://updates.jenkins.io/current/update-center.json [following]
--2019-01-22 17:15:06--  http://updates.jenkins.io/current/update-center.json
Reusing existing connection to updates.jenkins.io:80.
HTTP request sent, awaiting response... 302 Found
Location: http://mirrors.jenkins-ci.org/updates/current/update-center.json [following]
--2019-01-22 17:15:06--  http://mirrors.jenkins-ci.org/updates/current/update-center.json
Resolving mirrors.jenkins-ci.org (mirrors.jenkins-ci.org)... 52.202.51.185
Reusing existing connection to updates.jenkins.io:80.
HTTP request sent, awaiting response... 302 Found
Location: http://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/current/update-center.json [following]
--2019-01-22 17:15:06--  http://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/current/update-center.json
Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.8.193, 2402:f000:1:408:8100::1
Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.8.193|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1617663 (1.5M) [application/json]
Saving to: 'update-center.json.8'

100%[===============================================================================================>] 1,617,663    309KB/s   in 4.6s

2019-01-22 17:15:11 (344 KB/s) - 'update-center.json.8' saved [1617663/1617663]

 ⚡ root@centos-linux > wget https://updates.jenkins.io/update-center.json
--2019-01-22 17:08:15--  https://updates.jenkins.io/update-center.json
Resolving updates.jenkins.io (updates.jenkins.io)... 52.202.51.185
Connecting to updates.jenkins.io (updates.jenkins.io)|52.202.51.185|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://updates.jenkins.io/current/update-center.json [following]
--2019-01-22 17:08:17--  https://updates.jenkins.io/current/update-center.json
Reusing existing connection to updates.jenkins.io:443.
HTTP request sent, awaiting response... 200 OK
Length: 1617663 (1.5M) [application/json]
Saving to: 'update-center.json.5'

100%[===============================================================================================>] 1,617,663    318KB/s   in 5.5s

2019-01-22 17:08:23 (290 KB/s) - 'update-center.json.5' saved [1617663/1617663]

 ⚡ root@centos-linux > wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/current/update-center.json
--2019-01-22 17:08:34--  https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/current/update-center.json
Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.8.193, 2402:f000:1:408:8100::1
Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.8.193|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1617663 (1.5M) [application/json]
Saving to: 'update-center.json.6'

100%[===============================================================================================>] 1,617,663    281KB/s   in 4.6s

2019-01-22 17:08:39 (342 KB/s) - 'update-center.json.6' saved [1617663/1617663]

是的,我只有java(刚刚通过yum安装):

 ⚡ root@centos-linux > which java
/bin/java
 ⚡ root@centos-linux > whereis java
java: /usr/bin/java /usr/lib/java /etc/java /usr/share/java /usr/share/man/man1/java.1.gz
 ⚡ root@centos-linux >
 ⚡ root@centos-linux > l /bin/java
lrwxrwxrwx 1 root root 22 Jan 22 16:06 /bin/java -> /etc/alternatives/java
 ⚡ root@centos-linux >
 ⚡ root@centos-linux > l /usr/bin/java
lrwxrwxrwx 1 root root 22 Jan 22 16:06 /usr/bin/java -> /etc/alternatives/java
 ⚡ root@centos-linux >
 ⚡ root@centos-linux > diff /bin/java /usr/bin/java

我还在~/.zshrc(我正在使用zsh shell)中添加JAVA_HOME:

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$HOME/bin:/usr/local/bin:$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

我已经知道了来源,没错:

source ~/.zshrc

JAVA_HOME路径:

 ⚡ root@centos-linux > l /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64
total 4.0K
drwxr-xr-x 3 root root   16 Jan 22 16:06 .
drwxr-xr-x 3 root root 4.0K Jan 22 16:06 ..
drwxr-xr-x 4 root root   26 Jan 22 16:06 jre

所以,我真的不知道如何在线制作??

0 个答案:

没有答案