Set up a Git replica server

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, which if set up, 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.

Points to note before you begin

  1. Install Red Hat Enterprise Linux/CentOS 7.3 and log on to the server as root.
    Important:
  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.
    • reboot
  5. Configure your TeamForge installation repository.
    • TeamForge installation repository configuration for sites with internet access
    1. Contact the CollabNet Support and download the TeamForge 17.8 installation repository package to /tmp.
    2. Install the repository package.
      • yum install -y /tmp/collabnet-teamforge-repo-17.8.xx-1.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 17.8 disconnected installation and save it in /tmp.
      • Red Hat Enterprise Linux/CentOS 7.3 64 bit RPM package: CTF-Disconnected-media-17.8.655-104.rhel7.x86_64.rpm
        Note: In addition to the above CentOS 7.3 64 bit RPM package, you must get the following CentOS 7.3 compatibility RPM, which is required for TeamForge 17.8 disconnected media installation on CentOS 7.3 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 17.8 on CentOS 7.3.
      • rpm -ivh compat-ctf-dc-media-1.0-1.el7.centos.noarch.rpm
    4. Note: If the Red Hat Enterprise Linux/CentOS installation DVD is mounted already, skip the following instructions. If not, mount the DVD.
      Mount the Red Hat Enterprise Linux/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 Red Hat Enterprise Linux/CentOS installation DVD.
      • vi /etc/yum.repos.d/cdrom.repo
      Here's a sample yum configuration file.
      [RHEL-CDROM] 
      name=RHEL CDRom 			
      baseurl=file:///media/cdrom/Server/
      gpgfile=file:///media/cdrom/RPM-GPG-KEY-redhat-release 
      enabled=1
      gpgcheck=0
    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 token for Git.
    • vi /opt/collabnet/teamforge/etc/site-options.conf
    Note: In this topic:
    • my.app.domain.com is an example of the Fully Qualified Domain Name (FQDN) of your TeamForge Application Server.
    • my.git.domain.com is an example of the Fully Qualified Domain Name (FQDN) of your Git Integration Server.
    • my.gitreplica.domain.com is an example of 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.
      SSL=on
      SSL_CERT_FILE=
      SSL_KEY_FILE=
      SSL_CHAIN_FILE=
      Note:
      • 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.
      GERRIT_REPLICATION_MODE=slave
    4. Set the external system ID of the master Git integration server. See 'Points to note before you begin'.
      GERRIT_REPLICATION_MASTER_EXTERNAL_SYSTEM_ID=exsy####
    5. Set the obfuscation related tokens as discussed earlier in Points to note before you begin.
    6. Save the site-options.conf file.
  8. Deploy 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. For more information, see Replicate repositories with Git replica servers.