Docker Image

This Docker image provides an easy way to run an OpenIO namespace. It deploys and configure a simple non-replicated namespace in a single container.

OpenIO SDS service discovery and resolution relies on IP addresses, meaning that you can’t change service IPs after they have been registered to the cluster. By default, Docker networking may change you IP when your container restarts, and this is not compatible with OpenIO SDS at the moment.

Deploy

First, download the OpenIO Docker image from the Docker Hub:

pull docker image
docker pull openio/sds:19.10

Start a simple Docker container

run image
docker run openio/sds:19.10
run image and map the oioswift port
docker run -p 6007:6007 openio/sds

Now, you can use the Docker container with the defaults ip address 172.17.0.2, user demo:demo and password DEMO_PASS

Openstack swift

Install the swift client on your docker host and use it like this :

test with the swift client
yum  install python-swiftclient
swift -A http://172.17.0.2:6007/auth/v1.0/ -U demo:demo -K DEMO_PASS stat

AWS

Create configuration files in your home directory like:

~/.aws/credentials
[default]
aws_access_key_id = demo:demo
aws_secret_access_key = DEMO_PASS
~/.aws/config
[default]
region = us-east-1
s3 =
  signature_version = s3v4
  max_concurrent_requests = 20
  max_queue_size = 100
  multipart_threshold = 10GB
  multipart_chunksize = 10MB

And install the AWS client and use it like this :

create bucket with awscli
yum install awscli
aws --endpoint-url http://172.17.0.2:6007 --no-verify-ssl s3 mb s3://bucket1

You can also use a compliant S3 appliance like describe in the integration part.

OpenIO

Use the openio client in the docker instance

create object with openio cli
docker ps
docker exec -it <container_ID> bash
# echo 'Hello OpenIO!' > test.txt
# openio object create MY_OIO_CONTAINER test.txt --oio-account MY_ACCOUNT

Custom your docker instance

Use the host network interface

You can start an instance using Docker host mode networking. This allows you to access services outside your container. You can specify the interface or the IP address you want to use.

Setting the interface

Bind the Docker container to your interface eth0.

use your local interface
docker run -e OPENIO_IFDEV=eth0 --net=host openio/sds

Specifying the IP

Bind the Docker container to your ip local address 192.168.56.101.

use your local address
docker run -e OPENIO_IPADDR=192.168.56.101 --net=host openio/sds

Binding to host port

Bind the Docker container to your ip local address 192.168.56.101 and port 6007.

use your local address and choose the port
docker run -p 192.168.56.101:6007:6007 openio/sds

Change the credentials

Default credentials are demo:demo as user and DEMO_PASS as password.

You can change this default with:

setup your own credentials
docker run -e SWIFT_CREDENTIALS="myproject:myuser:mypassword:.admin" openio/sds

Change the S3 region

Default region is us-east-1

You can change this default with:

change aws region
docker run -e REGION="us-west-1" openio/sds

Increase number of workers

By default, oioswift have only 1 worker.

Use an integer to override this default:

increase worker
docker run -e WORKERS=2 openio/sds

In this example, you will have 2 workers configured in oioswift.

Increase number of meta2

By default, the docker image contains only one service meta2.

You can add additional services meta2 with:

increase worker
docker run -e SUPPL_M2=3 openio/sds

In this example, you will have 4 services meta2 in the container.

Use the API

Before using openio CLI or Python, Java or C API from the outside, copy the contents of /etc/oio/sds.conf.d/OPENIO from the container to the same file on your host.

get namespace configuration
docker exec -it <container_ID> /bin/cat /etc/oio/sds.conf.d/OPENIO > /etc/oio/sds.conf.d/OPENIO

Mount your local storage

The purpose of this image is mainly the POC or the continuous integration. However, it is quite possible to save your data locally.

mount local volume
mkdir accounting metadata-level0 metadata-level1 metadata-level2 data
sudo chown 120:220 accounting metadata-level0 metadata-level1 metadata-level2 data
docker run \
  -v $PWD/metadata-level0:/var/lib/oio/sds/OPENIO/meta0-0 \
  -v $PWD/metadata-level1:/var/lib/oio/sds/OPENIO/meta1-0 \
  -v $PWD/metadata-level2:/var/lib/oio/sds/OPENIO/meta2-0 \
  -v $PWD/accounting:/var/lib/oio/sds/OPENIO/redis-0 \
  -v $PWD/data:/var/lib/oio/sds/OPENIO/rawx-0 \
  openio/sds:19.10