25/06/2018 |

How to Create a Single-Node OpenIO SDS Object Store

The other day one of our partners asked if he could have a single Linux virtual machine running OpenIO SDS for functionality tests, so I wanted to be sure to have this option available to everybody.

We already have several methods to test OpenIO SDS:

Today we are adding a fifth option: a single (virtualized) x86 node, which is similar to the Raspberry Pi single-node image, but on x86. The goal is to have a fully functional OpenIO SDS instance in a VM that you can run on your laptop with tools like VirtualBox, or in a datacenter in a VMware environment. The main difference between this installation and the Docker container is that the data and configurations are persistent after reboots. This configuration also works for a single physical node.

Let's do it!

How to size an OpenIO cluster on x86 servers

For this tutorial, I used Ubuntu 16.04 Server (here is a link to the ISO); be sure to use the 64-bit version

of Linux, because Keystone (the OpenStack Identity Service) packages are 64-bit only. My VM has 2GB RAM and 20GB disk space (you could do this with 1GB and 10GB but more is better in these cases).

After completing the OS installation, there are two steps you need to take to complete SDS installation. First you install SDS core, then you add Swift and Keystone. I left them separate because you could also decide to perform a split configuration in the future with the front-end and the storage on two different hosts. In fact, as you may already know, OpenIO SDS is very flexible and  supports a number of different cluster layouts.

Installing OpenIO SDS

Before proceeding with the OpenIO SDS installation, make sure that your system is fully updated with:

# sudo apt-get update
# sudo apt-get upgrade -y

# sudo reboot

 

Then add OpenIO SDS repository:

#echo "deb http://mirror.openio.io/pub/repo/openio/sds/17.04/$(lsb_release -i -s)/ $(lsb_release -c -s)/" | sudo tee /etc/apt/sources.list.d/openio-sds.list

#sudo apt-get install curl -y

# curl http://mirror.openio.io/pub/repo/openio/APT-GPG-KEY-OPENIO-0 | sudo apt-key add -

# sudo apt-get update; sudo apt-get install puppet-module-openio-openiosds -y

 

It is now time to install OpenIO SDS for real. Create a file with the name ˜/openio.pp and copy the following lines into it:

# Default ipaddress to use

$ipaddr = $ipaddress
# Comma separated list of 'project:user:passwd:privileges'
$default_tempauth_users = ['demo:demo:DEMO_PASS:.admin']

# Deploy a single node
class{'openiosds':}
openiosds::namespace {'OPENIO':
ns => 'OPENIO',
conscience_url => "${ipaddr}:6000",
oioproxy_url => "${ipaddr}:6006",
eventagent_url => "beanstalk://${ipaddr}:6014",
meta1_digits => 0,
}
openiosds::account {'account-0':
ns => 'OPENIO',
ipaddress => $ipaddr,
redis_host => $ipaddr,
}
openiosds::conscience {'conscience-0':
ns => 'OPENIO',
ipaddress => $ipaddr,
}
openiosds::meta0 {'meta0-0':
ns => 'OPENIO',
ipaddress => $ipaddr,
}
openiosds::meta1 {'meta1-0':
ns => 'OPENIO',
ipaddress => $ipaddr,
}
openiosds::meta2 {'meta2-0':
ns => 'OPENIO',
ipaddress => $ipaddr,
}
openiosds::rawx {'rawx-0':
ns => 'OPENIO',
ipaddress => $ipaddr,
}
openiosds::rdir {'rdir-0':
ns => 'OPENIO',
ipaddress => $ipaddr,
location => "${hostname}-other",
}
openiosds::oioblobindexer {'oio-blob-indexer-rawx-0':
ns => 'OPENIO',
}
openiosds::oioeventagent {'oio-event-agent-0':
ns => 'OPENIO',
ipaddress => $ipaddr,
}
openiosds::oioproxy {'oioproxy-0':
ns => 'OPENIO',
ipaddress => $ipaddr,
}
openiosds::redis {'redis-0':
ns => 'OPENIO',
ipaddress => $ipaddr,
}
openiosds::conscienceagent {'conscienceagent-0':
ns => 'OPENIO',
}
openiosds::beanstalkd {'beanstalkd-0':
ns => 'OPENIO',
ipaddress => $ipaddr,
}

 

You can change the $ipaddess variable if you have more than one IP configured on your system, and you can also change the default demo user and password if you wish.

Run the installation with this command:

# sudo puppet apply --no-stringify_facts ~/openio.pp

This takes a few minutes to complete, depending on your internet bandwidth, because it downloads and installs packages.

 

And after the usual message blurting you can stop and disable unnecessary services:

# sudo systemctl stop apache2 redis beanstalkd puppet
# sudo systemctl disable apache2 redis beanstalkd puppet

 

OpenIO SDS is ready, but not yet initialized. The following commands will unlock the namespace, bootstrap the directory, restart the necessary services, and assign the rawx to a rdir.

# openio --oio-ns=OPENIO cluster unlockall
# openio --oio-ns=OPENIO directory bootstrap --no-rdir
# sudo gridinit_cmd restart @meta0 @meta1
# openio --oio-ns=OPENIO cluster unlockall
# openio --oio-ns=OPENIO volume admin bootstrap

 

To check that everything is correct, all scores must be higher than 0; run this command: à

#openio --oio-ns OPENIO cluster list

 

That was easy, wasn't it? And now, the access layer.

Installing Swift and Keystone

There are a few preliminary operations required to install these elements. Installing the OpenStack repository and packages are the first (and do not make the mistake I did; all these commands must be run as root. This is why the 'sudo bash' command is at the beginning):

