codeBeamer Active / Passive solution
Starting from codeBeamer 9.3.0 codeBeamer will support Master / Slave server architecture.
Infrastructure
In order to run a Master / Backup solution (a.k.a Active / Passive high availability cluster), we need 2 running application servers and one load balancer, these server must be hosted on physically separate servers. Application servers use a shared files system to keep share all application related data. In case load balance is not a physical device, it also must be hosted on physically separate server.
Setup
Load balancer
Load balancer should be configured to know the IP address / Domain name of the application servers, and the ping URL of them.
Apache configuration
Recommended version Apache 2.4.21 and later
ServerName 127.0.0.1
Listen 0.0.0.0:8889
<VirtualHost *:8889>
ProxyHCExpr ok234 {%{REQUEST_STATUS} =~ /^[234]/}
<Proxy balancer://codebeamercluster>
BalancerMember http://localhost:8080 hcmethod=GET hcuri=/cb/hc/cluster/ping.spr hcexpr=ok234 hcinterval=10 hcpasses=2 hcfails=2
BalancerMember http://localhost:8081 hcmethod=GET hcuri=/cb/hc/cluster/ping.spr hcexpr=ok234 hcinterval=10 hcpasses=2 hcfails=2
ProxySet lbmethod=byrequests
</Proxy>
<Location /balancer-manager>
SetHandler balancer-manager
Order allow,deny
allow from localhost
</Location>
ProxyPass /balancer-manager !
ProxyPass / balancer://codebeamercluster/
ProxyPassReverse / balancer://codebeamercluster/
</VirtualHost>
Name of the cluster could be any valid string, same value must be used in the ProxyPass and ProxyPassReverse configurations
hcuri must set to /cb/hc/cluster/ping.spr
hcinterval must be lower value than the checkServerStatusInterval (see below), recommended value is half of the checkServerStatusInterval
Required plugins
- lbmethod_byrequests
- proxy
- proxy_balancer
- proxy_hcheck
- proxy_http
Docker image
You can build a docker image from the following docker project LoadBalancer.zip.
How to build
Extract the LoadBalancer.zip, and go to the directoy, you should see a Dockerfile
docker build --tag <imageName>:latest .
imageName could be any valid docker image name, e.g cbLoadBalancer
How to run
docker run -p 80:8888 -e ACTIVE=http://codeBeamerActiveServer.com -e PASSIVE=http://codeBeamerPassiveServer.com <imageName>
Visit the http://localhost/cb, load balancer information can be found here: http://localhost/balancer-manager
Recommendation
- Balancer-manager is useful for debugging, it is recommended to strengthen the authentication of it, or remove it from the configuration
- Use domain names instead of IPs, it is much flexible solution
Shared file system
TODO
Setup a new codeBeamer with Active / Passive configuration
- Download an installer from https://intland.com/download-codebeamer/
- Install codeBeamer
- Please note that database and SMTP servers must be visible for both active and passive server
- Visit the /cb/sysadmin/configConfiguration.spr page
- Add the following cluster configuration to the application config
"cluster" : {
"checkServerStatusInterval" : <Check Interval>,
"serverStateChangeNotificationEmail" : "<Email>"
}
Check Interval defines how often the status of the current server is checked. Default value is 30 seconds. Same value must be used for active and passive servers.
Email defines who is notified in case the master server is down. In case the value of the field is empty or the attribute is missing, system administrators of the application are notified
- Stop codeBeamer with <CB-HOME>/bin/stop
- Move <CB-HOME>/repository directory to the shared file system
- Create a copy of <CB-HOME> and move it to the host of passive server
- Configure and start your load balancer
- Configure and start active server, see below
- Configure and start passive server, see below
Upgrade codeBeamer
- Upgrade codeBeamer to the latest version, see Upgrading from Older Versions - Simple - Before 21.09 (EMMA)
- Backing up codebeamer installation
- Please note that the Active / Passive feature is only available from 9.3 version
- Visit the /cb/sysadmin/configConfiguration.spr page
- Add the following cluster configuration to the application config
"cluster" : {
"checkServerStatusInterval" : <Check Interval>,
"serverStateChangeNotificationEmail" : "<Email>"
}
Check Interval defines how often the status of the current server is checked. Default value is 30 seconds. Same value must be used for active and passive servers.
Email defines who is notified in case the master server is down. In case the value of the field is empty or the attribute is missing, system administrators of the application are notified
- Stop codeBeamer with <CB-HOME>/bin/stop
- Move <CB-HOME>/repository directory to the shared file system
- Create a copy of <CB-HOME> and move it to the host of passive server
- Configure and start your load balancer
- Configure and start active server, see below
- Configure and start passive server, see below
How to start an Active Server
In order to start a active server you need to change the configuration of the <ACTIVE-CB-HOME>/bin/cb file (<ACTIVE-CB-HOME>/bin/cbservice.bat on Windows), Please extend the parameters of start script with the following:
-Dcodebeamer.server.mode=ACTIVE
-Dcodebeamer.server.id=master
-Dcodebeamer.home=<Path of the shared directory>
How to start a Passive Server
In order to start a passive server you need to change the configuration of the <PASSIVE-CB-HOME>/bin/cb file (<PASSIVE-CB-HOME>/bin/cbservice.bat on Windows), Please extend the parameters of start script with the following:
-Dcodebeamer.server.mode=PASSIVE
-Dcodebeamer.server.id=passive
-Dcodebeamer.home=<Path of the shared directory>