Cargo on APOD
This article provides the steps on how to install and configure Cargo on Aspera on Demand for AWS so that Cargo will download packages and deposit them into an S3 bucket.
- SOD/APOD up and running
- You have a working account on a Faspex Server
Note: In the demo below, I use the ‘cargo’ account on Faspex.asperasoft.com
- A transfer account runs in bash shell with S3 document root. Incoming Transfers authorization should set to "allow" for this transfer account.
1) Log into your Aspera server as the user root. If you don't know how, please read this article.
2) Download and install Cargo 64 bit:
3) Install RPM
rpm –ivh aspera-cargod-188.8.131.52012-linux-64.rpm
4) Configure Cargo
Here is a sample minimal required Configuration file:
<?xml version="1.0" encoding="UTF-8"?>
5) Verify Cargo works as expected
a) Launch Cargo
b) Send a Faspex package to user cargo via Faspex Web UI
c) Check whether or not the package is automatically downloaded by Cargo
6) Once you confirm Cargo is set up correctly, change the following permissions on your file system so that Cargo can be run as non root user:
chmod 777 /opt/aspera/cargod/var
chmod 777 /opt/aspera/cargod/var/filelists
chmod 777 /opt/aspera/cargod/var/log
chmod 666 /opt/aspera/cargod/var/log/*
7) Create a new transfer user (e.g. asp1) from your APOD Console and set asp1 runs in bash shell.
8) Specify an S3 docroot for your user (e.g. asp1) in the Cargod
aspera.conf as well as the main
# vi /opt/aspera/cargod/etc/aspera.conf
NOTE: Once this file has been edited, you need to add a similar entry into the main aspera.conf too.
# vi /opt/aspera/etc/aspera.conf
Here is a sample of a working aspera.conf with some S3 ID and bucket substitutions:
<?xml version='1.0' encoding='UTF-8'?>
9) Set the permissions on asperacargo.conf so that non root users have access:
chmod 666 /opt/aspera/cargod/etc/asperacargo.conf
10) Link ascp to the system default ascp
mv /opt/aspera/cargod/bin/ascp /opt/aspera/cargod/bin/ascp.ORIG
ln –s /opt/aspera/bin/ascp /opt/aspera/cargod/bin/ascp
11) Login as the user with the S3 document root (e.g. asp1) In this example, you can see that I switch from root to the user 'asp1'.
# sudo su – asp1
12) In order to have ascp respects the local document root configurations, set the environment variable:
ASPERA_SCP_DOCROOT by adding the following to the user's
~/.bash_profile. Log out as asp1 and log back in as asp1 to activate the environment variable.
ASPERA_SCP_DOCROOT=1 export ASPERA_SCP_DOCROOT
13) Create a default landing folder in your S3 docroot, with the syntax user@host. In my example, I have ‘firstname.lastname@example.org’. You can use S3 Management Console in AWS, Aspera SCP GUI (P2P or ES), or the S3 browser to create this folder.
14) Remove the database file and start Cargo in the background. NOTE: Cargo must be run by the transfer user with S3 docroot.
# rm /opt/aspera/cargod/var/asperacargod.dat*
# /opt/aspera/cargod/bin/asperacargod &