Shell脚本实现自动安装zookeeper
A:本脚本运行的机器,LinuxRHEL6
B,C,D,...:待安装zookeepercluster的机器,LinuxRHEL6
首先在脚本运行的机器A上确定可以ssh无密码登录到待安装zk的机器B,C,D,...上,然后就可以在A上运行本脚本:
$./install_zookeeper
前提:
B,C,D机器必须配置好repo,本脚本使用的是cdh5的repo,下面的内容保存到:/etc/yum.repos.d/cloudera-cdh5.repo:
[cloudera-cdh5] #PackagesforCloudera'sDistributionforHadoop,Version5,onRedHatorCentOS6x86_64 name=Cloudera'sDistributionforHadoop,Version5 baseurl=http://archive.cloudera.com/cdh5/redhat/6/x86_64/cdh/5/ gpgkey=http://archive.cloudera.com/cdh5/redhat/6/x86_64/cdh/RPM-GPG-KEY-cloudera gpgcheck=1 enabled =1