You may want to make use of Object Storage in your infrastructure. An S3-compatible service can be enabled for your tenant so you can store or retrieve data from buckets stored in the cloud, offered by both ECMWF and EUMETSAT.
Tip |
---|
At the moment the access to this service is not activated by default for every tenant. If you wish to use it, please raise an issue through the Support Portal requesting access to this service. |
You may also use this guide to use any other S3 storage service such as AWS from your instances at the European Weather Cloud. Just adapt the host and credential information accordingly.
Managing your Object Storage with S3cmd
S3cmd is a free command line tool and client for uploading, retrieving and managing data in Amazon S3 and other cloud storage service providers that use the S3 protocol.
The easiest is to install it through the system package manager
No Format |
---|
sudo yum install s3cmd |
Or for Ubuntu:
No Format |
---|
sudo apt install s3cmd |
Alternatively, you may get the latest version from PyPi
You will need to configure s3cmd
before you can use it. The tool will read the configuration on ~/.s3cfg
Create the configuration file if it does not exist:
Edit the file and set up at least the following parameters. You will need to replace <provider>
by either ecmwf
or eumetsat
(your storage provider), as well as <youraccesskey>
and <yoursecretkey>
that will be given to you by the provider
No Format |
---|
host_base = storage.<provider>.europeanweather.cloud
host_bucket =
access_key = <youraccesskey>
secret_key = <yoursecretkey>
use_https = True |
Basic tasks
If you type s3cmd -h
you will see the different options of the command, but here are the basics:
List buckets
Create a bucket
No Format |
---|
s3cmd mb s3://yourbucket |
List bucket contents
No Format |
---|
s3cmd ls s3://yourbucket |
Get data from bucket
No Format |
---|
s3cmd get s3://newbucket/file.txt |
Put data into bucket
No Format |
---|
s3cmd put file.txt s3://newbucket/ |
Remove data from bucket
No Format |
---|
s3cmd rm s3://newbucket/file.txt |
No Format |
---|
s3cmd expiry --expiry-days=14 s3://yourbucket/ |
No Format |
---|
s3cmd info s3://newbucket |
Remove automatic expiry policy
No Format |
---|
s3cmd dellifecycle s3://yourbucket/ |
Mounting your bucket with S3FS via FUSE
You may also mount your bucket to expose the files in your S3 bucket as if they were on a local disk. Generally S3 cannot offer the same performance or semantics as a local file system, but it can be useful for legacy applications that mainly need to read data and expect the files to be in a conventional file system.
S3FS installation
First of all, make sure you have S3FS installed in your VM. On CentOS:
No Format |
---|
sudo yum install epel-release
yum install s3fs-fuse |
On Ubuntu:
No Format |
---|
sudo apt install s3fs |
You need to store your credentials in a file so S3FS can authenticate with the service. You need to replace <youraccesskey>
and <yoursecretkey>
by your actual credentials.
No Format |
---|
echo <youraccesskey>:<yoursecretkey> | sudo tee /root/.passwd-s3fs
sudo chmod 600 /root/.passwd-s3fs |
Setting up an automatic mount
Assuming you want to mount your bucket in /mnt/yourbucket
, here is what you need to do:
No Format |
---|
sudo mkdir /mnt/yourbucket
echo "s3fs#yourbucket /mnt/yourbucket fuse _netdev,allow_other,nodev,nosuid,uid=$(id -u),gid=$(id -g),use_path_request_style,url=https://storage.<provider>.europeanweather.cloud 0 0" | sudo tee -a /etc/fstab
sudo mount -a |
Again, you must replace <provider>
by the ecmwf
or eumetsat
, and you may customise other mount options if you wish to do so. At this point you should have your bucket mounted and ready to use.
Related articles
Content by Label |
---|
showLabels | false |
---|
max | 5 |
---|
spaces | EWCLOUDKB |
---|
showSpace | false |
---|
sort | modified |
---|
reverse | true |
---|
type | page |
---|
cql | label in ("s3","bucket","storage","ceph") and type = "page" and space = "EWCLOUDKB" |
---|
labels | ceph s3 bucket storage |
---|
|