• zookeeper启动脚本


    启动脚本

    #!/bin/sh
      
    #zookeeper节点
    zookeeperServers='192.168.221.102 192.168.221.103 192.168.221.104'
    
    #启动所有zookeeper节点
    for zoo in $zookeeperServers
    do
        ssh -T $zoo <<EOF
            /usr/local/software/zookeeper/zookeeper-3.5.5/bin/zkServer.sh start
    EOF
    echo 从节点 $zoo 启动zookeeper...[ done ]
    sleep 1
    done
    

    停止脚本

    #!/bin/sh
      
    #zookeeper节点
    zookeeperServers='192.168.221.102 192.168.221.103 192.168.221.104'
    
    #停止所有zookeeper节点
    for zoo in $zookeeperServers
    do
        ssh -T $zoo <<EOF
            /usr/local/software/zookeeper/zookeeper-3.5.5/bin/zkServer.sh stop
    EOF
    echo 从节点 $zoo 停止zookeeper...[ done ]
    done
    

    xsync的拷贝脚本

    #!/bin/bash
    #1 获取输入参数个数,如果没有参数,直接退出
    pcount=$#
    if((pcount==0)); then
    echo no args;
    exit;
    fi
    
    #2 获取文件名称
    p1=$1
    fname=`basename $p1`
    echo fname=$fname
    
    #3 获取上级目录到绝对路径
    pdir=`cd -P $(dirname $p1); pwd`
    echo pdir=$pdir
    
    #4 获取当前用户名称
    user=`whoami`
    
    #5 循环
    for((host=102; host<105; host++)); do
            echo ------------------- hadoop$host --------------
            rsync -rvl $pdir/$fname $user@hadoop$host:$pdir
    done
    
  • 相关阅读:
    nano编辑器__vi常用命令
    pyCharm最新2018激活方式(记录)
    一、centos7.4安装docker
    C#备份及还原数据库的实现
    System.Drawing.image 与ImageSource 互转
    Socket 异步通信
    图片与base64的互转
    程序中编写log日志
    SQLHelper
    Cond
  • 原文地址:https://www.cnblogs.com/szls-666/p/12494152.html
Copyright © 2020-2023  润新知