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
- Every 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.
- You may have your master Git integration server installed on the TeamForge
application server's host or on a separate host dedicated to Git/SCM
integration.
- Git replication servers can be set up with TeamForge 8.1 or later only.
- You must upgrade your Git integration server to v8.4.6 or later. Click
here to know more.
- 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 an Admin
user, click , 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.
-
Install Red Hat Enterprise Linux/CentOS 6.5 or later and log on to the server
as root.
Important:
- 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. Important:
- Don't customize your installation. Select only the default packages
list.
-
Check your basic networking setup. See Set up networking for more
information.
-
If the Git replica server has SELinux enabled, run it in 'Permissive' mode
temporarily while installing or upgrading TeamForge.
-
Verify if SELinux is running in enforcing mode.
-
If the output of the getenforce command is
"Permissive", continue with the next step.
-
If not, run the following command to bring it to 'Permissive'
mode.
-
Upgrade the operating system packages.
-
Reboot the server.
-
Configure your TeamForge installation repository. See TeamForge installation repository configuration for Red Hat/CentOS.
-
Install the Git packages.
- yum install teamforge-git
-
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.
-
Modify the HOST tokens.
HOST_my.gitreplica.domain.com=gerrit
HOST_my.app.domain.com=app database datamart etl indexer subversion cvs binary
-
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_CA_CERT_FILE=
SSL_CHAIN_FILE=
Note:
- The SSL_CA_CERT_FILE and SSL_CHAIN_FILE are 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.
-
Set the gerrit replication server mode.
GERRIT_REPLICATION_MODE=slave
-
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####
-
Set the obfuscation related tokens as discussed earlier in Points to note
before you begin.
-
Save the site-options.conf file.
-
Recreate the runtime environment.
- cd
/opt/collabnet/teamforge-installer/<TF_VERSION>
- ./install.sh -r -I -V
-
Run the TeamForge post installation script. For more information, see post-install.py.
- /opt/collabnet/teamforge/runtime/scripts/post-install.py
Now, the gerrit service is running in replica mode. You can now find the newly
created Git replica server listed on TeamForge 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.