From e8d95655d5e73462723799d20e59bc4f21bdf973 Mon Sep 17 00:00:00 2001 From: Peter Portante Date: Wed, 7 Nov 2012 12:37:26 -0500 Subject: object-storage: refactor to use swift devices Refactor code to use the devices configuration file setting for account, container, and object servers, dropping mount_path from the fs.conf file, and constructing new account, container and object server rings. This removes the next to last set of diffs in the swift diff file. See BZ 870589 (https://bugzilla.redhat.com/show_bug.cgi?id=870589). The key to the change is the dropping of the pre-built account, container and object rings, instead providing a script that will generate them for the user given the gluster volume name in use. In addition, we override the Swift check_mount() method and replace it with Gluster's which attempts to "auto-mount" if it is not already mounted. The following is an enumeration of the changes contained in this refactoring: * The refactoring to override the Swift check_mount() involved condensing a lot of code, removing redundancies and simplifying methods across a number of modules * Drop checking the mount point in the low level DiskDir, DiskAccount and DiskFile objects now that Swift's normal mount checking is used, and enable it by default in the template configuration file * Add missing get_container_timestamp() method for DiskAccount objects * Fix the plugin RPM spec file to provide the new ring builders, and while we were at it, finally fix the over-writing of the configuration files on install * Bug fixes * The monkey patched version of check_object_creation was not working correctly due to a missing import of HTTPBadRequest and a bad reference to validate_obj_name_component() * Only have the utils module import the plugins constraints module for the side effect of monkey patching if gluster is enabled * Removed the db_file.db file in the tree since it is created on the fly * Updated 2011 copyright notices to 2012 Change-Id: I8f4454576b1423021c9bbf3c36176f8db51e62c0 BUG: 870589 Signed-off-by: Peter Portante Reviewed-on: http://review.gluster.org/4179 Reviewed-by: Pete Zaitcev Reviewed-by: Kaleb KEITHLEY Tested-by: Kaleb KEITHLEY Reviewed-by: Mohammed Junaid --- swift/1.4.8/plugins/conf/account-server/1.conf-gluster | 6 +++--- swift/1.4.8/plugins/conf/account.builder | Bin 786843 -> 0 bytes swift/1.4.8/plugins/conf/account.ring.gz | Bin 739 -> 0 bytes .../1.4.8/plugins/conf/container-server/1.conf-gluster | 6 +++--- swift/1.4.8/plugins/conf/container.builder | Bin 786843 -> 0 bytes swift/1.4.8/plugins/conf/container.ring.gz | Bin 741 -> 0 bytes swift/1.4.8/plugins/conf/db_file.db | 0 swift/1.4.8/plugins/conf/fs.conf-gluster | 3 +-- swift/1.4.8/plugins/conf/object-server/1.conf-gluster | 6 +++--- swift/1.4.8/plugins/conf/object.builder | Bin 786843 -> 0 bytes swift/1.4.8/plugins/conf/object.ring.gz | Bin 738 -> 0 bytes swift/1.4.8/plugins/conf/proxy-server.conf-gluster | 14 +++++++++++++- 12 files changed, 23 insertions(+), 12 deletions(-) delete mode 100644 swift/1.4.8/plugins/conf/account.builder delete mode 100644 swift/1.4.8/plugins/conf/account.ring.gz delete mode 100644 swift/1.4.8/plugins/conf/container.builder delete mode 100644 swift/1.4.8/plugins/conf/container.ring.gz delete mode 100644 swift/1.4.8/plugins/conf/db_file.db delete mode 100644 swift/1.4.8/plugins/conf/object.builder delete mode 100644 swift/1.4.8/plugins/conf/object.ring.gz (limited to 'swift/1.4.8/plugins/conf') diff --git a/swift/1.4.8/plugins/conf/account-server/1.conf-gluster b/swift/1.4.8/plugins/conf/account-server/1.conf-gluster index 911e2837f50..c7a4c10a4fc 100644 --- a/swift/1.4.8/plugins/conf/account-server/1.conf-gluster +++ b/swift/1.4.8/plugins/conf/account-server/1.conf-gluster @@ -1,7 +1,7 @@ [DEFAULT] -devices = /srv/1/node -mount_check = false -bind_port = 6012 +devices = /mnt/gluster-object +mount_check = true +bind_port = 6012 # Be sure to keep in sync with /usr/bin/gluster-swift-gen-builders user = root log_facility = LOG_LOCAL2 diff --git a/swift/1.4.8/plugins/conf/account.builder b/swift/1.4.8/plugins/conf/account.builder deleted file mode 100644 index 2943b9cfb49..00000000000 Binary files a/swift/1.4.8/plugins/conf/account.builder and /dev/null differ diff --git a/swift/1.4.8/plugins/conf/account.ring.gz b/swift/1.4.8/plugins/conf/account.ring.gz deleted file mode 100644 index e1a5e6ae25e..00000000000 Binary files a/swift/1.4.8/plugins/conf/account.ring.gz and /dev/null differ diff --git a/swift/1.4.8/plugins/conf/container-server/1.conf-gluster b/swift/1.4.8/plugins/conf/container-server/1.conf-gluster index eb5650afa74..2b97eef6241 100644 --- a/swift/1.4.8/plugins/conf/container-server/1.conf-gluster +++ b/swift/1.4.8/plugins/conf/container-server/1.conf-gluster @@ -1,7 +1,7 @@ [DEFAULT] -devices = /srv/1/node -mount_check = false -bind_port = 6011 +devices = /mnt/gluster-object +mount_check = true +bind_port = 6011 # Be sure to keep in sync with /usr/bin/gluster-swift-gen-builders user = root log_facility = LOG_LOCAL2 diff --git a/swift/1.4.8/plugins/conf/container.builder b/swift/1.4.8/plugins/conf/container.builder deleted file mode 100644 index 6031d79df60..00000000000 Binary files a/swift/1.4.8/plugins/conf/container.builder and /dev/null differ diff --git a/swift/1.4.8/plugins/conf/container.ring.gz b/swift/1.4.8/plugins/conf/container.ring.gz deleted file mode 100644 index fdbcb18b2bf..00000000000 Binary files a/swift/1.4.8/plugins/conf/container.ring.gz and /dev/null differ diff --git a/swift/1.4.8/plugins/conf/db_file.db b/swift/1.4.8/plugins/conf/db_file.db deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/swift/1.4.8/plugins/conf/fs.conf-gluster b/swift/1.4.8/plugins/conf/fs.conf-gluster index b6ec5121f9f..0bd21babff4 100644 --- a/swift/1.4.8/plugins/conf/fs.conf-gluster +++ b/swift/1.4.8/plugins/conf/fs.conf-gluster @@ -1,9 +1,8 @@ [DEFAULT] -mount_path = /mnt/gluster-object auth_account = auth #ip of the fs server. mount_ip = localhost #fs server need not be local, remote server can also be used, #set remote_cluster=yes for using remote server. remote_cluster = no -object_only = no \ No newline at end of file +object_only = no diff --git a/swift/1.4.8/plugins/conf/object-server/1.conf-gluster b/swift/1.4.8/plugins/conf/object-server/1.conf-gluster index 13dda69bae2..62e2fb49624 100644 --- a/swift/1.4.8/plugins/conf/object-server/1.conf-gluster +++ b/swift/1.4.8/plugins/conf/object-server/1.conf-gluster @@ -1,7 +1,7 @@ [DEFAULT] -devices = /srv/1/node -mount_check = false -bind_port = 6010 +devices = /mnt/gluster-object +mount_check = true +bind_port = 6010 # Be sure to keep in sync with /usr/bin/gluster-swift-gen-builders user = root log_facility = LOG_LOCAL2 diff --git a/swift/1.4.8/plugins/conf/object.builder b/swift/1.4.8/plugins/conf/object.builder deleted file mode 100644 index ce45350595d..00000000000 Binary files a/swift/1.4.8/plugins/conf/object.builder and /dev/null differ diff --git a/swift/1.4.8/plugins/conf/object.ring.gz b/swift/1.4.8/plugins/conf/object.ring.gz deleted file mode 100644 index 73e88d58918..00000000000 Binary files a/swift/1.4.8/plugins/conf/object.ring.gz and /dev/null differ diff --git a/swift/1.4.8/plugins/conf/proxy-server.conf-gluster b/swift/1.4.8/plugins/conf/proxy-server.conf-gluster index 9bec6425355..b5e1f6f3515 100644 --- a/swift/1.4.8/plugins/conf/proxy-server.conf-gluster +++ b/swift/1.4.8/plugins/conf/proxy-server.conf-gluster @@ -13,6 +13,18 @@ account_autocreate = true [filter:tempauth] use = egg:swift#tempauth +# Here you need to add users explicitly. See the OpenStack Swift Deployment +# Guide for more information. The user and user64 directives take the +# following form: +# user__ = [group] [group] [...] [storage_url] +# user64__ = [group] [group] [...] [storage_url] +# Where you use user64 for accounts and/or usernames that include underscores. +# +# NOTE (and WARNING): The account name must match the device name specified +# when generating the account, container, and object build rings. +# +# E.g. +# user_ufo0_admin = abc123 .admin [filter:healthcheck] use = egg:swift#healthcheck @@ -21,4 +33,4 @@ use = egg:swift#healthcheck use = egg:swift#memcache [filter:gluster] -use = egg:swift#gluster \ No newline at end of file +use = egg:swift#gluster -- cgit