You are not logged in. Click here to log in.

codebeamer Application Lifecycle Management (ALM)

Search In Project

Search inClear

How to Configure Codebeamer as Active-Active Cluster

Prerequisite

Load Balancer

User requests should be distributed among running Codebeamer, both hardware or software load balancer could work. Using "non-sticky session" setting is recommended.

NFS

Attachments, temp files, etc. must be visible for all running Codebeamer instances in order to support that these files must be stored on a network storage solution.


The general performance of Codebeamer does not depend on the network speed between NFS and Codebeamer. However, performance degradation of SCM, file upload and download are expected.

For detailed information about the cluster architecture, see: Cluster architecture.


Recommended Configuration Options

<NFS server>:/repository /<codeBeamer installation>/repository nfs defaults,noresvport,noatime,lookupcache=positive 0 2
<NFS server>:/logs /<codeBeamer installation>/logs nfs defaults,noresvport,noatime,lookupcache=positive 0 2

On on-premise servers, also add the following:

<NFS server>:/tomcat_tmp /<codeBeamer installation>/tomcat/tmp nfs defaults,noresvport,noatime,lookupcache=positive 0 2


Environment Configuration

  • CB_MAC_ADDRESS - Must be set to the same value on all Codebeamer instances.
  • CB_CLUSTER_ENABLED - Must be set to true on all Codebeamer instances.
  • CB_CLUSTER_SERVER_ID- Name of the current Codebeamer server, this name is used in log files and on the Server Status Dashboard page.
    • It is an optional parameter, unique name is generated during the startup.

Cache

Codebeamer servers share frequently used data via EhCache implementation.

Automatic

Automatic solution uses a multicast address to find Codebeamer instances.

IP multicasting provides a method to send information to a group of hosts at the same time, which is different from the normal IP unicast routing that sends information only to one specific host at a time. IP multicast relies on a data distribution tree built by a multicast routing protocol to deliver packets from the source to the receivers when they are connected to different networks. The most common issue in a multicast network is packets transmitted by the source not reaching receivers. Other issues could be related to the formation of the distribution tree itself, and unwanted flooding in LAN environments that use switches.
Environment Variables
  • CB_RMI_CACHE_HOSTNAME=codebeamer-app-server1
    - The hostname or IP of the interface to be used for sending and receiving multicast packets (relevant to multi-homed hosts only). This is optional.
  • CB_RMI_REPLICATION_CACHE_PORT=40001
  • CB_RMI_INVALIDATION_CACHE_PORT=40002
  • CB_RMI_CACHE_SOCKET_TIMEOUT_MILLIS=1000
  • CB_RMI_CACHE_REMOTE_OBJECT_PORT=50000
  • CB_RMI_AUTOMATIC_CACHE_MULTICAST_GROUP_ADDRESS=230.0.0.1
  • CB_RMI_AUTOMATIC_CACHE_MULTICAST_GROUP_PORT=4446
  • CB_RMI_AUTOMATIC_CACHE_TIME_TO_LIVE=32

Manual

Manual solution knows host name of all servers in the cluster.

Environment Variables
  • CB_RMI_CACHE_HOSTNAME=codebeamer-app-server1
  • CB_RMI_CACHE_INSTANCES=codebeamer-app-server1, codebeamer-app-server2
  • CB_RMI_REPLICATION_CACHE_PORT=4001
  • CB_RMI_INVALIDATION_CACHE_PORT=4002
  • CB_RMI_CACHE_SOCKET_TIMEOUT_MILLIS=12000
  • CB_RMI_CACHE_REMOTE_OBJECT_PORT=9000

Dynamic

Dynamic peer discovery can be configured with the following environment variables, similarly to manual and automatic RMI.

With this configuration, peers are discovered automatically if peer-discovery is enabled and configured properly. Cache is synchronized and boot is loaded at Codebeamer startup.

Environment Variables

