From 402589f58cbb350dfedafa83e133664855ed37b2 Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Thu, 14 May 2015 15:00:59 +0530 Subject: glusterd/shared_storage: Provide a volume set option to create and mount the shared storage Introducing a global volume set option(cluster.enable-shared-storage) which helps create and set-up the shared storage meta volume. gluster volume set all cluster.enable-shared-storage enable On enabling this option, the system analyzes the number of peers in the cluster, which are currently connected, and chooses three such peers(including the node the command is issued from). From these peers a volume(gluster_shared_storage) is created. Depending on the number of peers available the volume is either a replica 3 volume(if there are 3 connected peers), or a replica 2 volume(if there are 2 connected peers). "/var/run/gluster/ss_brick" serves as the brick path on each node for the shared storage volume. We also mount the shared storage at "/var/run/gluster/shared_storage" on all the nodes in the cluster as part of enabling this option. If there is only one node in the cluster, or only one node is up then the command will fail Once the volume is created, and mounted the maintainance of the volume like adding-bricks, removing bricks etc., is expected to be the onus of the user. On disabling the option, we provide the user a warning, and on affirmation from the user we stop the shared storage volume, and unmount it from all the nodes in the cluster. gluster volume set all cluster.enable-shared-storage disable Change-Id: Idd92d67b93f444244f99ede9f634ef18d2945dbc BUG: 1222013 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/10793 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Rajesh Joseph Reviewed-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-utils.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.h') diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h index 57eecca8fb1..69f16a29edc 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.h +++ b/xlators/mgmt/glusterd/src/glusterd-utils.h @@ -657,4 +657,8 @@ glusterd_defrag_rpc_get (glusterd_defrag_info_t *defrag); struct rpc_clnt* glusterd_defrag_rpc_put (glusterd_defrag_info_t *defrag); + +int32_t +glusterd_count_connected_peers (int32_t *count); + #endif -- cgit