From: Colin Watson Date: Fri, 18 Jan 2019 11:47:17 +0000 (+0000) Subject: Make Swift deployment more compact X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=772fc923c73d554884ec3b3e09bb18e0c2ac8467;p=blog.git Make Swift deployment more compact --- diff --git a/content/deploying-swift.md b/content/deploying-swift.md index fd4be7c0..0a1546e1 100644 --- a/content/deploying-swift.md +++ b/content/deploying-swift.md @@ -94,11 +94,13 @@ Now we can start deploying things! Save this to a file, e.g. swift-storage: charm: "cs:swift-storage" num_units: 1 + to: [keystone] options: block-device: "/etc/swift/storage.img|5G" swift-proxy: charm: "cs:swift-proxy" num_units: 1 + to: [mysql] options: zone-assignment: auto replicas: 1 @@ -129,20 +131,21 @@ should look something like this: Unit Workload Agent Machine Public address Ports Message keystone/0* active idle 0 10.36.63.133 5000/tcp Unit is ready mysql/0* active idle 1 10.36.63.44 3306/tcp Ready - swift-proxy/0* active idle 2 10.36.63.75 8080/tcp Unit is ready - swift-storage/0* active idle 3 10.36.63.115 Unit is ready + swift-proxy/0* active idle 1 10.36.63.44 8080/tcp Unit is ready + swift-storage/0* active idle 0 10.36.63.133 Unit is ready Machine State DNS Inst id Series AZ Message 0 started 10.36.63.133 juju-d3e703-0 bionic Running 1 started 10.36.63.44 juju-d3e703-1 bionic Running - 2 started 10.36.63.75 juju-d3e703-2 bionic Running - 3 started 10.36.63.115 juju-d3e703-3 bionic Running At this point you have what should be a working installation, but with only administrative privileges set up. Normally you want to create at least one normal user. To do this, start by creating a configuration file granting administrator privileges (this one comes verbatim from the [openstack-base -bundle](https://api.jujucharms.com/charmstore/v5/openstack-base/archive/openrc)): +bundle](https://api.jujucharms.com/charmstore/v5/openstack-base/archive/openrc), +though with one +[change](https://github.com/openstack-charmers/openstack-charm-testing/commit/720a55eb629653bd78194a0cfbc21864406252d7#diff-291a64b96dd1baf50cca0b4c158a47b2) +that isn't yet in the charm store version at the time of writing): :::sh _OS_PARAMS=$(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' ') @@ -154,7 +157,7 @@ bundle](https://api.jujucharms.com/charmstore/v5/openstack-base/archive/openrc)) unset _OS_PARAMS _keystone_unit=$(juju status keystone --format yaml | \ - awk '/units:$/ {getline; gsub(/:$/, ""); print $1}') + awk '/units:$/ {getline; gsub(/:$/, ""); print $1; exit}') _keystone_ip=$(juju run --unit ${_keystone_unit} 'unit-get private-address') _password=$(juju run --unit ${_keystone_unit} 'leader-get admin_passwd') @@ -230,3 +233,6 @@ to detach it; `juju destroy-model` should then be able to proceed. Credit to the Juju and LXD teams and to the maintainers of the various charms used here, as well as of course to the OpenStack folks: their work made it very much easier to put this together. + +*2019-01-18: Edited to deploy to two containers rather than four, and to +incorporate a `~/.swiftrc.juju-admin` change to cope with that.*