"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-8.2/extras/migrate-unify-to-distribute.sh" (16 Sep 2020, 1110 Bytes) of package /linux/misc/glusterfs-8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 
    3 #
    4 # This is a template script which can be used to migrate the GlusterFS
    5 # storage infrastructure from 'cluster/unify' to 'cluster/distribute'
    6 
    7 # This script needs to be executed on the machine where namespace volume 
    8 # of 'cluster/unify' translator resides. And also, one need to mount the 
    9 # new 'cluster/distribute' volume with "option lookup-unhashed yes" on 
   10 # the same machine.
   11 # If the namespace volume was replicated (ie, afr'ed), then this can be 
   12 # executed just on one of the namespace machines..
   13 
   14 # Only the variables defined below needs to be changed to appropriate path
   15 
   16 # This is export from old 'cluster/unify' volume's namespace volume.
   17 namespace_export=/exports/export-ns
   18 namespace_host=localhost
   19 
   20 # This is the new mount point with 'cluster/distribute' volume
   21 distribute_mount=/mnt/glusterfs
   22 
   23 function execute_on()
   24 {
   25     local node="$1"
   26     local cmd="$2"
   27 
   28     if [ "$node" = "localhost" ]; then
   29         $cmd
   30     else
   31         ssh "$node" sh -c "$cmd"
   32     fi
   33 }
   34 
   35 execute_on $namespace_host "cd ${namespace_export} && find ." |
   36 (cd ${distribute_mount} && xargs -d '\n' stat -c '%n')