3

I am trying to set up Jenkins HA with one active and one cold standby node on Ubuntu-14.

I was looking at this question: How to setup Jenkins with HA?

I see that I just need to replicate the contents of /var/lib/jenkins, which is my $JENKINS_HOME.

#ls -alh /var/lib/jenkins
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

Should I replicate all of the above items? If not, then which ones should I sync? Any gotchas or anything else I need to know?

Thanks!

U880D
  • 1,447
  • 4
  • 15
  • 24
John Test
  • 71
  • 7

1 Answers1

1

I have tested this scenario and have chosen to replicate everything with the following exclusions. Initial testing after this seems to indicate success with plugins, jobs, credentials etc.

  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/
John Test
  • 71
  • 7