aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/swift-guide.rst72
1 files changed, 55 insertions, 17 deletions
diff --git a/doc/swift-guide.rst b/doc/swift-guide.rst
index bf50c770b..c159b0536 100644
--- a/doc/swift-guide.rst
+++ b/doc/swift-guide.rst
@@ -7,19 +7,51 @@ Kolla can deploy a full working Swift setup in either a AIO or multi node setup.
Prerequisites
-------------
-Before running Swift we need to generate "rings", which are binary compressed files that at a high
-level let the various Swift services know where data is in the cluster. We hope to automate this
-process in a future release.
+Before running Swift we need to generate "rings", which are binary compressed
+files that at a high level let the various Swift services know where data is in
+the cluster. We hope to automate this process in a future release.
-Swift also expects block devices to be available and partitioned on the host, which Swift uses in
-combination with the rings to store data. Swift demos commonly just use directories created under
-/srv/node to simulate these devices. In order to ease "out of the box" testing of Kolla, we offer a
-similar setup with a data container. *Note*, data containers are very inefficient for this purpose.
-In production setups operators will want to provision disks according to the Swift operator guide,
-which can then be added the rings and used in Kolla.
+disks with partition table (recommended)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-For an AIO setup, the following commands can be used, locally, to generate rings containing the data
-container directories:
+Swift also expects block devices to be available for storage. To prepare a disk
+for use as Swift storage device, a special partition name and filesystem label
+need to be added. So that Kolla can detect those disks and mount for services.
+
+Follow the example below to add 3 disks for an AIO demo setup.
+
+::
+
+ # <WARNING ALL DATA ON DISK will be LOST!>
+ index=0
+ for d in sdc sdd sde; do
+ parted /dev/${d} -s -- mklabel gpt mkpart KOLLA_SWIFT_DATA 1 -1
+ sudo mkfs.xfs -f -L d${index} /dev/${d}1
+ (( index++ ))
+ done
+
+disks without partition table
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Kolla also supports unpartitioned disk (filesystem on /dev/sdc instead of
+/dev/sdc1) detection purely based on filesystem label. This is generally not a
+recommended practice but can be helpful for Kolla to take over Swift deployment
+already using disk like this.
+
+Given hard disks with labels swd1, swd2, swd3, use the following settings in
+ansible/roles/swift/defaults/main.yml
+
+::
+
+ swift_devices_match_mode: "prefix"
+ swift_devices_name: "swd"
+
+rings
+~~~~~
+
+Run following commands locally to generate Rings for AIO demo setup. The
+commands work with "disks with partition table" example listed above. Please
+modify accordingly if your setup is different.
::
@@ -33,11 +65,11 @@ container directories:
kollaglue/${KOLLA_BASE_DISTRO}-${KOLLA_INSTALL_TYPE}-swift-base \
swift-ring-builder /etc/kolla/config/swift/object.builder create 10 3 1
- for partition in sdb1 sdb2 sdb3; do
+ for i in {0..2}; do
docker run \
-v /etc/kolla/config/swift/:/etc/kolla/config/swift/ \
kollaglue/${KOLLA_BASE_DISTRO}-${KOLLA_INSTALL_TYPE}-swift-base swift-ring-builder \
- /etc/kolla/config/swift/object.builder add z1-${KOLLA_INTERNAL_ADDRESS}:6000/${partition} 1;
+ /etc/kolla/config/swift/object.builder add r1z1-${KOLLA_INTERNAL_ADDRESS}:6000/d${i} 1;
done
# Account ring
@@ -46,11 +78,11 @@ container directories:
kollaglue/${KOLLA_BASE_DISTRO}-${KOLLA_INSTALL_TYPE}-swift-base \
swift-ring-builder /etc/kolla/config/swift/account.builder create 10 3 1
- for partition in sdb1 sdb2 sdb3; do
+ for i in {0..2}; do
docker run \
-v /etc/kolla/config/swift/:/etc/kolla/config/swift/ \
kollaglue/${KOLLA_BASE_DISTRO}-${KOLLA_INSTALL_TYPE}-swift-base swift-ring-builder \
- /etc/kolla/config/swift/account.builder add z1-${KOLLA_INTERNAL_ADDRESS}:6001/${partition} 1;
+ /etc/kolla/config/swift/account.builder add r1z1-${KOLLA_INTERNAL_ADDRESS}:6001/d${i} 1;
done
# Container ring
@@ -59,11 +91,11 @@ container directories:
kollaglue/${KOLLA_BASE_DISTRO}-${KOLLA_INSTALL_TYPE}-swift-base \
swift-ring-builder /etc/kolla/config/swift/container.builder create 10 3 1
- for partition in sdb1 sdb2 sdb3; do
+ for i in {0..2}; do
docker run \
-v /etc/kolla/config/swift/:/etc/kolla/config/swift/ \
kollaglue/${KOLLA_BASE_DISTRO}-${KOLLA_INSTALL_TYPE}-swift-base swift-ring-builder \
- /etc/kolla/config/swift/container.builder add z1-${KOLLA_INTERNAL_ADDRESS}:6002/${partition} 1;
+ /etc/kolla/config/swift/container.builder add r1z1-${KOLLA_INTERNAL_ADDRESS}:6002/d${i} 1;
done
for ring in object account container; do
@@ -81,6 +113,12 @@ http://docs.openstack.org/kilo/install-guide/install/apt/content/swift-initial-r
Deploying
---------
+Enable Swift in /etc/kolla/globals.yml:
+
+::
+
+ enable_swift : "yes"
+
Once the rings are in place, deploying Swift is the same as any other Kolla Ansible service. Below
is the minimal command to bring up Swift AIO, and it's dependencies: