This exercise came out of the necessity for more disk space on a application server which accepts user-submitted photos. The hosting provider (OpSource) quoted a minimum of 2 days to add a NAS drive, Akamai was able to setup NetStorage in a matter of hours. But this also means that I would need to reconfigure Akamai to use NetStorage as the origin server instead of the existing OpSource Apache server. I will then need to setup a rsync cron job to syncronize the app server with NetStorage and delete the source files form the source server in order to preserve disk space. But first I need to rsync the existing files to NetStorage:
- First, enable rsync in Akamai Control panel under NetStorage->ViewDetails->Upload Accounts->Edit->Enable Rsync Access
- Generate SSH public key on the source server using “ssh-keygen -t dsa” (Hit ‘Enter’ when it asks for a passphrase, DO NOT USE passphrase.)
- Copy the SSh key from the file that ssh-keygen saved and enter it into the Akamai Control Panel under NetStorage->ViewDetails->Upload Accounts->Edit->SSH Keys
- Wait for about an hour for the key to be propagated to all Akamai servers
- On the source server, cd into the source directory
- Execute ‘rsync -avzl -e ssh * sshacs@account.upload.akamai.com:/cp-code/’
This will recursively copy all files and directories and preserve symlinks. The important thing to note is the ssh username “sshacs”. This is the username that must be used and NOT the username assigned to the NetStorage account.