19

Currently we are using a Jenkins as our CI system and there is one master server and slaves which are provisioned by Saltstack on Openstack. If our Jenkins master server goes down, we need to create a new master and we need to pull the files from the old master & put it in new ones but it's gonna take at least 30mins.

Is there any way to setup Jenkins with High Availability?

I already check with Gearman Plugin, however if the Gearman server goes down for some reason, we need to setup a HA for Gearman also.

Is there any other ways to setup a High Availability for Jenkins?

U880D
  • 1,447
  • 4
  • 15
  • 24
Vishnu Nair
  • 1,301
  • 1
  • 12
  • 16

2 Answers2

10

Jenkins doesn't have a great HA story; the best you can do with the open source version is to put all of the files in $JENKINS_HOME on a shared file system, and then have a cold standby master machine that you can spin up if the active master goes down. That would reduce your failover time to however long it takes for the master to restart, which is usually just a few minutes.

You could also look at CloudBees' Jenkins Enterprise offering, which includes a High Availability Plugin.

gareth_bowles
  • 19,908
  • 5
  • 52
  • 79
  • 3
    The cloudbees high availability plugin is just cold failover as well. They expect a shared NFS mount which changes the single point of failure to NFS in my opinion. – Sam Gleske Feb 07 '18 at 09:52
6

I use cluster from scratch doc to create a Jenkins WAN-HA active/passive cluster. See the attached Architecture Diagram for Jenkins HA using pacemaker .

/etc/init.d/jenkins will need to be converted to be an ocf agent script. Currently I manually start up Jenkins via systemd on pcmk-2 server when pcmk-1 is down.

U880D
  • 1,447
  • 4
  • 15
  • 24
T.J. Yang
  • 61
  • 1
  • 3
  • It would be great if you include the information into the answer. – J Fabian Meier Jun 18 '16 at 17:24
  • Hi @JFMeier, I added reference to the doc where I learn pacemaker from. IP/Hostname failover will need to use Big5 GTM like solution if you are targeting failover between WAN network. Also see diagram on what paths need to reside on shared DRBD network drive. – T.J. Yang Jun 20 '16 at 08:53