Default values:

  • CB_RMI_CACHE_HOSTNAME=codebeamer-app-server1
  • CB_RMI_REPLICATION_CACHE_PORT=4001
  • CB_RMI_INVALIDATION_CACHE_PORT=4002
  • CB_RMI_CACHE_SOCKET_TIMEOUT_MILLIS=12000
  • CB_RMI_CACHE_REMOTE_OBJECT_PORT=9000
  • CB_RMI_CACHE_TIME_TO_LIVE=10s
  • CB_RMI_HEARTH_BEAT_INTERVAL=1s

How to Test Cache Network Configurations

EhCache is used for sharing frequently used data among Codebeamer instances.

Steps for Testing

  • Open /cb/sysadmin/clusterCacheTesting.spr
    • CB_ping_testingEnabled=true should be set
  • Response should contain all passed test cases.

JGroups

File

For technical details, see page http://www.jgroups.org/manual4/#FILE_PING.

Environment Variables
  • CB_JGROUPS_CHANNEL_FILE_PING_PORT=9998
  • CB_JGROUPS_TEST_CHANNEL_FILE_PING_PORT=9997 (optional)

Automatic

For technical details, see page http://www.jgroups.org/manual4/#MPING.

Environment Variables
  • CB_JGROUPS_CHANNEL_MULTICAST_ADDRESS=230.0.0.1
  • CB_JGROUPS_CHANNEL_MULTICAST_PORT=9998
  • CB_JGROUPS_TEST_CHANNEL_MULTICAST_PORT=9997 (optional)

Manual

For technical details, see page http://www.jgroups.org/manual4/#TCPPING_Prot.

Environment Variables
  • CB_JGROUPS_CHANNEL_TCP_PING_ADDRESSES=230.0.0.1
  • CB_JGROUPS_CHANNEL_TCP_PING_PORT=9998
  • CB_JGROUPS_TEST_CHANNEL_TCP_PING_PORT=9997 (optional)

How to Test JGroups Network Configurations

JGroups is only used for distributing WebSocket message among running nodes.

JGroup has been removed from the Codebeamer project since Codebeamer release 21.09-SP6.

Steps for Testing - Since Codebeamer Release 10.0

  • Open /sysadmin/cluster/test/jgroups.sprpage.
    • CB_JGROUPS_TEST_### must be configured.
  • Reponse should contain name of all discovered nodes.

Steps for Testing - Since Codebeamer Release 10.1

  1. Open a Codebeamer instance and log in.
  2. Open another Codebeamer instance and log in.
  3. Visit the /cb/sysadmin/websocketAdminNotification.spr page on one of the Codebeamer instances.
  4. Check the Test for me and Sticky notification checkbox.
  5. Write a test message into Message field.
  6. Click [Save].
  7. Message should be received in both browser tabs.

Running an Active-Active Codebeamer Cluster with Docker-Compose

All the software required to run a Codebeamer cluster is also available as public docker images. With these resources, it is easy to spin up an instance in an isolated, safe manner with minimal dependencies. As multiple containers are required to run for a cluster to operate, some coordination is needed. There are several tools available for container orchestration. In the provided example, a Docker Compose file is given. The script can be easily adapted for other tools as well.

Dependencies

  • docker
  • docker-compose

