Here is How To Mount OpenStack Swift on Ubuntu Server. We Have Used HP Cloud For Example Prototype Configuration for OpenStack Swift Storage. Rackspace system is different, because Rackspace deliberately uses API based authentication. Otherwise, all Rackspace so called Free Softwares would be Free Softwares for all OpenStack installations. HP Cloud uses typical OpenStack Installation system. Basically, HP is the main contributor of codes for OpenStack at this moment. If you are still Rackspace user, you need to follow this Mount Rackspace Cloud Files on Ubuntu Server Guide. In this Guide We Will Mount OpenStack Swift on Ubuntu Server on HP Cloud minus Rackspace. It could be own installation. If you modify, you can do it on any unix like OS including BSD and OS X.
Logics To Mount OpenStack Swift on Ubuntu Server (HP Cloud)
Most ask whether we can mount wp-content
on OpenStack Swift or not, that frankly means direct CDN sync. One line answer – not possible as unreliable. WordPress is PHP based, that CDN sync function of OpenStack Swift is quite complex and as Tenant, your instance can die. Our mounting is for easy backups, easy workflow on command line.
Logical flow to Mount OpenStack Swift on Ubuntu Server is quite easy. Swiftly is a Python Swift Client based tool. Cloudfuse is a FUSE application which provides access to OpenStack Swift. Cloudfuse was modified mainly for Rackspace Cloud Files but basically it works with any OpenStack with minor tweak. We will use only Cloudfuse here.
---
Steps To Mount OpenStack Swift on Ubuntu Server (HP Cloud)
Do it on a developmental setup with exact configuration like production server. You may spin up a server from snapshot. In the first step, we need to install all the dependencies :
1 2 3 | sudo su ~ apt-get update -y && apt-get upgrade apt-get install build-essential libcurl4-openssl-dev libxml2-dev libssl-dev libfuse-dev git gcc |
build-essential
should enable make
. Check with which make
. If no output, troubleshoot it. We need to clone this repo :
1 2 3 4 | # repo - https://github.com/redbo/cloudfuse git clone https://github.com/redbo/cloudfuse.git -v # v flag added for verbose output # read git reference - http://git-scm.com/docs/git-clone |
We will install crontab
then :
1 2 3 4 | apt-get install cron # start and run it on background sudo /sbin/chkconfig crond on sudo /sbin/service crond start |
Now change directory and compile :
1 2 3 4 5 6 7 8 9 10 | cd /root/cloudfuse/ ./configure make make install # if the next command throws error, run # apt-get install fuse # then again modprobe fuse # fuse documentation http://sourceforge.net/projects/fuse/?source=directory |
Now, create a file named .cloudfuse
, root of the stuffs :
1 2 | nano /root/.cloudfuse # read out of this window what to copy paste there |
You have to copy this prototype and fill with real data, modify and then paste that on .cloudfuse
file. Here is a trick. For OpenStack, you need it looking like openstack_rc
file :
1 2 3 4 | username=RealUsername tenant=realtenantID password=secret authurl=HP Cloud or your installations's full url |
Do not read the GitHub repo’s README, they also wrote for Rackspace Cloud’s OpenStack Swift setup. The guides end here for unknown reason. We have to mount it :
1 2 | mkdir /mnt/swift/ && cloudfuse /mnt/swift/ # no -p flag to mount |
The file /etc/modules
should contain direction for fuse
. Documentation is here :
1 | https://help.ubuntu.com/community/Loadable_Modules |
The file /var/spool/cron/crontab
or /etc/crontab
actually need a directive like :
1 | @reboot root cloudfuse /mnt/swift -o allow_other,nonempty |
Now run reboot
and check. This should make it working. The repo has some logical problems, that might require troubleshooting by a bit Google Search with the error.