summaryrefslogtreecommitdiffstats
path: root/manifests
diff options
context:
space:
mode:
authorJames Shubin <james@shubin.ca>2013-09-16 01:32:41 -0400
committerJames Shubin <james@shubin.ca>2013-09-16 01:32:41 -0400
commit7e00d90ecc38812e0f24fc711523b778955d39c8 (patch)
treeb0bbedec50c75bbccc651fb0ea129b6606bc5388 /manifests
parent1d423ade0362a01acf2cbc35399808b4befe0864 (diff)
downloadpuppet-gluster-7e00d90ecc38812e0f24fc711523b778955d39c8.tar.gz
puppet-gluster-7e00d90ecc38812e0f24fc711523b778955d39c8.tar.xz
puppet-gluster-7e00d90ecc38812e0f24fc711523b778955d39c8.zip
Better volume property management.
This patch adds the beginning of better property management. Many properties need types and testing filled in to work properly. This is preliminary support to make it easier for others to test and offer patches for options they use.
Diffstat (limited to 'manifests')
-rw-r--r--manifests/volume/property.pp35
-rw-r--r--manifests/volume/property/data.pp333
2 files changed, 353 insertions, 15 deletions
diff --git a/manifests/volume/property.pp b/manifests/volume/property.pp
index 5c2548d..e71e5d2 100644
--- a/manifests/volume/property.pp
+++ b/manifests/volume/property.pp
@@ -23,6 +23,8 @@ define gluster::volume::property(
) {
include gluster::xml
include gluster::vardir
+ include gluster::volume::property::data
+
#$vardir = $::gluster::vardir::module_vardir # with trailing slash
$vardir = regsubst($::gluster::vardir::module_vardir, '\/$', '')
@@ -34,17 +36,18 @@ define gluster::volume::property(
fail('The property $name must match a $volume#$key pattern.')
}
- # TODO: can we split out $etype lookup into a separate file, like?
- # also do the same for jchar
- #$etype = gluster::volume::property::etype # pull in etype hash
-
- # expected type # XXX: add more variables
- $etype = $key ? {
- 'auth.allow' => 'array',
- 'auth.reject' => 'array',
- #'XXX' => 'string', # XXX
- #'XXXX' => 'array', # XXX
- default => 'undefined',
+ # split out $etype and $jchar lookup into a separate file
+ $etypes = $::gluster::volume::property::data::etypes
+ $jchars = $::gluster::volume::property::data::jchars
+
+ # expected type
+ if has_key($etypes, "${key}") {
+ $etype = $etypes["${key}"] ? {
+ '' => 'undefined',
+ default => $etypes["${key}"],
+ }
+ } else {
+ $etype = 'undefined'
}
if (! $autotype) {
@@ -63,10 +66,12 @@ define gluster::volume::property(
if $etype == 'string' {
$safe_value = shellquote($value) # TODO: is this the safe thing?
} elsif $etype == 'array' {
- $jchar = $key ? {
- 'auth.allow' => ',',
- 'auth.reject' => ',',
- default => '',
+
+ # join char
+ if has_key($jchars, "${key}") {
+ $jchar = $jchars["${key}"]
+ } else {
+ $jchar = ''
}
$safe_value = inline_template('<%= value.join(jchar) %>')
diff --git a/manifests/volume/property/data.pp b/manifests/volume/property/data.pp
new file mode 100644
index 0000000..6040fac
--- /dev/null
+++ b/manifests/volume/property/data.pp
@@ -0,0 +1,333 @@
+# Simple? gluster module by James
+# Copyright (C) 2012-2013+ James Shubin
+# Written by James Shubin <james@shubin.ca>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+class gluster::volume::property::data() {
+
+ # expected type
+ $etypes = {
+ # FIXME: the empty '' strings need to be filled in...
+
+ # Allow a comma separated list of addresses and/or hostnames to connect to the server. By default, all connections are allowed.
+ 'auth.allow' => 'array', # default: (null)
+
+ # Reject a comma separated list of addresses and/or hostnames to connect to the server. By default, all connections are allowed.
+ 'auth.reject' => 'array', # default: (null)
+
+ # This specifies the number of self-heals that can be performed in background without blocking the fop
+ 'cluster.background-self-heal-count' => 'integer', # default: 16
+
+ # Choose a local subvolume (i.e. Brick) to read from if read-subvolume is not explicitly set.
+ 'cluster.choose-local' => '', # default: true
+
+ # Data fops like write/truncate will not perform pre/post fop changelog operations in afr transaction if this option is disabled
+ 'cluster.data-change-log' => '', # default: on
+
+ # Using this option we can enable/disable data self-heal on the file. "open" means data self-heal action will only be triggered by file open operations.
+ 'cluster.data-self-heal' => '', # default: on
+
+ # Select between "full", "diff". The "full" algorithm copies the entire file from source to sink. The "diff" algorithm copies to sink only those blocks whose checksums don't match with those of source. If no option is configured the option is chosen dynamically as follows: If the file does not exist on one of the sinks or empty file exists or if the source file size is about the same as page size the entire file will be read and written i.e "full" algo, otherwise "diff" algo is chosen.
+ 'cluster.data-self-heal-algorithm' => '', # default: (null)
+
+ # Lock phase of a transaction has two sub-phases. First is an attempt to acquire locks in parallel by broadcasting non-blocking lock requests. If lock acquisition fails on any server, then the held locks are unlocked and revert to a blocking locked mode sequentially on one server after another. If this option is enabled the initial broadcasting lock request attempt to acquire lock on the entire file. If this fails, we revert back to the sequential "regional" blocking lock as before. In the case where such an "eager" lock is granted in the non-blocking phase, it gives rise to an opportunity for optimization. i.e, if the next write transaction on the same FD arrives before the unlock phase of the first transaction, it "takes over" the full file lock. Similarly if yet another data transaction arrives before the unlock phase of the "optimized" transaction, that in turn "takes over" the lock as well. The actual unlock now happens at the end of the last "optimized" transaction.
+ 'cluster.eager-lock' => '', # default: on
+
+ # Entry fops like create/unlink will not perform pre/post fop changelog operations in afr transaction if this option is disabled
+ 'cluster.entry-change-log' => '', # default: on
+
+ # Using this option we can enable/disable entry self-heal on the directory.
+ 'cluster.entry-self-heal' => '', # default: on
+
+ # time interval for checking the need to self-heal in self-heal-daemon
+ 'cluster.heal-timeout' => '', # default: 600
+
+ # This option if set to ON, does a lookup through all the sub-volumes, in case a lookup didn't return any result from the hash subvolume. If set to OFF, it does not do a lookup on the remaining subvolumes.
+ 'cluster.lookup-unhashed' => '', # default: on
+
+ # Metadata fops like setattr/setxattr will not perform pre/post fop changelog operations in afr transaction if this option is disabled
+ 'cluster.metadata-change-log' => '', # default: on
+
+ # Using this option we can enable/disable metadata i.e. Permissions, ownerships, xattrs self-heal on the file/directory.
+ 'cluster.metadata-self-heal' => '', # default: on
+
+ # Percentage/Size of disk space, after which the process starts balancing out the cluster, and logs will appear in log files
+ 'cluster.min-free-disk' => '', # default: 10%
+
+ # after system has only N% of inodes, warnings starts to appear in log files
+ 'cluster.min-free-inodes' => '', # default: 5%
+
+ # If quorum-type is "fixed" only allow writes if this many bricks or present. Other quorum types will OVERWRITE this value.
+ 'cluster.quorum-count' => '', # default: (null)
+
+ # If value is "fixed" only allow writes if quorum-count bricks are present. If value is "auto" only allow writes if more than half of bricks, or exactly half including the first, are present.
+ 'cluster.quorum-type' => '', # default: none
+
+ # readdir(p) will not failover if this option is off
+ 'cluster.readdir-failover' => '', # default: on
+
+ # This option if set to ON enables the optimization that allows DHT to requests non-first subvolumes to filter out directory entries.
+ 'cluster.readdir-optimize' => '', # default: off
+
+ # inode-read fops happen only on one of the bricks in replicate. AFR will prefer the one computed using the method specified using this option0 = first responder, 1 = hash by GFID of file (all clients use same subvolume), 2 = hash by GFID of file and client PID
+ 'cluster.read-hash-mode' => '', # default: 0
+
+ # inode-read fops happen only on one of the bricks in replicate. Afr will prefer the one specified using this option if it is not stale. Option value must be one of the xlator names of the children. Ex: <volname>-client-0 till <volname>-client-<number-of-bricks - 1>
+ 'cluster.read-subvolume' => '', # default: (null)
+
+ # inode-read fops happen only on one of the bricks in replicate. AFR will prefer the one specified using this option if it is not stale. allowed options include -1 till replica-count - 1
+ 'cluster.read-subvolume-index' => '', # default: -1
+
+ # This option if set to ON displays and logs the time taken for migration of each file, during the rebalance process. If set to OFF, the rebalance logs will only display the time spent in each directory.
+ 'cluster.rebalance-stats' => '', # default: off
+
+ # This option applies to only self-heal-daemon. Index directory crawl and automatic healing of files will not be performed if this option is turned off.
+ 'cluster.self-heal-daemon' => '', # default: off
+
+ # readdirp size for performing entry self-heal
+ 'cluster.self-heal-readdir-size' => '', # default: 1KB
+
+ # Maximum number blocks per file for which self-heal process would be applied simultaneously.
+ 'cluster.self-heal-window-size' => '', # default: 1
+
+ # Sets the quorum percentage for the trusted storage pool.
+ 'cluster.server-quorum-ratio' => '', # default: (null)
+
+ # If set to server, enables the specified volume to participate in quorum.
+ 'cluster.server-quorum-type' => '', # default: (null)
+
+ # Size of the stripe unit that would be read from or written to the striped servers.
+ 'cluster.stripe-block-size' => '', # default: 128KB
+
+ # Enable coalesce mode to flatten striped files as stored on the server (i.e., eliminate holes caused by the traditional format).
+ 'cluster.stripe-coalesce' => '', # default: false
+
+ # Specifies the directory layout spread.
+ 'cluster.subvols-per-directory' => '', # default: (null)
+
+ # Changes the log-level of the bricks
+ 'diagnostics.brick-log-level' => '', # default: INFO
+
+ # Gluster's syslog log-level
+ 'diagnostics.brick-sys-log-level' => '', # default: CRITICAL
+
+ # Changes the log-level of the clients
+ 'diagnostics.client-log-level' => '', # default: INFO
+
+ # Gluster's syslog log-level
+ 'diagnostics.client-sys-log-level' => '', # default: CRITICAL
+
+ # If on stats related to file-operations would be tracked inside GlusterFS data-structures.
+ 'diagnostics.dump-fd-stats' => '', # default: off
+
+ # If on stats related to the latency of each operation would be tracked inside GlusterFS data-structures.
+ 'diagnostics.latency-measurement' => '', # default: off
+
+ # Sets the grace-timeout value. Valid range 10-1800.
+ 'features.grace-timeout' => '', # default: (null)
+
+ # Enables or disables the lock heal.
+ 'features.lock-heal' => '', # default: off
+
+ # quota caches the directory sizes on client. Timeout indicates the timeout for the cache to be revalidated.
+ 'features.quota-timeout' => '', # default: 0
+
+ # Time frame after which the (file) operation would be declared as dead, if the server does not respond for a particular (file) operation.
+ 'network.frame-timeout' => '', # default: 1800
+
+ # Specifies the maximum megabytes of memory to be used in the inode cache.
+ 'network.inode-lru-limit' => '', # default: 16384
+
+ # Time duration for which the client waits to check if the server is responsive.
+ 'network.ping-timeout' => '', # default: 42
+
+ # If enabled, in open() and creat() calls, O_DIRECT flag will be filtered at the client protocol level so server will still continue to cache the file. This works similar to NFS's behavior of O_DIRECT
+ 'network.remote-dio' => '', # default: disable
+
+ # XXX: this appears twice
+ # Specifies the window size for tcp socket.
+ 'network.tcp-window-size' => '', # default: (null)
+
+ # Users have the option of turning on name lookup for incoming client connections using this option. Use this option to turn on name lookups during address-based authentication. Turning this on will enable you to use hostnames in rpc-auth.addr.* filters. In some setups, the name server can take too long to reply to DNS queries resulting in timeouts of mount requests. By default, name lookup is off
+ 'nfs.addr-namelookup' => '', # default: (null)
+
+ # This option is used to start or stop NFS server for individual volume.
+ 'nfs.disable' => '', # default: (null)
+
+ # Internal option set to tell gnfs to use a different scheme for encoding file handles when DVM is being used.
+ 'nfs.dynamic-volumes' => '', # default: (null)
+
+ # For nfs clients or apps that do not support 64-bit inode numbers, use this option to make NFS return 32-bit inode numbers instead. Disabled by default, so NFS returns 64-bit inode numbers.
+ 'nfs.enable-ino32' => '', # default: (null)
+
+ # By default, all subvolumes of nfs are exported as individual exports. There are cases where a subdirectory or subdirectories in the volume need to be exported separately. This option can also be used in conjunction with nfs3.export-volumes option to restrict exports only to the subdirectories specified through this option. Must be an absolute path.
+ 'nfs.export-dir' => '', # default: (null)
+
+ # By default, all subvolumes of nfs are exported as individual exports. There are cases where a subdirectory or subdirectories in the volume need to be exported separately. Enabling this option allows any directory on a volumes to be exported separately. Directory exports are enabled by default.
+ 'nfs.export-dirs' => '', # default: (null)
+
+ # Enable or disable exporting whole volumes, instead if used in conjunction with nfs3.export-dir, can allow setting up only subdirectories as exports. On by default.
+ 'nfs.export-volumes' => '', # default: (null)
+
+ # Use this option to make NFS be faster on systems by using more memory. This option specifies a multiple that determines the total amount of memory used. Default value is 15. Increase to use more memory in order to improve performance for certain use cases. Please consult gluster-users list before using this option.
+ 'nfs.mem-factor' => '', # default: (null)
+
+ # set the option to 'on' to enable mountd on UDP. Required for some Solaris and AIX NFS clients. The need for enabling this option often depends on the usage of NLM.
+ 'nfs.mount-udp' => '', # default: (null)
+
+ # This option, if set to 'off', disables NLM server by not registering the service with the portmapper. Set it to 'on' to re-enable it. Default value: 'on'
+ 'nfs.nlm' => '', # default: (null)
+
+ # Use this option on systems that need Gluster NFS to be associated with a non-default port number.
+ 'nfs.port' => '', # default: (null)
+
+ # Allow client connections from unprivileged ports. By default only privileged ports are allowed. Use this option to enable or disable insecure ports for a specific subvolume and to override the global setting set by the previous option.
+ 'nfs.ports-insecure' => '', # default: (null)
+
+ # For systems that need to run multiple nfs servers, only one registration is possible with portmap service. Use this option to turn off portmap registration for Gluster NFS. On by default
+ 'nfs.register-with-portmap' => '', # default: (null)
+
+ # Allow a comma separated list of addresses and/or hostnames to connect to the server. By default, all connections are allowed. This allows users to define a rule for a specific exported volume.
+ 'nfs.rpc-auth-allow' => 'array', # default: (null)
+
+ # Disable or enable the AUTH_NULL authentication type for a particular exported volume overriding defaults and general setting for AUTH_NULL. Must always be enabled. This option is here only to avoid unrecognized option warnings.
+ 'nfs.rpc-auth-null' => '', # default: (null)
+
+ # Reject a comma separated list of addresses and/or hostnames from connecting to the server. By default, all connections are allowed. This allows users to define a rule for a specific exported volume.
+ 'nfs.rpc-auth-reject' => 'array', # default: (null)
+
+ # Disable or enable the AUTH_UNIX authentication type for a particular exported volume overriding defaults and general setting for AUTH_UNIX scheme. Must always be enabled for better interoperability.However, can be disabled if needed. Enabled by default.
+ 'nfs.rpc-auth-unix' => '', # default: (null)
+
+ # Specifies the nfs transport type. Valid transport types are 'tcp' and 'rdma'.
+ 'nfs.transport-type' => '', # default: tcp
+
+ # All writes and COMMIT requests are treated as async. This implies that no write requests are guaranteed to be on server disks when the write reply is received at the NFS client. Trusted sync includes trusted-write behaviour. Off by default.
+ 'nfs.trusted-sync' => '', # default: (null)
+
+ # On an UNSTABLE write from client, return STABLE flag to force client to not send a COMMIT request. In some environments, combined with a replicated GlusterFS setup, this option can improve write performance. This flag allows user to trust Gluster replication logic to sync data to the disks and recover when required. COMMIT requests if received will be handled in a default manner by fsyncing. STABLE writes are still handled in a sync manner. Off by default.
+ 'nfs.trusted-write' => '', # default: (null)
+
+ # Type of access desired for this subvolume: read-only, read-write(default)
+ 'nfs.volume-access' => '', # default: (null)
+
+ # Maximum file size which would be cached by the io-cache translator.
+ 'performance.cache-max-file-size' => '', # default: 0
+
+ # Minimum file size which would be cached by the io-cache translator.
+ 'performance.cache-min-file-size' => '', # default: 0
+
+ # Assigns priority to filenames with specific patterns so that when a page needs to be ejected out of the cache, the page of a file whose priority is the lowest will be ejected earlier
+ 'performance.cache-priority' => '', # default:
+
+ # The cached data for a file will be retained till 'cache-refresh-timeout' seconds, after which data re-validation is performed.
+ 'performance.cache-refresh-timeout' => '', # default: 1
+
+ # XXX: this appears twice, with different defaults !
+ # Size of the read cache.
+ 'performance.cache-size' => '', # default: 32MB
+
+ # Size of the read cache.
+ 'performance.cache-size' => '', # default: 128MB
+
+ # enable/disable io-threads translator in the client graph of volume.
+ 'performance.client-io-threads' => '', # default: off
+
+ # Enable/Disable least priority
+ 'performance.enable-least-priority' => '', # default: on
+
+ # If this option is set ON, instructs write-behind translator to perform flush in background, by returning success (or any errors, if any of previous writes were failed) to application even before flush FOP is sent to backend filesystem.
+ 'performance.flush-behind' => '', # default: on
+
+ # Convert all readdir requests to readdirplus to collect stat info on each entry.
+ 'performance.force-readdirp' => '', # default: true
+
+ # Max number of threads in IO threads translator which perform high priority IO operations at a given time
+ 'performance.high-prio-threads' => '', # default: 16
+
+ # enable/disable io-cache translator in the volume.
+ 'performance.io-cache' => '', # default: on
+
+ # Number of threads in IO threads translator which perform concurrent IO operations
+ 'performance.io-thread-count' => '', # default: 16
+
+ # Max number of threads in IO threads translator which perform least priority IO operations at a given time
+ 'performance.least-prio-threads' => '', # default: 1
+
+ # Max number of least priority operations to handle per-second
+ 'performance.least-rate-limit' => '', # default: 0
+
+ # Max number of threads in IO threads translator which perform low priority IO operations at a given time
+ 'performance.low-prio-threads' => '', # default: 16
+
+ # Time period after which cache has to be refreshed
+ 'performance.md-cache-timeout' => '', # default: 1
+
+ # Max number of threads in IO threads translator which perform normal priority IO operations at a given time
+ 'performance.normal-prio-threads' => '', # default: 16
+
+ # enable/disable open-behind translator in the volume.
+ 'performance.open-behind' => '', # default: on
+
+ # enable/disable quick-read translator in the volume.
+ 'performance.quick-read' => '', # default: on
+
+ # enable/disable read-ahead translator in the volume.
+ 'performance.read-ahead' => '', # default: on
+
+ # Number of pages that will be pre-fetched
+ 'performance.read-ahead-page-count' => '', # default: 4
+
+ # enable/disable meta-data caching translator in the volume.
+ 'performance.stat-prefetch' => '', # default: on
+
+ # This option when set to off, ignores the O_DIRECT flag.
+ 'performance.strict-o-direct' => '', # default: off
+
+ # Do not let later writes overtake earlier writes even if they do not overlap
+ 'performance.strict-write-ordering' => '', # default: off
+
+ # enable/disable write-behind translator in the volume.
+ 'performance.write-behind' => '', # default: on
+
+ # Size of the write-behind buffer for a single file (inode).
+ 'performance.write-behind-window-size' => '', # default: 1MB
+
+ # Map requests from uid/gid 0 to the anonymous uid/gid. Note that this does not apply to any other uids or gids that might be equally sensitive, such as user bin or group staff.
+ 'server.root-squash' => '', # default: off
+
+ # Specifies directory in which gluster should save its statedumps. By default it is the /tmp directory
+ 'server.statedump-path' => '', # default: /var/run/gluster
+
+ # Support for native Linux AIO
+ 'storage.linux-aio' => '', # default: off
+
+ # Support for setting gid of brick's owner
+ 'storage.owner-gid' => '', # default: (null)
+
+ # Support for setting uid of brick's owner
+ 'storage.owner-uid' => '', # default: (null)
+ }
+
+ # join char
+ $jchars = {
+ 'auth.allow' => ',',
+ 'auth.reject' => ',',
+ 'nfs.rpc-auth-allow' => ',',
+ 'nfs.rpc-auth-reject' => ',',
+ }
+}
+
+# vim: ts=8