简体   繁体   中英

Jenkins Windows Slave JNLP connect error

I am trying to configure a jenkins slave on a windows vm and keep it running as a service. I did the following steps

  1. went to the jenkins master from my slave and downloaded the jnlp slave agent and installed it. Got connected on the jenkins logs in the master. and the small window to show i am connected came up too.

    JNLP agent connected from /10.xx8 <===[JENKINS REMOTING CAPACITY]===>Slave.jar version: 2.51 This is a Windows slave Slave successfully connected and online

After this i installed it as a service with the jenkins user that i use. On closing the small connected window on my slave I get the following error

Failing to obtain https://my netowrk.com/computer/Windows%20Slave/slave-agent.jnlp?encrypt=true
java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
    at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source)
    at sun.net.NetworkClient.doConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
    at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
    at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:269)
    at hudson.remoting.Launcher.run(Launcher.java:219)
    at hudson.remoting.Launcher.main(Launcher.java:192)
Waiting 10 seconds before retry

I then added the proxy settings to my jenkins-slave .xml but still get the same error. My jenkins-slave.xml arguments are as follows

<executable>C:\Program Files\Java\jre7\bin\java.exe</executable>
  <arguments>-Xrs -Dhttp.proxyHost=xx.xx.xx -

Dhttp.proxyPort=3128 -jar "%BASE%\slave.jar" -jnlpUrl https://example.org/computer/Windows%20Slave/slave-

agent.jnlp -secret dxxxxxxxxxxxxa2d -noCertificateCheck</arguments>

Can anyone provide some advice as to how to resolve this.

Thanks

in windows, I modify C:\\Program Files\\Jenkins\\jenkins.xml file. add proxy setting as below:

<arguments>**-Dhttp.proxyHost="your proxy address" -Dhttp.proxyPort=yourport -Dhttps.proxyHost="your proxy address" -Dhttps.proxyPort=yourport**  -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "C:\Program Files\Jenkins\jenkins.war" --httpPort=8080 --webroot="%LocalAppData%\Jenkins\war"</arguments>

then jenkins works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM