On sites distributed across multiple geographic locations, Git replica servers are local and remote mirror servers that can provide up-to-date copies of the central repositories. If set up, Git replica servers can address load balancing and fetch performance issues. You can set up one or more Git replica servers (also referred to as slave or mirror servers) with TeamForge 8.1 and later.

Set up a Git Replica Server

  • A Git replica server has one and only one master Git server.
  • It’s not possible to set up both Git master and slave on the same server. However, you can have multiple master and slave servers in your TeamForge environment.
  • Git replication servers can be set up with TeamForge 8.1 or later only.

You may have your master Git integration server installed on the TeamForge Application Server or on a separate server dedicated to Git/SCM integration.

TeamForge and Git (master) on the Same Server
TeamForge and Git (master) on Separate Servers
Before You Begin
  • Make sure you have upgraded your Git integration to TeamForge-Git v8.4.6 or later.
  • Have the master Git integration server’s externalSystemId handy.

    Open the /opt/collabnet/gerrit/etc/gerrit.config file on the master Git integration server and note down the externalSystemId from the [teamforge] section.

    Alternatively, log on to the TeamForge Application Server as a Site Administrator, click Admin > Integrations > SCM Integrations, select the master Git integration server, click Edit and look for a token such as exsy####, for example exsy1002, in the browser URL. This is the external system ID of your Git integration server.

  • Open the TeamForge Application Server’s site-options.conf file and keep the values of the following tokens handy.

    Note down the values of the following tokens if and only if obfuscation is enabled (OBFUSCATION_ENABLED=true):

  1. Install Red Hat Enterprise Linux/CentOS 7.4 and log on as root.

    The host must be registered with the Red Hat Network if you are using Red Hat Enterprise Linux.

    See the Red Hat Installation Guide for help.
  2. Check your basic networking setup. See Set up Networking for more information.
  3. Upgrade the operating system packages.
    yum upgrade
  4. Reboot the server.
  5. TeamForge Installation Repository Configuration for Sites with Internet Access

    1. Contact the CollabNet Support and download the TeamForge 18.1 installation repository package to /tmp.
    2. Install the repository package.
      yum install -y /tmp/collabnet-teamforge-repo-18.1-0-noarch.rpm
    3. Refresh your repository cache.
      yum clean all

    TeamForge Installation Repository Configuration for Sites without Internet Access

    1. Contact the CollabNet Support to get the auxiliary installer package for TeamForge 18.1 disconnected installation and save it in /tmp.
      • RHEL/CentOS 7.4 64 bit: CTF-Disconnected-media-18.1.446-1261.rhel7.x86_64.rpm
      • In addition to the above CentOS 7.4 64 bit RPM package, you must get the following CentOS 7.4 compatibility RPM, which is required for TeamForge 18.1 disconnected media installation on CentOS 7.4 profile: compat-ctf-dc-media-1.0-1.el7.centos.noarch.rpm.
    2. Unpack the disconnected installation package.
      rpm -ivh <package-name>
    3. Unpack the compat-ctf-dc-media-1.0-1.el7.centos.noarch.rpm package if you are installing TeamForge 18.1 on CentOS 7.4.
      rpm -ivh compat-ctf-dc-media-1.0-1.el7.centos.noarch.rpm
    4. If not mounted already, mount the RHEL/CentOS installation DVD.

      The DVD contains the necessary software and utilities required for installing TeamForge without internet access. In the following commands, replace “cdrom” with the identifier for your server’s CD/DVD drive, if necessary.

      cd /media/
      mkdir cdrom
      mount /dev/cdrom ./cdrom/

      If there are any spaces in the automount, unmount it first and mount it as a filepath, with no spaces.

    5. Create a yum configuration file that points to the RHEL/CentOS installation DVD.
      vi /etc/yum.repos.d/cdrom.repo

      Here’s a sample yum configuration file.

      name=RHEL CDRom 			
    6. Verify your yum configuration files.
      yum list httpd
      yum list apr
  6. Install the Git packages.
    yum install teamforge-git
  7. Set up the site-options.conf tokens for the Git replica server.
    vi /opt/collabnet/teamforge/etc/site-options.conf
    It is assumed that:

    my.app.domain.com is the Fully Qualified Domain Name (FQDN) of your TeamForge Application Server.

    my.git.domain.com is the Fully Qualified Domain Name (FQDN) of your Git Integration Server.

    my.gitreplica.domain.com is the Fully Qualified Domain Name (FQDN) of your Git Replica Server.
    1. Set up the SERVICES tokens.
      my.gitreplica.domain.com:SERVICES=gerrit gerrit-database
      my.app.domain.com:SERVICES=ctfcore ctfcore-database ctfcore-datamart etl search subversion cvs binary binary-database
    2. Turn on the SSL for your site by editing the relevant variables in the site-options.conf file. To generate the SSL certificates, see Generate SSL Certificates.
      • The SSL_CHAIN_FILE is optional.
      • If you use certificates that are generated in-house, self-signed, or signed by a non-established Certificate Authority, they must be registered with each client system that will connect to the TeamForge server.
      • For the setup discussed in this topic, add the certificate of my.app.domain.com to the JVM of my.git.domain.com and my.gitreplica.domain.com. In addition, add the certificate of my.gitreplica.domain.com to the JVM of my.git.domain.com. Click here for more information.
    3. Set the gerrit replication server mode.
    4. Set the external system ID of the master Git integration server.
    5. Set the obfuscation related tokens.
    6. Save the site-options.conf file.
  8. Provision services.
    teamforge provision

Now, the gerrit service is running in replica mode. You can now find the newly created Git Replica Server listed on TeamForge Application Server by accessing the following url: http://<TF_HOST>/sf/sfmain/do/listSystems.

Once you have set up one or more Git replica servers, you can replicate repositories.

Replicate Repositories with Git Replica Servers

It is assumed that you already have one or more Teamforge projects that consists of one or more Git repositories that you want to replicate.

  1. To start replicating a repository–go to the TeamForge project–select and edit the repository you want to replicate.
  2. Select the target replica server(s).
  3. Verify the replication status.
  4. Use the clone protocol of your choice.
  5. Clone the repository from a replica server.
  6. Push a commit and verify if it’s replicated on the replica servers.
  7. Verify the status of synch operations.
Tags for this page: git_gerrit integration source_code