From bf95283927f2d58ce3203dd2c97e080d29a8c5b4 Mon Sep 17 00:00:00 2001 From: Paul Bourke Date: Tue, 11 Jul 2017 11:44:11 +0100 Subject: [PATCH] Improve Swift ring setup sample script The sample script provided in the docs to configure rings should add each storage node the ring, not the control node pointed to by the vip. Change-Id: I28ad60eb3c07f5da0e04e7780c41a7eed158b6d5 --- doc/swift-guide.rst | 52 +++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/doc/swift-guide.rst b/doc/swift-guide.rst index ea2c081752..ebc6a4adf0 100644 --- a/doc/swift-guide.rst +++ b/doc/swift-guide.rst @@ -73,8 +73,8 @@ different. :: - export KOLLA_INTERNAL_ADDRESS=1.2.3.4 - export KOLLA_SWIFT_BASE_IMAGE="kolla/oraclelinux-source-swift-base:4.0.0" + STORAGE_NODES=(192.168.0.2 192.168.0.3 192.168.0.4) + KOLLA_SWIFT_BASE_IMAGE="kolla/oraclelinux-source-swift-base:4.0.0" mkdir -p /etc/kolla/config/swift @@ -86,13 +86,15 @@ different. swift-ring-builder \ /etc/kolla/config/swift/object.builder create 10 3 1 - for i in {0..2}; do - docker run \ - --rm \ - -v /etc/kolla/config/swift/:/etc/kolla/config/swift/ \ - $KOLLA_SWIFT_BASE_IMAGE \ - swift-ring-builder \ - /etc/kolla/config/swift/object.builder add r1z1-${KOLLA_INTERNAL_ADDRESS}:6000/d${i} 1; + for node in ${STORAGE_NODES[@]}; do + for i in {0..2}; do + docker run \ + --rm \ + -v /etc/kolla/config/swift/:/etc/kolla/config/swift/ \ + $KOLLA_SWIFT_BASE_IMAGE \ + swift-ring-builder \ + /etc/kolla/config/swift/object.builder add r1z1-${node}:6000/d${i} 1; + done done # Account ring @@ -103,13 +105,15 @@ different. swift-ring-builder \ /etc/kolla/config/swift/account.builder create 10 3 1 - for i in {0..2}; do - docker run \ - --rm \ - -v /etc/kolla/config/swift/:/etc/kolla/config/swift/ \ - $KOLLA_SWIFT_BASE_IMAGE \ - swift-ring-builder \ - /etc/kolla/config/swift/account.builder add r1z1-${KOLLA_INTERNAL_ADDRESS}:6001/d${i} 1; + for node in ${STORAGE_NODES[@]}; do + for i in {0..2}; do + docker run \ + --rm \ + -v /etc/kolla/config/swift/:/etc/kolla/config/swift/ \ + $KOLLA_SWIFT_BASE_IMAGE \ + swift-ring-builder \ + /etc/kolla/config/swift/account.builder add r1z1-${node}:6001/d${i} 1; + done done # Container ring @@ -120,13 +124,15 @@ different. swift-ring-builder \ /etc/kolla/config/swift/container.builder create 10 3 1 - for i in {0..2}; do - docker run \ - --rm \ - -v /etc/kolla/config/swift/:/etc/kolla/config/swift/ \ - $KOLLA_SWIFT_BASE_IMAGE \ - swift-ring-builder \ - /etc/kolla/config/swift/container.builder add r1z1-${KOLLA_INTERNAL_ADDRESS}:6002/d${i} 1; + for node in ${STORAGE_NODES[@]}; do + for i in {0..2}; do + docker run \ + --rm \ + -v /etc/kolla/config/swift/:/etc/kolla/config/swift/ \ + $KOLLA_SWIFT_BASE_IMAGE \ + swift-ring-builder \ + /etc/kolla/config/swift/container.builder add r1z1-${node}:6002/d${i} 1; + done done for ring in object account container; do