RSS

Swift Only with OpenStack DevStack on the Rackspace Cloud

18 Feb

devstackSwift is not installed by default when using OpenStack DevStack. Sometimes you want to install Swift only for some testing without all of the other services getting in the way. Here’s how to setup Swift (and Keystone for authentication) with DevStack on the Rackspace Cloud.

Instructions

  1. If you don’t have one already, Sign Up for an open cloud account
  2. Go to the Cloud Control Panel
  3. Click Create Server
    1. Name: devstack-swift
    2. Image: Ubuntu 12.04 LTS
    3. Size: 4GB RAM (you could probably get away with 2 GB)
  4. Click Create Server and note the password and IPv4 address (when it appears)
  5. When your server is Active, switch to a Terminal and run the following commands to create the stack user.
    1. ssh root@<IPv4 Address>
    2. adduser --gecos "" stack
    3. adduser stack sudo
    4. grep -q "^#includedir.*/etc/sudoers.d" /etc/sudoers || echo "#includedir /etc/sudoers.d" >> /etc/sudoers
    5. ( umask 226 && echo "stack ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/50_stack_sh )
    6. exit
  6. I create the stack user like this because I’ve found that there are permission issues with screen if you create a “dummy” stack user and just switch to the stack user from the root user.
  7. Now login as the stack user and setup Swift:
    1. ssh stack@<IPv4 Address>
    2. sudo apt-get -y update
    3. sudo apt-get -y install git
    4. git clone https://github.com/openstack-dev/devstack.git
    5. cd devstack
    6. vim localrc # copy in the contents of this one
    7. ./stack.sh
    8. screen -r stack
  8. When running stack.sh you might see an error message that reads “ERROR: at least one rpc backend must be enabled”. Don’t worry about it, Swift/Keystone doesn’t need an rpc (AMQP) backend. You can also ignore any ImportErrors.
  9. When DevStack is done you can point your OpenStack clients and jclouds dev env all at <IPv4 Address>
  10. When you’re done with your development/testing you can delete the server to save money and just start fresh next time

Coda

Just a quick post to get Swift only up and running quickly!

 
4 Comments

Posted by on February 18, 2013 in devstack, openstack, rackspace

 

4 responses to “Swift Only with OpenStack DevStack on the Rackspace Cloud

  1. sam

    February 19, 2013 at 4:33 pm

    why do you need rabbit

     
    • Everett Toews

      February 19, 2013 at 6:29 pm

      Good question. I included it because stack.sh complains if one of the queues (‘rabbit’, ‘qpid’, ‘zeromq’) isn’t used. But does a Swift and Keystone only deployment really need it? I’m not sure. I’ll have to look into it.

      Update: Turns out Swift/Keystone doesn’t use AMQP so I removed rabbit from the localrc and made a note about it in the steps.

       
  2. Shri Javadekar

    December 19, 2013 at 6:17 pm

    I tried setting up Swift using this. None of Swift dependencies were installed when I ran this. I kept running into database errors. stach.sh kept complaining:

    Access denied for user ‘root’@’localhost’

    I had to unstack, install the mysql db myself using the following.

    sudo apt-get install mysql-server mysql-client mysql-common

    After that, stack.sh completed successfully.

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: