#!/bin/sh#auto make install MFS files#cat <<eof++++++++++++++++welcome to use Auto install MFS Scripts +++++++++++++ ++++++++++++++++++++++++++this MFS Install Version 1.6.27+++++++++++++++++++++++++++++++++++++++++++++++2013-12-04 Author wugk ++++++++++++++++++++++++++eof#defined variablessrc_dir=/usr/src/mfs_count= (http://www.moosefs.org/tl_ files/mfscodemfs-1.6.27-1.tar.gzmfs-1.6.27 "./configure--prefix=/usr--sysconfdir=/etc--localstatedir=/var/lib --with-default-user=mfs--with-default-group=mfs--disable-mfschunkserver--disable-mfsmount ""./configure-- PREFIX=/USR--sysconfdir=/etc--localstatedir=/var/lib--with-default-user=mfs--with-default-group=mfs-- Disable-mfsmaster ""./configure--prefix=/usr--sysconfdir=/etc--localstatedir=/var/lib--with-default-user= MFS--with-default-group=mfs--disable-mfsmaster--disable-mfschunkserver ") # #Defined Function Command Master MFS Installmaster_mfs () {if [-e/usr/sbin/mfsmaster];thenecho "This mfsmaster already exists,Please exit "Exit 0fi#download MFS SOft Version 1.6.27cd $SRC _dir; Wget-c ${mfs_count[0]}/${mfs_count[1]} &&echo "Download ${mfs_count[1]} successfully!" #Configure MFS and make install and configuration MFS Groupadd MFS; USERADD-G MFS MFSTAR-XZF ${mfs_count[1]}; CD ${mfs_c OUNT[2]} &&${mfs_count[3]} &&make &&make install[$? = = 0]&&echo "This MFS ${MFS_COUNT[2 ]} Install successfully,please Wait Config master_mfs ... "cd/etc/mfs/&&CP mfsmaster.cfg.dist MFSMASTER.CFGCP mfsmetalogger.cfg.dist MFSMETALOGGER.CFGCP mfsexports.cfg.dist Mfsexports.cfgcd/var/lib/mfs; MV Metadata.mfs.empty metadata.mfs}# #Defined Function Command Chunks MFS Installchunks_mfs () {if [-e/usr/sbin/ Mfschunkserver];thenecho "This mfschunkserver already exists,please exit" Exit 0fi#download MFS SOft Version 1.6.27 CD $SRC _dir; Wget-c ${mfs_count[0]}/${mfs_count[1]} &&echo "Download ${mfs_count[1]} successfully!" #Configure MFS and make install and configuration MFS Groupadd MFS; USERADD-G MFS MFS TAR-XZF ${mfs_count[1]}; CD ${mfs_count[2]} && AMP;${MFS_COUNT[4]} &&make &&make Install [$ = = 0]&&echo "This MFS ${mfs_count[2]} Insta ll successfully,please Wait Config Chunk_mfs ... "cd/etc/mfs/&&CP mfschunkserver.cfg.dist MFSCHUNKSERVER.CFGCP mfshdd.cfg.dist mfshdd.cfgmkdir-p/data/{mfs1,mfs2}echo-e "/DATA/MFS1\N/DATA/MFS2" >> Mfshdd.cfgchown-r mfs:mfs/data/mfs1chown-r Mfs:mfs/data/mfs2}client_mfs () {if [-e/usr/bin/mfsmount];then echo ' This Mfschunkserver already exists,please exit "Exit 0fi#download MFS SOft Version 1.6.27 cd $SRC _dir; Wget-c ${mfs_count[0]}/${mfs_count[1]} &&echo "Download ${mfs_count[1]} successfully!" #Configure MFS and make install and configuration MFS Groupadd MFS; useradd-g MFS Mfsyum Install fuse-devel-y Tar-xzf ${mfs_count[1]}; CD ${mfs_count[2]} &&${mfs_count[5]} &&make &Amp;&make Install [$ = = 0]&&echo-e "This MFS ${mfs_count[2]} Client install successfully\nyou Can U SE: {/usr/bin/mfsmount/mnt/-H mfs_master_ip} to Mount! "} Case $ in Master_mfs) Master_mfs;; CHUNKS_MFS) Chunks_mfs;; CLIENT_MFS) Client_mfs;; *) Echoecho "$ {MASTER_MFS | Chunks_mfs | Client_mfs} ";; Esac
Case of shell Script Automation deployment XX (with array)