美文网首页
gluster-add-to-cluster.sh

gluster-add-to-cluster.sh

作者: Kate_Blog | 来源:发表于2018-11-28 00:54 被阅读11次
    #!/bin/bash
    
    # description : 在 swarm-manager 节点上配置,将 节点 加入到 集群中, swarm-manager机器执行脚本
    # 给脚本授权gluster-add-to-cluster.sh , 跑之前把防火墙关了,并修改/etc/hosts文件
    # systemctl stop firewalld
    # systemctl status firewalld
    # run : sh gluster-add-to-cluster.sh
    # author : kate
    # date : 2018-07-10
    
    systemctl stop firewalld
    if [ $? -ne 0 ]; then
            echo "systemctl stop firewalld, failed!"
    else
           echo " systemctl stop firewalld, success!"
    fi
    systemctl status firewalld
    
     gluster peer probe swarm-manager
    if [ $? -ne 0 ]; then
            echo " gluster peer probe swarm-manager, failed!"
            exit 1
    else
       echo " gluster peer probe swarm-manager, success!"
    fi
    
    gluster peer probe swarm-node-1
    if [ $? -ne 0 ]; then
            echo " gluster peer probe swarm-node-1, failed!"
            exit 1
    else
       echo " gluster peer probe swarm-node-1, success!"
    fi
    
    gluster peer probe swarm-node-2
    if [ $? -ne 0 ]; then
            echo " gluster peer probe swarm-node-2, failed!"
            exit 1
    else
       echo " gluster peer probe swarm-node-2, success!"
    fi
    

    相关文章

      网友评论

          本文标题:gluster-add-to-cluster.sh

          本文链接:https://www.haomeiwen.com/subject/pldwqqtx.html