#!/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. Preference Screen 首选项

     设置Preference Screen (res\xml\userpreferences.xml) <?xml version="1.0" encoding="u ...

  2. int型时间字符串转日期

    string re ="201611"; DateTime d1 = DateTime.ParseExact(re, "yyyyMMdd", null);

  3. python Gunicorn

    1. 简介 Gunicorn(Green Unicorn)是给Unix用的WSGI HTTP 服务器,它与不同的web框架是非常兼容的.易安装.轻.速度快. 2. 示例代码1 def app(envi ...

  4. leetcode bugfree note

    463. Island Perimeterhttps://leetcode.com/problems/island-perimeter/就是逐一遍历所有的cell,用分离的cell总的的边数减去重叠的 ...

  5. C#操作Mongodb的心得

    Mongodb是一个强大的文档型数据库,采用BSON的数据格式.本文主要采用其官方的C#驱动来操作其表中的集合.驱动版本为1.1.0,下载地址为: http://mongodb.github.io/m ...

  6. Leetcode: Heaters

    Winter is coming! Your first job during the contest is to design a standard heater with fixed warm r ...

  7. Testlink安装问题收录

    1.windows下安装testlink,进入安装页面后,在检查一些相关配置环境时报错,如下:     Checking if /var/testlink/logs/ directory exists ...

  8. 显示textarea内容的时候没有自动换行

    显示textarea内容的时候没有自动换行,网上找了好久,在一个论坛里找到解决方法: 1.把从数据库读出来的内容存放在一个Div内,例如: <div class="new-commen ...

  9. 。。。IO流学习之二。。。

    fileReader的用法: import static org.junit.Assert.*; import java.io.File; import java.io.FileNotFoundExc ...

  10. ZOJ-1239 Hanoi Tower Troubles Again!

    链接:ZOJ1239 Hanoi Tower Troubles Again! Description People stopped moving discs from peg to peg after ...