Jenkins in Cold/standby HA

65 views
Skip to first unread message

John

unread,
Nov 5, 2016, 2:06:55 AM11/5/16
to Jenkins Users
Hello

I am setting up Jenkins in Cold standby mode: 1 active server and 1 passive in standby.
The idea is if the active Jenkins goes down, we can bring up the standby server and it will have all the jobs/settings/plugins etc. up to date and sync'd with Active.

OS is Ubuntu 14. I was reading that all I have to do is replicate across the contents of /var/lib/jenkins

I am trying to figure out which files/dirs to replicate

Here is what I have in this directory. Should I replicate all of this, or exclude certain items?

drwxrwxr-x  3 jenkins jenkins 4.0K Oct 16 19:45 .bundle
drwxr-xr-x  3 jenkins jenkins 4.0K Oct 26 14:54 .cache
-rw-r--r--  1 jenkins jenkins 2.4K Oct 24 21:09 config.xml
-rw-r--r--  1 jenkins jenkins  950 Oct 16 20:34 credentials.xml
drwxr-xr-x  3 jenkins jenkins 4.0K Oct 16 19:53 .groovy
-rw-r--r--  1 jenkins jenkins  159 Oct 16 20:02 hudson.model.UpdateCenter.xml
-rw-r--r--  1 jenkins jenkins  370 Oct 16 19:52 hudson.plugins.git.GitTool.xml
-rw-------  1 jenkins jenkins 1.7K Oct 16 19:40 identity.key.enc
drwxr-xr-x  3 jenkins jenkins 4.0K Oct 16 19:40 .java
-rw-r--r--  1 jenkins jenkins    6 Oct 16 20:02 jenkins.install.InstallUtil.lastExecVersion
-rw-r--r--  1 jenkins jenkins    6 Oct 16 19:54 jenkins.install.UpgradeWizard.state
drwxr-xr-x  5 jenkins jenkins 4.0K Oct 26 14:43 jobs
drwxr-xr-x  3 jenkins jenkins 4.0K Oct 16 19:40 logs
-rw-r--r--  1 jenkins jenkins  907 Oct 16 20:02 nodeMonitors.xml
drwxr-xr-x  2 jenkins jenkins 4.0K Oct 16 19:40 nodes
-rw-r--r--  1 jenkins jenkins   56 Nov  4 19:57 .owner
drwxr-xr-x 81 jenkins jenkins  12K Oct 16 19:59 plugins
drwxr-xr-x  5 jenkins jenkins 4.0K Oct 16 20:43 .puppetlabs
-rw-r--r--  1 jenkins jenkins  129 Oct 16 20:02 queue.xml.bak
-rw-r--r--  1 jenkins jenkins   64 Oct 16 19:40 secret.key
-rw-r--r--  1 jenkins jenkins    0 Oct 16 19:40 secret.key.not-so-secret
drwx------  4 jenkins jenkins 4.0K Oct 16 20:43 secrets
drwxr-xr-x  2 jenkins jenkins 4.0K Nov  4 20:02 updates
drwxr-xr-x  2 jenkins jenkins 4.0K Oct 16 19:40 userContent
drwxr-xr-x  4 jenkins jenkins 4.0K Oct 17 13:09 users
drwxr-xr-x  2 jenkins jenkins 4.0K Oct 16 19:53 workflow-libs
drwxr-xr-x  2 jenkins jenkins 4.0K Oct 28 15:26 workspace


Thanks
John

Rachel Moreno

unread,
Nov 5, 2016, 5:04:11 PM11/5/16
to Jenkins Users
Hi John,

IMHO, I'd replicate everything. Maybe, cache directory could be excluded.

Another situation is when you're backing up Jenkins, because you can exclude data that can be easily recreated or saving only config.xml from jobs (not builds).

I hope be useful.

Best regards,
Rachel

John

unread,
Nov 5, 2016, 9:43:01 PM11/5/16
to Jenkins Users
Thanks Rachel.

Chose to have the following exclusions: so far the standby node seems to be running fine

  rsync -e "ssh -o StrictHostKeyChecking=no" -rvh --delete --exclude '.bash_history' \
  --exclude 'logs' --exclude '.ssh' --exclude '.viminfo' \
  --exclude '.cache' ./  jenkins@JENKINS-STANDBY-NODE:/var/lib/jenkins/


Rachel Moreno

unread,
Nov 6, 2016, 12:16:17 PM11/6/16
to Jenkins Users
Hi John,

Thanks to you for feedback.

Best regards,
Rachel
Reply all
Reply to author
Forward
0 new messages