Automation Platform Tasks

Configuring Repository Servers

4 minute read

This section describes how to configure repository servers for high availability.

Overall Steps for Configuring Repository Servers

The overall steps for configure repository servers for high availability are as follows:

To set up repository servers for a typical cluster deployment, complete the following steps.

Duplicating Repository Contents to a New Repository Server

To duplicate the contents of an existing repository server to a new repository server:

  1. Stop both repository servers.

  2. Copy the entire contents of the repository backingstore directory from the existing repository server to the corresponding location on the new repository server.

    The default location for the backingstore directory ( DATA_DIR/repository-data ) is: UNIX— /opt/electriccloud/electriccommander/repository-data Windows— C:\ProgramData\Electric Cloud\ElectricCommander\repository-data

  3. Restart both repository servers.

Configuring Each Existing Repository Server for Clustered Operation

Additional configuration is required for any repository server that existed before being converted to operate in a cluster or was not configured to point to a remote server location during installation. You must point each of these repository servers to the CloudBees Flow server’s load balancer machine instead of directly to a CloudBees Flow server. To do so, enter the following command on each repository server:

/opt/electriccloud/electriccommander/bin/ecconfigure --repositoryTargetHostName load_balancer_FQDN

This avoids an AccessDenied error when an artifact is uploaded from the Automation Platform UI:

In the example above, 10.239.256.235 is the IP address of one of the two load-balanced CloudBees Flow servers.

To point a repository server to the CloudBees Flow server’s load balancer machine:

  1. Locate the ecconfigure tool.

    • On Linux, it is usually at /opt/electriccloud/electriccommander/bin/ecconfigure.

    • On Windows, it is usually at C:\Program Files\Electric Cloud\ElectricCommander\bin\ecconfigure.exe.

  2. Run the tool with the following option on the repository server.

    You might need to do this as root or with administrator privileges:

    ecconfigure --repositoryTargetHostName load_balancer_FQDN

    where load_balancer_FQDN is the fully-qualified domain name of your CloudBees Flow server’s load balancer machine.

Pointing Each Repository Server to the Repository Backingstore

In a non-clustered configuration, the repository server is configured to store artifact versions in a directory called the repository backingstore. By default, the backingstore is the DATA_DIR/repository-data directory in the repository installation. In a clustered configuration, you must point each repository server to a common backingstore location.

Windows

In C:\ProgramData\Electric Cloud\ElectricCommander\conf\repository\server.properties on each repository server, set REPOSITORY_BACKING_STORE to a UNC path to a network share on the file server, and then restart that repository server.

For example, set:

REPOSITORY_BACKING_STORE=//10.0.109.72/repo_data/repository-data

You can also configure this by running the ecconfigure --repositoryStorageDirectory command on each repository server. For example, enter:

ecconfigure --repositoryStorageDirectory //10.0.109.72/repo_data/repository-data

Linux

If the network file share is Linux, mount it to the DATA_DIR/repository-data on all repository servers. For example, you can mount the file share for DATA_DIR/repository-data in the /etc/fstab file on each Linux repository server.

This means that you do not need to run the ecconfigure –repositoryStorageDirectory command to change REPOSITORY_BACKING_STORE from its REPOSITORY_BACKING_STORE= repository-data default value.

Opening the 7800 and 8200 Firewall Inbound Ports on Each Repository Server

On each repository server, make sure that the firewall inbound ports for 7800 and 8200 are open. This allows the load balancer to balance these ports.

Load balancing the repository local agent port 7800 is optional. If you do not do so, you must register each repository local agent in the Cloud > Resources page in the Automation Platform UI on the CloudBees Flow server.

If you load balance the repository local agent port 7800, you can register just the repository local agent load balancer port 7800 in the Cloud > Resources page on the CloudBees Flow server, but you must “ping” it from the Automation Platform UI several times so that all the agents behind the load balancer are pinged, and then they will know how to contact the CloudBees Flow server.

Registering the Repository to the CloudBees Flow Cluster

You must use the load balancer URL to register the repository to the CloudBees Flow cluster so that the CloudBees Flow server can find the repository server load balancer. To do so:

  1. In the Automation Platform on the CloudBees Flow server, go to the Artifacts > Repositories tab.

  2. Verify that URL for the specified Repository Name points to the load balancer machine.

Registering the Repository Local Agents to the CloudBees Flow Cluster

You must register the repository local agents to the CloudBees Flow cluster. You can do this by registering only the load balancer as the agent resource if you already load-balanced port 7800 of the repository local agents.

If you did not load balance port 7800, you must register each repository local agent in the Cloud > Resources page in the Automation Platform on the CloudBees Flow server.

Re-Creating a Deleted DATA_DIR /tmp Directory on a CloudBees Flow Web Server

Each CloudBees Flow web server that is load balanced requires a DATA_DIR/tmp directory. When you upload artifacts using the Automation Platform UI, that web server uses this folder as an intermediate location to upload the artifacts to the repository. This means that if the following error appears on a web server during file upload from the UI, you must re-create this folder on that machine:

Upload file: Error in tempdir() using /app/ElectricCloud/ElectricCommander/tmp/XXXXXXXXXX:
Parent directory (/app/ElectricCloud/ElectricCommander/tmp) does not exist