简体   繁体   中英

Jenkins add new node via ssh

I am successfully able to connect to the agent client server via ssh agent. The issue I am having is after deleting the agent and adding it again as a new agent.

What all so far I have tried on client- 1) restarted sshd 2) removed content from remote dir 3) Changed remote dir

I can see, it is always able to copy the remote.jar but somehow agent is not connecting after 1st time deletion of agent.

INFO: Both error and output logs will be printed to /home/a214p/remoting
<===[JENKINS REMOTING CAPACITY]===>channel started
Remoting version: 4.3
This is a Unix agent
ERROR: null
java.util.concurrent.CancellationException
at java.util.concurrent.FutureTask.report(FutureTask.java:121)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:475)
at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:296)
at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
[07/20/20 14:28:21] Launch failed - cleaning up connection
[07/20/20 14:28:21] [SSH] Connection closed.
ERROR: Connection terminated

Any help or suggestion?

Have you tried the method described here to add a Jenkins slave via SSH?

Additionally try following order:

  • remove slave agent from master
  • kill all Jenkins/java processes running in slave server
  • gracefully restart jenkins master
  • re-add slave agent in master

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