#sudo bash
#add-apt-repository cloud-archive:pike -y
#apt-get update
#curl -L https://github.com/openstack/puppet-keystone/archive/stable/pike.tar.gz | tar xzf - -C /etc/puppet/modules/ ; mv /etc/puppet/modules/puppet-keystone-stable-pike /etc/puppet/modules/keystone
#curl -L https://github.com/openstack/puppet-openstacklib/archive/stable/pike.tar.gz | tar xzf - -C /etc/puppet/modules/ ; mv /etc/puppet/modules/puppet-openstacklib-stable-pike /etc/puppet/modules/openstacklib
#curl -L https://github.com/openstack/puppet-oslo/archive/stable/pike.tar.gz | tar xzf - -C /etc/puppet/modules/ ; mv /etc/puppet/modules/puppet-oslo-stable-pike /etc/puppet/modules/oslo
#for module in puppetlabs/apache puppetlabs/inifile puppetlabs/stdlib ; do puppet module install $module ; done

 

Now it is time to prepare the puppet manifest. To do so, just put the following lines in a file called ˜/swift.pp:

# openio_proxy_url = "http://OPENIO_PROXY_URL:6006"
# admin_token = 'KEYSTONE_ADMIN_UUID'
# swift_passwd = 'SWIFT_PASS'
# admin_passwd = 'ADMIN_PASS'
# demo_passwd = 'DEMO_PASS'
# region = 'RegionOne'

# Deploy Openstack Keystone
class { 'keystone':
admin_token => $admin_token,
admin_password => $admin_passwd,
database_connection => 'sqlite:////var/lib/keystone/keystone.db',
service_name => 'httpd',
}

# Use Apache httpd service with mod_wsgi
class { 'keystone::wsgi::apache':
ssl => false,
}

# Adds the admin credential to keystone.
class { 'keystone::roles::admin':
email => 'test@openio.io',
password => $admin_passwd,
admin => 'admin',
admin_tenant => 'admin',
admin_user_domain => 'admin',
admin_project_domain => 'admin',
}

# Installs the service user endpoint.
class { 'keystone::endpoint':
public_url => "http://${ipaddress}:5000",
admin_url => "http://${ipaddress}:35357",
internal_url => "http://${ipaddress}:5000",
region => $region,
}

# Openstack Swift service credentials
keystone_user { 'swift':
ensure => present,
enabled => true,
password => $swift_passwd,
}
keystone_user_role { 'swift@services':
roles => ['admin'],
ensure => present
}
keystone_service { 'openio-swift':
ensure => present,
type => 'object-store',
description => 'OpenIO SDS swift proxy',
}
keystone_endpoint { 'localhost-1/openio-swift':
ensure => present,
type => 'object-store',
public_url => "http://${ipaddress}:6007/v1.0/AUTH_%(tenant_id)s",
admin_url => "http://${ipaddress}:6007/v1.0/AUTH_%(tenant_id)s",
internal_url => "http://${ipaddress}:6007/v1.0/AUTH_%(tenant_id)s",
}

# Demo account credentials
keystone_tenant { 'demo':
ensure => present,
enabled => true,
}
keystone_user { 'demo':
ensure => present,
enabled => true,
password => $demo_passwd,
}
keystone_role { '_member_':
ensure => present,
}
keystone_user_role { 'demo@demo':
roles => ['admin','_member_'],
ensure => present
}

# Deploy OpenIO Swift/S3 gateway
class {'openiosds':}
openiosds::namespace {'OPENIO':
ns => 'OPENIO',
}
openiosds::oioswift {'oioswift-0':
ns => 'OPENIO',
ipaddress => '0.0.0.0',
sds_proxy_url => $openio_proxy_url,
password => $swift_passwd,
memcache_servers => "${ipaddress}:6019",
region_name => $region,
middleware_swift3 => {'location' => $region},
project_name => 'services',
}
openiosds::memcached {'memcached-0':
ns => 'OPENIO',
}

Apply the manifest and wait a few minutes for the operations to complete:

# puppet apply --no-stringify_facts ~/swift.pp

It's time to test it!

It is time to see if everything went as it should. This will take just a couple of minutes.

Install the Swift CLI:

# apt-get install -y python-swiftclient

Create the credentials for the demo user:

# cat <<EOF >> ~/.demo_keystonerc
export OS_IDENTITY_API_VERSION="3"
export OS_AUTH_URL="http://127.0.0.1:5000/v3"
export OS_USER_DOMAIN_ID="default"
export OS_PROJECT_DOMAIN_ID="default"
export OS_PROJECT_NAME="demo"
export OS_USERNAME="demo"
export OS_PASSWORD="DEMO_PASS"
EOF

And run these two commands:

# source ~/.demo_keystonerc
# swift stat 

This is the output you should see:

# swift stat
    Account: AUTH_908fa1a46c8d44ae8db4580305b1cd9c
    Containers: 0
    Objects: 0
    Bytes: 0
    X-Timestamp: 1518478586.21649
    X-Trans-Id: tx79ef74dbaf9940d0ac876-005a8224fa
    Content-Type: text/plain; charset=utf-8
    X-Openstack-Request-Id: tx79ef74dbaf9940d0ac876-005a8224fa

Done!

For any doubt or further indications, feel free to join our community on Slack.

Final Note

OpenIO SDS was installed in less than 15 minutes, this time in a single VM. It needs very few resources to run and is ready for any sort of functionality test you want to run. What are you waiting for? It’s time to try it out!

The Docker container is lighter and good for API compatibility testing, but if you need a long-lasting solution with permanent storage, this is a better option.

Play around with OpenIO SDS and get a chance to win a Raspberry PI kit from OpenIO. It's easy; contribute articles like this one or test applications and third-party solutions against our object store, and share them with our community. We will send the kits to the most interesting contributions.

How to size an OpenIO cluster on x86 servers

COMMENTS