layout | title | categories | author | lang |
---|---|---|---|---|
post |
How to synchronize RunAbove container to OVH Public Cloud? |
Object-Storage |
pilgrimstack |
en |
Swift provides a very simple way to synchronize different containers even if the source and the destination are not in the same infrastructure. That is our case here with RunAbove Object Storage and OVH Public Cloud.
A job runs on the RunAbove Swift server. It will replicate all write transactions in the container on RunAbove to an other on OVH Public Cloud.
- Python installed on your computer (https://www.python.org/
- Openstack swift client (https://github.com/openstack/python-swiftclient or curl (Unix)
The authentication will be done by using a shared key.
The source container should have two specials metadata:
- X-Container-Sync-To: the destination of the container on the other infrastructure
- X-Container-Sync-Key: the shared key between containers
The destination container should have one special metadata:
- X-Container-Sync-Key: the shared key between containers
Assuming you have sourced your environnement with OVH Public Cloud credentials, you have to add the key to the destiantion container.
Then you have to get the public address of this container.
Now you can tell to the source container which destination it should pushed the data with the shared key.
Start by sourcing the RunAbove credentials, then:
On the destination:
-X POST -H "X-Container-Sync-Key: $sharedKey" -H "Content-Length: 0"
-H "X-Auth-Token: abcd1234"
On the source:
-X POST -H "X-Container-Sync-Key: $sharedKey" -H "Content-Length: 0"
-H "X-Auth-Token: abcd1234"
-H "X-Container-Sync-To: https://storage.sbg1.cloud.ovh.net/v1/AUTH_YYYYYYYYY/myContainer"
This synchronization between two containers is a very good way to migrate data from one infrastructure to another without any service interruption. If you want, you can use it for any others reasons : share objects between openstack users, replicate your data between two geographical and separate infras...