In my previous articles, i have explained how to mount the Object Storage Bucket as a File System on Flexible Engine’s ECS Instances.
What is Object Storage
Object Storage allows you to store a large amount of unstructured data in a highly scalable manner using REST APIs.
The benefits behind using such service are :
Durability : data is kept safe on the cloud.
Availability : data is available and accessible remotely through REST APIs.
Scalability : such service is meant to store large amount of data.
Security : data can be encrypted when stored and while it is in transit.
Object Storage Use Cases :
- Backups : storage for backup files, database dumps, and log files.
Setting up the Swift S3 API
First, you need to get your
openrc.sh file from your OVH platform. Then, you need to install the aws client :
sudo apt-get update
sudo apt-get upgrade
pip3 install awscli awscli-plugin-endpoint
sudo apt-get install awscli
Next, you need to configure the aws client :
sudo mkdir .awsnano .aws/config
Based on the configuration described in the
openrc.sh file , add the following lines in the config file :
[plugins]endpoint = awscli_plugin_endpoint[profile default]aws_access_key_id = put-here-access-keyaws_secret_access_key = put-here-secret-keyregion = gra (put-here-your-region, gra is just an example)s3 =endpoint_url = https://s3.gra.cloud.ovh.netsignature_version = s3v4addressing_style = virtuals3api =endpoint_url = https://s3.gra.cloud.ovh.net
Once done, you can :
- List your available buckets:
aws --profile default s3 ls
- Create a bucket:
aws --profile default s3 mb s3://bucket
Note : S3 no longer supports creating bucket names that contain uppercase letters or underscores.
- Upload a local file to bucket:
cd .awsnano file.textaws --profile default s3 cp file.txt s3://bucket/file.txt
- Download an object from bucket :
aws --profile default s3 cp s3://bucket/file.txt file.txt
- Delete the object from bucket :
aws --profile default s3 rm s3://bucket/file.txt
- Delete bucket :
aws --profile default s3 rb s3://bucket
Now, in order to mount the created OVH bucket as a file system, follow the steps described in my previous article : s3fs-fuse project.
url , make sure to use
https://s3.gra.cloud.ovh.net that we’ve configured previously for the aws client. (as described before, replace
grawith your corresponding region).