0
votes

Jenkins Centos 7 master was installed from Docker jenkins/jenkins.

I cannot connect my old Windows 7, macOS, and Linux slaves to the master using jlnp.

Usually the Jenkins slave agent displays:

  • "Trying protocol: JNLP4-connect"
  • "Terminated"
  • Repeat

Clues:

  • Occasionally Windows7 "Jenkins slave agent" will display "Connected".
  • However, the Jenkins master displays the node as not connected.

Installed Using:

sudo systemctl start docker
sudo docker pull jenkins/jenkins
sudo docker run --name jenkins -p 8080:8080 -p 50000:50000 -u 1001 -v /home/jenkins/jenkins:/var/jenkins_home jenkins/jenkins
sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent
sudo firewall-cmd --zone=public --add-service=http --permanent
sudo firewall-cmd --reload

Added Clues:

  • This is my first time using a Docker install of jenkins.

  • It is running a /home/jenkins/jenkins.

  • I can find no useful clues in /jenkins/logs/slaves/

  • I tied disabling Centos & firewall on both master and slave

    I am docker newbie.

    sudo docker logs -f jenkins

displayed a JNLP4 connect error saying root was not writable.

My issue sounds very similar to this:

docker-slave never connects to master if User is defined in configuration #474

I changed to run the LTS version and now I can connect a slave:

sudo docker run -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts
1
output of sudo iptables -S on your centos machine? Do this after shutting all containers and stopping docker serviceTarun Lalwani
Thank you Tarun. I added both "docker ps" and iptables output to the question.Ed of the Mountain
Have you customized the /etc/docker/daemon.json?Tarun Lalwani
No. Do I need to customize /etc/docker/daemon.json? I copied an "Error response from daemon..." above that occurs when I try to restart jenkins. This did not occur the first time I launched it.Ed of the Mountain
I am not sure why you are not seeing any rules of Docker in iptables?Tarun Lalwani

1 Answers

0
votes

If you are still having issues I suggest as a starter to try run as privileged user. That is of course not a good secured practice, but at least it can assist you in finding the root cause. for more details see:https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities

docker run  --privileged=true  -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts

I would do a better dive also on the network you expose on the docker run, i.e. --network=host. for more options see: https://docs.docker.com/engine/reference/run/#network-settings

docker run  --network=host -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts

will allow your jenkins docker to take over the network interface of the machine. Again, not a good practice but excellent for debugging purposes.