Configure Azure Blob storage

As an alternative to local and network-attached POSIX filesystems, Keepstore can store data in an Azure Storage container.

Create a container

Normally, all keepstore services are configured to share a single Azure Storage container.

Using the Azure web portal or command line tool, create or choose a storage account with a suitable redundancy profile and availability region. Use the storage account keys to create a new container.

~$ azure config mode arm
~$ azure login
~$ azure group create exampleGroupName eastus
~$ azure storage account create --type LRS --location eastus --resource-group exampleGroupName exampleStorageAccountName
~$ azure storage account keys list --resource-group exampleGroupName exampleStorageAccountName
info:    Executing command storage account keys list
+ Getting storage account keys
data:    Primary: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz==
data:    Secondary: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy==
info:    storage account keys list command OK
~$ AZURE_STORAGE_ACCOUNT="exampleStorageAccountName" \
AZURE_STORAGE_ACCESS_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz==" \
azure storage container create exampleContainerName

Configure keepstore

Copy the primary storage account key to a file where it will be accessible to keepstore at startup time.

~$ sudo sh -c 'cat >/etc/sv/keepstore/exampleStorageAccountName.key <<EOF'
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz==
EOF
~$ sudo chmod 0400 /etc/sv/keepstore/exampleStorageAccountName.key

In your keepstore startup script, instead of specifying a local storage using -volume /path or discovering mount points automatically, use -azure-* arguments to specify the storage container:

#!/bin/sh

exec 2>&1
exec keepstore \
 -azure-storage-account-key-file /etc/sv/keepstore/exampleStorageAccountName.key \
 -azure-storage-account-name exampleStorageAccountName \
 -azure-storage-container-volume exampleContainerName

Start (or restart) keepstore, and check its log file to confirm it is using the new configuration.

2015/10/26 21:06:24 Using volume azure-storage-container:"exampleContainerName" (writable=true)

Previous: Install Keepstore servers Next: Install Keepproxy server

The content of this documentation is licensed under the Creative Commons Attribution-Share Alike 3.0 United States licence.
Code samples in this documentation are licensed under the Apache License, Version 2.0.