Slave cannot connect to Master

2019-07-10 03:48发布

问题:

I'm trying to configure my laptop as a slave, my master would be a server where Jenkins is installed. I've followed these instructions.

However, when it comes to access http://master:8080/ from my slave's browser, internet cannot display the webpage.

So I tried the second way, by writing javaws http://master:8080/computer/Slave/slave-agent.jnlp in the cmd prompt and this time I have this error:

Could not load file/URL specified: http://master:8080/computer/Slave/slave-agent.jnlp

I am new to stuff with network etc so can you enlighten me?

EDIT: I manage to reach the page, instead of user master:8080, I tried with the IP of the server and it worked!

But now when I launch the agent, I have an error saying:

java.net.ConnectException: Connection refused:

Where does the problem come from?

回答1:

I found the problem: in Jenkins Master Configuration, in Jenkins URL, instead of "localhost:8080", I put the IP of the server (http://[ip_server]:8080/) and now I can connect my slave to my master by using each way.



回答2:

More specifically to Denis's answer, go to Manage Jenkins->Configure Systems->Jenkins Location : "Jenkins URL" and change "localhost:8080" to your Master's ip and port. (If you happened to change the port number).

Then we picked the choice of downloading the slave.jar and using the command prompt to connect the agent.



回答3:

After installing the Jenkins slave. If your unable to load the Jenkins in the brwoser or not getting the jenkins start page follow these steps , directly paste this in your terminal.

firewall-cmd --permanent --new-service=jenkins

firewall-cmd --permanent --service=jenkins --set-short="Jenkins Service Ports"

firewall-cmd --permanent --service=jenkins --set-description="Jenkins service firewalld port exceptions"

firewall-cmd --permanent --service=jenkins --add-port=8080/tcp

firewall-cmd --permanent --add-service=jenkins

firewall-cmd --zone=public --add-service=http --permanent

firewall-cmd --reload

firewall-cmd --list-all