2. How to... : Enable Gerrit Code Review Replication
   
Enable Gerrit Code Review Replication
Gerrit Code Review can be configured to push changes from Git repositories to one or more remote hosts. This section describes how to enable Gerrit Code Review replication in GitCentric. For general concepts related to Gerrit Code Review replication, refer to the Gerrit Code Review documentation.
Overview
The basic procedure for enabling Gerrit Code Review replication is summarized here:
1. Register the SSH public key representing the GitCentric bridge account with the Gerrit Code Review administrator’s account.
2. Ensure that the server running Gerrit Code Review has SSH access to the server to which changes will be replicated. If the machine running Gerrit Code Review has never connected to the replication server, it will be listed as an unknown host and Gerrit Code Review will close the connection.
3. Modify the sample Git-style configuration file, replication.config, that is installed with GitCentric.
4. Stop and restart Gerrit Code Review.
The following sections provide additional detail.
Registering the GitCentric Bridge SSH Key with Gerrit
The SSH public key representing the GitCentric bridge account is registered automatically when you install GitCentric the first time. If you have upgraded an existing GitCentric installation, you need to register the SSH public key manually. See Public Keys on page 59 for more information.
Modifying the replication.config File
Gerrit Code Review uses a replication.config file to identify the URL of the server to which changes will be replicated. For example:
[remote "host-one"]
url = gerrit2@host-one.example.com:/some/path/${name}.git
A sample replication.config is installed to <gc_home>site/etc. To use this file:
1. Uncomment the example.
Tip: Consider copying the example and using that copy to specify the URLs for one or more remote hosts.
2. Change the sample values for values applicable to your environment.
3. Stop Gerrit Code Review, which you can do by stopping the Tomcat web server. For example:
cd <ac_home>/WebUI/tomcat/bin
./shutdown.sh
4. Restart Gerrit Code Review. For example:
cd <ac_home>/WebUI/tomcat/bin
./startup.sh
Note: Make sure that the user starting Tomcat has write access to the logs, temp, webapps, and work directories in <ac_home>/WebUI/tomcat. This user should have read access to all other Tomcat directories and files.