summaryrefslogtreecommitdiffstats
path: root/ufo/bin/gluster-swift-gen-builders
diff options
context:
space:
mode:
authorMohammed Junaid <junaid@redhat.com>2013-02-07 07:42:34 +0530
committerPeter Portante <peter.portante@redhat.com>2013-04-29 16:35:57 -0400
commit55389b74c7a50d162ef95e07a562575e78e9b888 (patch)
tree8259c1ae20807269ed254078c34d9056e83cd9bf /ufo/bin/gluster-swift-gen-builders
parentcfb17e86592890701b9b18cfef35503f564df79c (diff)
object-storage: Restoring multi volume support in UFO.
* Currently, the users of UFO are restricted to use just one volume at any given point of time. This patch removes this limitation. * The usage of gluster-swift-gen-builders has also changed. With this commit the users should mention the list of volumes that they want to expose through UFO. So, only the volumes mentioned during the ring file generation can be accessed. Usage: gluster-swift-gen-builders <vol-name1> [<vol-name2>]... This is an intermediate fix until we remove the account, container and object server processes. Once we have this frame work running, it will completely eliminate the ring files. Change-Id: I9ad3808519fec9c7c60ad846c4f8b653117a8337 BUG: 909053 Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.org/4485 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Peter Portante <pportant@redhat.com>
Diffstat (limited to 'ufo/bin/gluster-swift-gen-builders')
-rwxr-xr-xufo/bin/gluster-swift-gen-builders39
1 files changed, 32 insertions, 7 deletions
diff --git a/ufo/bin/gluster-swift-gen-builders b/ufo/bin/gluster-swift-gen-builders
index b89cd15..37ed50d 100755
--- a/ufo/bin/gluster-swift-gen-builders
+++ b/ufo/bin/gluster-swift-gen-builders
@@ -1,9 +1,25 @@
#!/bin/bash
+# Note that these port numbers must match the configured values for the
+# various servers in their configuration files.
+declare -A port=(["account.builder"]=6012 ["container.builder"]=6011 \
+ ["object.builder"]=6010)
+
+builder_files="account.builder container.builder object.builder"
+
function create {
- swift-ring-builder $1 create 0 1 1
- swift-ring-builder $1 add z1-127.0.0.1:$2/$3_ 100.0
+ swift-ring-builder $1 create 1 1 1 >> /tmp/out
+}
+
+function add {
+ swift-ring-builder $1 add z$2-127.0.0.1:$3/$4_ 100.0
+}
+
+function rebalance {
swift-ring-builder $1 rebalance
+}
+
+function build {
swift-ring-builder $1
}
@@ -12,8 +28,17 @@ if [ "$1x" = "x" ]; then
exit 1
fi
-# Note that these port numbers must match the configured values for the
-# various servers in their configuration files.
-create account.builder 6012 $1
-create container.builder 6011 $1
-create object.builder 6010 $1
+for builder_file in $builder_files
+do
+ create $builder_file
+
+ zone=1
+ for volname in $@
+ do
+ add $builder_file $zone ${port[$builder_file]} $volname
+ zone=$(expr $zone + 1)
+ done
+
+ rebalance $builder_file
+ build $builder_file
+done