mfsclient安装脚本

#!/bin/bash

####结果判断

judge() {

if [ $? -eq 0 ];then

echo "successfly..."

else

echo "filed...."

exit 500

fi

}

echo "####环境准备"

/etc/init.d/iptables stop &>> /dev/null

setenforce 0

cd /usr/local/src

yum -y install fuse-devel zlib-devel &>> /dev/null

id mfs &>> /dev/null

if [ $? -ne 0 ];then

useradd -s /sbin/nologin mfs

fi

judge

echo "####下载mfs安装包"

if [ ! mfs-1.6.27-5.tar.gz ];then

wget http://www.moosefs.org/tl_files/mfscode/mfs-1.6.27-5.tar.gz &>> /dev/null

fi

judge

echo "####编译安装mfs"

tar -zxf mfs-1.6.27-5.tar.gz

cd mfs-1.6.27

./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs --disable-mfsmaster --disable-mfschunkserver --enable-mfsmount &>> configure-`date +%F`.log

judge

make &>> make-`date +%F`.log

judge

make install &>> make-`date +%F`.log

if [ `grep "usr/local/lib/pkgconfig" /etc/profile|wc -l` -eq 0 ];then

echo "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:\$PKG_CONFIG_PATH" >> /etc/profile

source /etc/profile

fi

judge

rm -rf make-`date +%F`.log configure-`date +%F`.log

dev_fount() {

if [ -d /cache -a -d /cache/mfs ];then

/usr/local/mfs/bin/mfsmount /cache/mfs -H 192.168.110.130 &>> mount.log

else

mkdir -p /cache/mfs

/usr/local/mfs/bin/mfsmount /cache/mfs -H 192.168.110.130 &>> mount.log

fi

dev=`df -h|grep mfs|wc -l`

if [ $dev -ne 0 ];then

echo "master挂载成功"

else

echo "master挂载失败"

exit

fi

}

echo "####加载fuse模块并创建挂载点"

mod_fuse=`lsmod | grep fuse|wc -l`

if [ $mod_fuse -eq 0 ];then

modprobe fuse

if [ `df -h |grep /cache/mfs|wc -l` -eq 0 ];then

dev_fount

fi

else

if [ `df -h |grep /cache/mfs|wc -l` -eq 0 ];then

dev_fount

fi

fi

if [ `grep "/usr/local/mfs/bin" /etc/profile|wc -l` -eq 0 ];then

echo "export PATH=/usr/local/mfs/bin:$PATH" >> /etc/profile

source /etc/profile

fi

echo "####添加开机启动项和hosts"

sed -i ‘/test_server/d‘ /etc/hosts

sed -i "/mfsmount/d" /etc/rc.local

echo "/usr/local/mfs/bin/mfsmount /cache/mfs -H 192.168.110.130" >> /etc/rc.local

echo "192.168.110.130 test_server_110_130

192.168.110.131 test_server_110_131

192.168.110.132 test_server_110_132

192.168.110.133 test_server_110_133

192.168.110.134 test_server_110_134" >> /etc/hosts

judge

read -p  "设置文件被复制的份数(要小于等于chunkserver的数量):" num

mfssetgoal -r $num /cache/mfs

时间: 2024-10-12 12:36:59

mfsclient安装脚本的相关文章

mysql自动安装脚本

为适应自己工作习惯和需要,花一点时间写了一个mysql自动安装脚本,供大家参考学习. 注意: 1.需要先安装cmake 2.数据库版本需要在第二步安装mysql时修改 3.该脚本是以root用户安装并启动 脚本内容如下: ######################################################################## #mysql自动安装脚本,其中变量/mysql_v_dir/和/port/可根据实际需要修改    # #执行脚本命令:sh mys

lnmp源码安装-脚本执行

lnmp 源码安装- 脚本执行 源码包版本: nginx1.9 mysql5.6.4 php5.6 使用: 将lnmp.tar.gz 解压至 根目录下,进入/lnmp/install/目录下,执行install.sh脚本即可.选择性安装! 安装过程中会有些警告信息显示,不影响. 整合包地址:http://pan.baidu.com/s/1dFp7gqP =======================代码============================= #!/bin/bash #####

lnmp安装脚本

lnmp安装脚本.一起学习.有更好的建议请留言. #!/bin/bash # # describe: linux nginx mysql php install FileS=/updatefile mkdir -p $FileS # 安装lrzsz 方便后续文件上传 wget http://vault.centos.org/6.5/os/x86_64/Packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm -P $FileS &>/dev/null rpm -v

mongodb安装脚本/启动脚本/配置文件

安装脚本 #!/bin/bash  #author: QingFeng #qq: 530035210 #blog: http://my.oschina.net/pwd/blog  #自动安装mongodb和初始化配置 #缺省的配置如下   logdir=/data/log/shell          #日志路径 log=$logdir/shell.log            #日志文件  is_font=1                #终端是否打印日志: 1打印 0不打印  is_log

ipvsadm+keepalived+inotify-tools自动安装脚本

#!/bin/bash # # #this is install keepalived+lvs-DR # # tar_dir=/usr/src configure_yum() { echo "[rhel-local]">/etc/yum.repos.d/rhel-local.repo echo "baseurl=file:///media/Server">>/etc/yum.repos.d/rhel-local.repo echo "en

【shell】oracle安装脚本 - 未完成

自动安装oracle所需要的rpm包(需要访问外网): #! /bin/sh rpmpack=" binutils compat-libstdc++* elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers ksh libaio libaio-devel libgcc libg

Ubuntu Or Debian L2TP VPN 一键安装脚本

#!/bin/bash if [ $(id -u) != "0" ]; then printf "Error: You must be root to run this tool!\n" exit 1 fi clear printf " #################################################### # # # This is a Shell-Based tool of l2tp installation # #

Centos7搭建pptp VPN一键安装脚本

Centos7搭建pptp一键安装脚本 废话不多说,先上脚本地址:Centos7一键pptp 使用: wget https://raw.githubusercontent.com/DanylZhang/VPS/master/CentOS7-pptp-host1plus.sh chmod +x ./CentOS7-pptp-host1plus.sh ./CentOS7-pptp-host1plus.sh -u your_username -p your_password 1 2 3 可在-u.-p

L2TP/IPSec一键安装脚本

本脚本适用环境:系统支持:CentOS6+,Debian7+,Ubuntu12+内存要求:≥128M更新日期:2017 年 05 月 28 日 关于本脚本:名词解释如下L2TP(Layer 2 Tunneling Protocol)IPSec(Internet Protocol Security)IKEv2 (Internet Key Exchange v2)能实现 IPsec 的目前总体上有 openswan,libreswan,strongswan 这3种.libreswan 是基于 ope