Using Keep with Azure Storage » History » Version 1
Tom Clegg, 10/01/2015 07:51 PM
| 1 | 1 | Tom Clegg | h1. Using Keep with Azure Storage (BETA) |
|---|---|---|---|
| 2 | |||
| 3 | Starting at #7241 keepstore can use Azure Storage containers as storage devices. Each data block is stored as a "Block Blob". |
||
| 4 | |||
| 5 | Features: |
||
| 6 | * You can configure multiple Azure volumes |
||
| 7 | * You can mix Azure and POSIX volumes |
||
| 8 | * It is safe to share Azure volumes between multiple keepstore processes/hosts |
||
| 9 | * Azure volumes can be marked readonly |
||
| 10 | |||
| 11 | Missing features: |
||
| 12 | * The @-serialize@ flag is not supported |
||
| 13 | * There is no way to control the way the data is organized (named) in the container. The name of each blob is the hash of the corresponding data, e.g., @73feffa4b7f6bb68e44cf984c85f6e88@. |
||
| 14 | |||
| 15 | h2. Setup |
||
| 16 | |||
| 17 | Outline: |
||
| 18 | # Install the azure CLI tool. |
||
| 19 | # Set credentials. |
||
| 20 | @azure login@ |
||
| 21 | # Set cli tool mode. |
||
| 22 | @azure config mode arm@ |
||
| 23 | # Create a resource group (unless you're going to use an existing one, of course). |
||
| 24 | @azure group create examplegroupname eastus@ |
||
| 25 | # Create a storage account (ditto). The @--type@ argument determines storage replication policy; see "docs":https://azure.microsoft.com/en-us/documentation/articles/storage-introduction/#replication-for-durability-and-high-availability |
||
| 26 | @azure storage account create --type LRS --location eastus --resource-group examplegroupname exampleaccountname@ |
||
| 27 | # Get storage account keys: |
||
| 28 | @azure storage account keys list --resource-group examplegroupname exampleaccountname@ |
||
| 29 | (This will give you a base64-encoded key looking something like @t3wfMAZ4/YBso7Jr5dtaR7gdrSJmdqzIv1iLofr/2xkZLqLwjj3iwV1YNYbjPUhewXYpp6KxmJUH9L3cfLALtw==@) |
||
| 30 | # Create a container: |
||
| 31 | @AZURE_STORAGE_ACCOUNT=exampleaccountname \@ |
||
| 32 | @AZURE_STORAGE_ACCESS_KEY="t3wfMAZ4/YBso7Jr5dtaR7gdrSJmdqzIv1iLofr/2xkZLqLwjj3iwV1YNYbjPUhewXYpp6KxmJUH9L3cfLALtw==" \@ |
||
| 33 | @azure storage container create examplecontainername@ |
||
| 34 | |||
| 35 | h2. Configuring keepstore |
||
| 36 | |||
| 37 | Store the account key in a file with suitable permissions. (A trailing newline will be ignored, but don't put any other characters in there.) |
||
| 38 | |||
| 39 | <pre> |
||
| 40 | cd /etc/sv/keepstore |
||
| 41 | (umask 077; vi exampleaccountname.key) |
||
| 42 | </pre> |
||
| 43 | |||
| 44 | Update your run script. If you have an existing local volume, your run script might have this: |
||
| 45 | |||
| 46 | <pre> |
||
| 47 | keepstore \ |
||
| 48 | -volume /data/disk0 -volume /data/disk1 |
||
| 49 | </pre> |
||
| 50 | |||
| 51 | If you want to change your local volumes to be readonly, and use the azure container to write new data, you'd change it to this: |
||
| 52 | |||
| 53 | <pre> |
||
| 54 | keepstore \ |
||
| 55 | -readonly \ |
||
| 56 | -volume /data/disk0 -volume /data/disk1 \ |
||
| 57 | -readonly=false \ |
||
| 58 | -azure-storage-account-key-file ./exampleaccountname.key |
||
| 59 | -azure-storage-account-name exampleaccountname \ |
||
| 60 | -azure-storage-container-volume examplecontainername |
||
| 61 | </pre> |