#!/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 Variables
SRC_DIR=/usr/src/
MFS_COUNT=(
http://www.moosefs.org/tl_files/mfscode
mfs-1.6.27-1.tar.gz
mfs-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 Install
master_mfs ()
{ if [ -e /usr/sbin/mfsmaster ];then
echo "This Mfsmaster already exists,Please exit "
exit 0
fi #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]} &&${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.cfg
cp mfsmetalogger.cfg.dist mfsmetalogger.cfg
cp mfsexports.cfg.dist mfsexports.cfg
cd /var/lib/mfs ;mv metadata.mfs.empty metadata.mfs
} ##Defined Function Command Chunks MFS Install
chunks_mfs () {
if [ -e /usr/sbin/mfschunkserver ];then
echo "This Mfschunkserver already exists,Please exit "
exit 0
fi
#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]} &&${MFS_COUNT[4]} &&make &&make install
[ $? == 0 ]&&echo "This MFS ${MFS_COUNT[2]} Install Successfully,Please Wait Config Chunk_MFS ......"
cd /etc/mfs/ &&
cp mfschunkserver.cfg.dist mfschunkserver.cfg
cp mfshdd.cfg.dist mfshdd.cfg
mkdir -p /data/{mfs1,mfs2}
echo -e "/data/mfs1\n/data/mfs2" >>mfshdd.cfg
chown -R mfs:mfs /data/mfs1
chown -R mfs:mfs /data/mfs2
} client_mfs () {
if [ -e /usr/bin/mfsmount ];then
echo "This Mfschunkserver already exists,Please exit "
exit 0
fi
#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
yum install fuse-devel -y
tar -xzf ${MFS_COUNT[1]} ;cd ${MFS_COUNT[2]} &&${MFS_COUNT[5]} &&make &&make install
[ $? == 0 ]&&echo -e "This MFS ${MFS_COUNT[2]} Client Install Successfully\nYou Can Use :{/usr/bin/mfsmount /mnt/ -H mfs_master_ip} to Mount !"
} case $1 in master_mfs )
master_mfs
;;
chunks_mfs )
chunks_mfs
;;
client_mfs )
client_mfs
;;
* )
echo
echo "$0 {master_mfs | chunks_mfs | client_mfs}"
;;
esac

  

shell脚本自动化部署XX的案例(附数组使用)的更多相关文章

  1. shell脚本自动化部署服务

    shell脚本自动化部署 !/bin/bash #export PATH=$PATH:/export/maven/bin run_flag_dir="/data0/shell/deploy_ ...

  2. shell脚本自动化部署

    由于公司技术部团队较小,没有专门的运维团队,所以运维工作技术部承包了. 一.纯人工部署是这样的: 1. 本地打包:一般 maven clean package 2. 借助xftp上传到服务器对应目录 ...

  3. linux下使用shell脚本自动化部署项目

    在Java开发项目时经常要把正在开发的项目发布到测试服务器中去测试,一般的话是要把项目先打成war包,然后把war包发布到服务器中,关闭服务器, 最后重新启动服务器,虽然这过程不是很繁琐,但如果是多个 ...

  4. Shell脚本-自动化部署WEB

    #! /bin/ ] then echo "#### 参数有误,\$1:构建号必填" exit fi cd /root/workspace/xinya_erp/xinya_web ...

  5. Shell脚本-自动化部署反向代理、WEB、nfs

    部署nginx反向代理三个web服务,调度算法使用加权轮询(由于物理原因只开启两台服务器) AutoNginxNfsService.sh #/bin/bash systemctl status ngi ...

  6. shell脚本自动化部署Zabbix4.2(修改脚本替换版本)

    #!/bin/bash # 检查操作系统版本,该脚本只能运行在 Centos 7.x 系统上 cat /etc/redhat-release |grep -i centos |grep '7.[[:d ...

  7. fdisk分区硬盘并shell脚本自动化

    最近工作需要用到对硬盘进行shell脚本自动化分区和mount的操作,google了一些资料,下面做个总结. 如果硬盘没有进行分区(逻辑分区或者扩展分区,关于两者概念,自行google),我们将无法将 ...

  8. Shell脚本一键部署——源码编译安装MySQL及自动补全工具

    Shell脚本一键部署--源码编译安装MySQL及自动补全工具 编译安装MySQL 1.软件包 Mysql安装包 将安装包拖至/opt目录下,编辑一个脚本文件,将以下内容复制进去,然后source或者 ...

  9. 使用 Shell 脚本自动化 Linux 系统维护任务

    如果一个系统管理员花费大量的时间解决问题以及做重复的工作,你就应该怀疑他这么做是否正确.一个高效的系统管理员应该制定一个计划使得其尽量花费少的时间去做重复的工作.因此尽管看起来他没有做很多的工作,但那 ...

随机推荐

  1. Liunx面试题

    答案待定 1.请用shell查询file1 里面空行的所在行号2.编写ShellScript查询file1 以abc 结尾的行3.打印出file1 文件第1 到第3 行4.如何将本地80 端口的请求转 ...

  2. Hyper-V 与Broadcom网卡兼容问题

    最近在测虚拟机时,碰到一个网卡和Hyper-V不兼容问题,现在共享给大家参考,希望对大家有帮忙. 故障描述: Dell R720 Windows 2012操作系统下的Hyper-V环境后,虚拟机网络速 ...

  3. CentOS7.2 创建本地YUM源和局域网YUM源

    1背景 由于开发环境只有局域网,没法使用网上的各种YUM源,来回拷贝rpm包安装麻烦,还得解决依赖问题. 想着搭建个本地/局域网YUM源,方便自己跟同事安装软件. 2环境 [root@min-base ...

  4. swift:谈谈swift几种常见属性的区别

    一.前奏 Swift作为一门新语言,经过几年的发展,逐渐趋于完善,目前已经更新到3.0版本,它汇集许多其他语言的特点,例如JS.Paython.C++等,完全区别于OC.个人感觉它没有完全的OOP和O ...

  5. 添加到SQLAgentReaderRole角色后报拒绝SELECT权限

    最近有点大意,同事需要查看作业的权限,"理所当然"就将对应登录名添加到SQLAgentReaderRole角色. msdb的SQLAgentReaderRole数据库角色的成员继承 ...

  6. openfire更改数据库

    修改openfire安装目录下./conf/openfire.xml <setup>true</setup>中的true为false,重新启动,然后配置

  7. ms-sql关联表操作

    1.创建数据库employee : create database employee;2.创建员工表EMP:use employee;create table EMP( id int,sex varc ...

  8. Web自动化测试工具调研

    背景 Web自动化测试越来越被重视, 因为现在Web已经是工程化的状态. 如何通过工具测试, 保证Web开发的质量,提升开发效率,是Web工具的诞生的来由. Web测试分为以下几个方面: 1. 界面测 ...

  9. smarty 模板几个例子

    一.assign和display方法的使用以及几个变量调节器 header("content-type:text/html;charset=utf-8");//加载Smarty引擎 ...

  10. JAVA静态代码审查之checkstyle

    技术总监来巡查,刚巧前段时间遇到了一个问题还没解决,就拉着大牛开问.结果,问题是解决了,还附带了另一个问题,或是要求出来,没啥技术含量,但是很麻烦的一个东西:代码格式. 之前我写代码,因为屏幕比较小, ...