This section describes how to configure repository servers for high availability.
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.
To duplicate the contents of an existing repository server to a new repository server:
Stop both repository servers.
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—
C:\ProgramData\CloudBees\Software Delivery Automation\repository-data
Restart both repository servers.
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 CD/RO server’s load balancer machine instead of directly to a CloudBees CD/RO server. To do so, enter the following command on each repository server:
/opt/cloudbees/sda/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 CD/RO servers.
To point a repository server to the CloudBees CD/RO server’s load balancer machine:
On Linux, it is usually at
On Windows, it is usually at
C:\Program Files\CloudBees\Software Delivery Automation\bin\ecconfigure.exe.
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
load_balancer_FQDNis the fully-qualified domain name of your CloudBees CD/RO server’s load balancer machine.
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.
C:\ProgramData\CloudBees\Software Delivery Automation\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:
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
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.
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 CD/RO 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 CD/RO 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 CD/RO server.
You must use the load balancer URL to register the repository to the CloudBees CD/RO cluster so that the CloudBees CD/RO server can find the repository server load balancer. To do so:
In the Automation Platform on the CloudBees CD/RO server, go to the Artifacts > Repositories tab.
Verify that URL for the specified Repository Name points to the load balancer machine.
You must register the repository local agents to the CloudBees CD/RO 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 CD/RO server.
Each CloudBees CD/RO 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/cloudbees/sda/tmp/XXXXXXXXXX: Parent directory (/app/cloudbees/sda/tmp) does not exist