HBase启动脚本(start-hbase)
cd /usr/local/bin
sudo vi start-hbase
脚本内容如下:
#!/bin/bash
HBASE_HOME=/home/vagrant/modules/hbase-1.2.5
echo "start hbase-------------------------------------------------"
for i in bigdata-node1
do
ssh $i "source /etc/profile;${HBASE_HOME}/bin/start-hbase.sh"
done
sleep 10s
jpsx
exit 0
设置脚本执行权限:
sudo chmod +x start-hbase
sudo chown vagrant:vagrant start-hbase
HBase停止脚本(stop-hbase)
cd /usr/local/bin
sudo vi stop-hbase
脚本内容如下:
#!/bin/bash
HBASE_HOME=/home/vagrant/modules/hbase-1.2.5
echo "stop hbase-------------------------------------------------"
for i in bigdata-node1
do
ssh $i "source /etc/profile;${HBASE_HOME}/bin/stop-hbase.sh"
done
sleep 10s
jpsx
exit 0
设置脚本执行权限:
sudo chmod +x stop-hbase
sudo chown vagrant:vagrant stop-hbase
分发(选做):
# 使用root账户分发至其他节点
sudo scp -r /usr/local/bin/*-hbase root@bigdata-node2:/usr/local/bin/
sudo scp -r /usr/local/bin/*-hbase root@bigdata-node3:/usr/local/bin/