hadoop集群管理脚本:
- diy-ssh.sh==> ssh免密登录
- diy-syn.sh==> 同步节点配置文件
- diy-op.sh==> jps查看进程, 更新时间日期
- diy-kill.sh==> 杀死某进程,如 hmaster
part1: 免密登录脚本
#!/bin/bash
#生成秘钥,登录localhost
if [ ! -d ~/.ssh ]
then
mkdir ~/.ssh
fi
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
ssh-copy-id localhost
#登录集群
while [ $# != 0 ]
do
echo "param=> $1 "
ssh-copy-id $1
shift
done