diff options
author | Amar Tumballi <amar@gluster.com> | 2009-08-04 17:51:31 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-08-04 17:07:01 -0700 |
commit | 2c056117b6cfe4bf3f62c791d2c6514bae8655d9 (patch) | |
tree | 56ad3454e596ee598b2316e43056596aa3e8a444 | |
parent | e26e9b861d92edfb7c00aa1b7c8c3a4126a563fb (diff) |
adding an option to mount.glusterfs for server failover to fetch volume files.
With this option, 'single point of failure', in case of volfile server can be
avoided
Thanks to Cory Meyer <cory.meyer@gmail.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 185 (Request to support secondary volfile-server option in mount.glusterfs)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=185
-rwxr-xr-x | xlators/mount/fuse/utils/mount.glusterfs.in | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index 0bf8efd9dbc..19418191a3b 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -78,41 +78,50 @@ start_glusterfs () if [ -n "$direct_io_mode" ]; then cmd_line=$(echo "$cmd_line --disable-direct-io-mode"); fi + + if [ -n "$volume_name" ]; then + cmd_line=$(echo "$cmd_line --volume-name=$volume_name"); + fi + if [ -n "$log_server" ]; then + if [ -n "$log_server_port" ]; then + cmd_line=$(echo "$cmd_line \ +--log-server=$log_server \ +--log-server-port=$log_server_port"); + fi + fi + if [ -z "$volfile_loc" ]; then if [ -n "$server_ip" ]; then + cmd_line=$(echo "$cmd_line --volfile-server-port=$server_port"); if [ -n "$transport" ]; then - cmd_line=$(echo "$cmd_line \ ---volfile-server=$server_ip \ ---volfile-server-port=$server_port \ ---volfile-server-transport=$transport"); - else - cmd_line=$(echo "$cmd_line \ ---volfile-server=$server_ip \ ---volfile-server-port=$server_port"); - fi + cmd_line=$(echo "$cmd_line --volfile-server-transport=$transport"); + fi if [ -n "$volume_id" ]; then cmd_line=$(echo "$cmd_line --volfile-id=$volume_id"); fi + + if [ -n "$backupvolfile_server" ]; then + cmd_line1=$(echo "$cmd_line --volfile-server=$backupvolfile_server"); + fi + + cmd_line=$(echo "$cmd_line --volfile-server=$server_ip"); fi else cmd_line=$(echo "$cmd_line --volfile=$volfile_loc"); fi + + cmd_line=$(echo "$cmd_line $mount_point"); + $cmd_line; - if [ -n "$log_server" ]; then - if [ -n "$log_server_port" ]; then - cmd_line=$(echo "$cmd_line \ ---log-server=$log_server \ ---log-server-port=$log_server_port"); + # retry the failover + if [ $? != "0" ]; then + if [ -n "$cmd_line1" ]; then + cmd_line1=$(echo "$cmd_line1 $mount_point"); + $cmd_line1 fi fi - if [ -n "$volume_name" ]; then - cmd_line=$(echo "$cmd_line --volume-name=$volume_name"); - fi - - cmd_line=$(echo "$cmd_line $mount_point"); - exec $cmd_line; } usage () @@ -152,6 +161,7 @@ main () volfile_check=$(echo "$options" | sed -n 's/.*volfile-check=\([^,]*\).*/\1/p'); server_port=$(echo "$options" | sed -n 's/.*server-port=\([^,]*\).*/\1/p'); + backupvolfile_server=$(echo "$options" | sed -n 's/.*backupvolfile-server=\([^,]*\).*/\1/p'); log_server=$(echo "$options" | sed -n 's/.*log-server=\([^,]*\).*/\1/p'); @@ -184,6 +194,7 @@ main () -e 's/[,]*direct-io-mode=[^,]*//' \ -e 's/[,]*volfile-check=[^,]*//' \ -e 's/[,]*transport=[^,]*//' \ + -e 's/[,]*backupvolfile-server=[^,]*//' \ -e 's/[,]*server-port=[^,]*//' \ -e 's/[,]*volume-id=[^,]*//' \ -e 's/[,]*log-server=[^,]*//' \ @@ -223,3 +234,4 @@ main () } _init "$@" && main "$@"; + |