SSH reconnecting for every step

952 views
Skip to first unread message

kyau

unread,
Jul 22, 2013, 9:19:34 PM7/22/13
to rundeck...@googlegroups.com
Hi, I'm new to RunDeck, I have a simple job, which it seems to re-establish an SSH connection for every step, and twice if its a script, is there a way to run the job on on SSH connection ?

And there seems to be an exception thrown ?

So I have 15 steps, some are just making echo commands like this:
  1.  echo Starting

But when I look at the log i see:

05:14:22Starting SSH Connection: x...@xx.xxx.xxx.xx (xxxxxxxxxxxx.net)
05:14:22Set timeout to 0
05:14:22Connecting to xx.xxx.xxx.xx:22
05:14:22Connecting to xx.xxx.xxx.xx port 22
05:14:22Connection established
...
05:14:22Permanently added 'xx.xxx.xxx.xx' (RSA) to the list of known hosts.
05:14:22SSH_MSG_NEWKEYS sent
05:14:22SSH_MSG_NEWKEYS received
05:14:22SSH_MSG_SERVICE_REQUEST sent
05:14:22SSH_MSG_SERVICE_ACCEPT received
05:14:22Authentications that can continue: publickey,keyboard-interactive,password
05:14:22Next authentication method: publickey
05:14:22Authentication succeeded (publickey).
05:14:22Starting
05:14:22Adding reference: ant.PropertyHelper
05:14:22Setting project property: sshexec.output -> Publish Starting
05:14:22
Disconnecting from xx.xxx.xxx.xx port 22
05:14:22
Caught an exception, leaving main loop due to Socket closed
...

05:15:41Starting SSH Connection: x...@1xx.xxx.xxx.xx (xxxxxxxxxxxx.net)
...
05:15:42Disconnecting from xx.xxx.xxx.xx port 22
05:15:42Caught an exception, leaving main loop due to Socket closed

Its a similar output for each step (twice for steps which are scripts), where the only difference is the output related to what the step is doing.

There are 15 steps, (2 of which are scripts), so there are 18 SSH connections established in this job.

Is it possible to only use one SSH connection for the whole job ? does Log level set to DEBUG affect this ?

Greg Schueler

unread,
Jul 22, 2013, 9:26:32 PM7/22/13
to rundeck...@googlegroups.com

Hi Kyau,


Yes each command step is run in its own SSH connection, and each script is first scp'd to the node, and then executed in another connection.


You could put the commands inside a script if too many connections is a concern.


Setting the loglevel to Debug will show the ssh connection messages.  If set to INFO it will only show the output of the commands/scripts.



--
Greg Schueler
--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

kyau

unread,
Jul 23, 2013, 1:23:13 PM7/23/13
to rundeck...@googlegroups.com
Thanks Greg that helps,

I'm just trying to improve the performance of this RunDeck job, which takes about a minute and a half to run right now. Seeing if limiting the connections to the node might help.

Besides the echo commands, it's stopping and starting an Apache server and installing a RPM package on the server. Seems really slow for something this simple, so I'm trying to find out if there is any bottleneck.
Reply all
Reply to author
Forward
0 new messages