Usage

  • Navigate to the docker-compose.yml file location (provided below).
  • Issue command: docker-compose up . Use docker-compose -d up to run in the background.
  • Once bootstrapped and started, Codebeamer cluster can be accessed in the browser (http://localhost:8080/)
  • Use the username bond with the password 007 to log in.
  • To stop the containers, either exit the docker-compose process if it is running in the foreground, or, issue docker-compose down from the location of the docker-compose.yml file.

docker-compose.yml

This is an example configuration, not a production ready setup. Use this only for understand the clustering itself.

# Copyright by Intland Software, https://www.intland.com
#
# All rights reserved.
#
# Please note that if you change this docker file, we do not take any responsibility and we are not liable for
# any damage caused through use of this image, be it indirect, special, incidental
# or consequential damages (including but not limited to damages for loss of business, loss of profits, interruption or the like).


version: '2.1'


services:
  codebeamer-db:
    image: intland/mysql:debian-8.0.32-utf8mb4
    environment:
      - MYSQL_USER=user
      - MYSQL_PASSWORD=pass
      - MYSQL_ROOT_PASSWORD=pass
      - MYSQL_DATABASE=codebeamer
      - MYSQL_MAX_ALLOWED_PACKET=1024M
      - MYSQL_INNODB_BUFFER_POOL_SIZE=1G
      - MYSQL_INNODB_LOG_FILE_SIZE=256M
      - MYSQL_INNODB_LOG_BUFFER_SIZE=256M
      - TZ=Europe/Berlin
    ports:
      - 8081:3306
    volumes:
      - codebeamer-db-data:/var/lib/mysql
    networks:
      - cluster


  codebeamer-app-server1:
    image: intland/codebeamer-git:2.0.0.0
    depends_on:
      codebeamer-db:
        condition: service_healthy
    environment:
      - CB_MAXHEAPSIZE=1500
      - TZ=Europe/Berlin
      - WAIT_HOSTS=codebeamer-db:3306
      - WAIT_HOSTS_TIMEOUT=120
      - CB_CLUSTER_ENABLED=true
      - CB_ping_testingEnabled=true
      - CB_RMI_CACHE_HOSTNAME=codebeamer-app-server1
      - CB_RMI_CACHE_INSTANCES=codebeamer-app-server1, codebeamer-app-server2
      - CB_RMI_REPLICATION_CACHE_PORT=4001
      - CB_RMI_INVALIDATION_CACHE_PORT=4002
      - CB_RMI_CACHE_SOCKET_TIMEOUT_MILLIS=12000
      - CB_RMI_CACHE_REMOTE_OBJECT_PORT=9000
      - CB_JGROUPS_CHANNEL_TCP_PING_ADDRESSES=codebeamer-app-server1, codebeamer-app-server2
      - CB_JGROUPS_CHANNEL_TCP_PING_PORT=9998
      - CB_JGROUPS_TEST_CHANNEL_TCP_PING_PORT=8998
      - CB_SCHEDULER_FACTORY_THREAD_COUNT_INSTANCE=3
      - CB_SCHEDULER_FACTORY_THREAD_COUNT_CONCURRENT=3
      - CB_SCHEDULER_FACTORY_THREAD_COUNT_REPORT=3
      - CB_SCHEDULER_FACTORY_THREAD_COUNT_REMOTE_JIRA_SYNC=3
      - CB_SCHEDULER_FACTORY_THREAD_COUNT_REMOTE_DOORS_SYNC=3
      - CB_database_JDBC_Username=user
      - CB_database_JDBC_Password=pass
      - CB_database_JDBC_Driver=com.mysql.jdbc.Driver
      - CB_database_JDBC_ConnectionURL=jdbc:mysql://codebeamer-db:3306/codebeamer?autoReconnect=true&zeroDateTimeBehavior=convertToNull&emulateLocators=true&characterEncoding=UTF-8&useSSL=false
    ports:
      - 9080:8080
    networks:
      - cluster
    volumes:
      - codebeamer-app-server-tmp:/home/appuser/codebeamer/repository/tmp
      - codebeamer-app-server-repository-docs:/home/appuser/codebeamer/repository/docs
      - codebeamer-app-server-repository-search:/home/appuser/codebeamer/repository/search
      - codebeamer-app-server-repository-svn:/home/appuser/codebeamer/repository/svn
      - codebeamer-app-server-repository-git:/home/appuser/codebeamer/repository/git
      - codebeamer-app-server-repository-reports:/home/appuser/codebeamer/repository/reports
      - codebeamer-app-server-logs:/home/appuser/codebeamer/logs


  codebeamer-app-server2:
    image: intland/codebeamer-git:2.0.0.0
    depends_on:
      codebeamer-db:
        condition: service_healthy
    healthcheck:
      timeout: 10s
      retries: 3
    environment:
      - CB_MAXHEAPSIZE=1500
      - TZ=Europe/Berlin
      - WAIT_HOSTS=codebeamer-db:3306
      - WAIT_HOSTS_TIMEOUT=120
      - CB_CLUSTER_ENABLED=true
      - CB_ping_testingEnabled=true
      - CB_RMI_CACHE_HOSTNAME=codebeamer-app-server2
      - CB_RMI_CACHE_INSTANCES=codebeamer-app-server1, codebeamer-app-server2
      - CB_RMI_REPLICATION_CACHE_PORT=4001
      - CB_RMI_INVALIDATION_CACHE_PORT=4002
      - CB_RMI_CACHE_SOCKET_TIMEOUT_MILLIS=12000
      - CB_RMI_CACHE_REMOTE_OBJECT_PORT=9000
      - CB_JGROUPS_CHANNEL_TCP_PING_ADDRESSES=codebeamer-app-server1, codebeamer-app-server2
      - CB_JGROUPS_CHANNEL_TCP_PING_PORT=9998
      - CB_JGROUPS_TEST_CHANNEL_TCP_PING_PORT=8998
      - CB_SCHEDULER_FACTORY_THREAD_COUNT_INSTANCE=3
      - CB_SCHEDULER_FACTORY_THREAD_COUNT_CONCURRENT=3
      - CB_SCHEDULER_FACTORY_THREAD_COUNT_REPORT=3
      - CB_SCHEDULER_FACTORY_THREAD_COUNT_REMOTE_JIRA_SYNC=3
      - CB_SCHEDULER_FACTORY_THREAD_COUNT_REMOTE_DOORS_SYNC=3
      - CB_database_JDBC_Username=user
      - CB_database_JDBC_Password=pass
      - CB_database_JDBC_Driver=com.mysql.jdbc.Driver
      - CB_database_JDBC_ConnectionURL=jdbc:mysql://codebeamer-db:3306/codebeamer?autoReconnect=true&zeroDateTimeBehavior=convertToNull&emulateLocators=true&characterEncoding=UTF-8&useSSL=false
    ports:
      - 9090:8080
    networks:
      - cluster
    volumes:
      - codebeamer-app-server-tmp:/home/appuser/codebeamer/repository/tmp
      - codebeamer-app-server-repository-docs:/home/appuser/codebeamer/repository/docs
      - codebeamer-app-server-repository-search:/home/appuser/codebeamer/repository/search
      - codebeamer-app-server-repository-svn:/home/appuser/codebeamer/repository/svn
      - codebeamer-app-server-repository-git:/home/appuser/codebeamer/repository/git
      - codebeamer-app-server-repository-reports:/home/appuser/codebeamer/repository/reports
      - codebeamer-app-server-logs:/home/appuser/codebeamer/logs


  load-balancer:
    image: intland/loadbalancer:latest
    depends_on:
      codebeamer-app-server1:
        condition: service_healthy
      codebeamer-app-server2:
        condition: service_healthy
    environment:
      - SERVERS=http://codebeamer-app-server1:8080 http://codebeamer-app-server2:8080
      - HOSTNAME=localhost
      - TIMEOUT=600
      - MAX_NUMBER_OF_CONNECTIONS=100
      - MIN_NUMBER_OF_CONNECTION_POOL_ENTRIES=0
      - ACQUIRE=3000
      - KEEPALIVE=On
      - RETRY_TIMEOUT=1
      - IOBUFFERSIZE=8192
    ports:
      - 8080:8080
    networks:
      - cluster


volumes:
  codebeamer-db-data:
  codebeamer-app-server-tmp:
  codebeamer-app-server-repository-docs:
  codebeamer-app-server-repository-search:
  codebeamer-app-server-repository-svn:
  codebeamer-app-server-repository-git:
  codebeamer-app-server-repository-reports:
  codebeamer-app-server-logs:


networks:
  cluster: