CentOS environment settings Hbase from the start

1, create a file in /etc/init.d/ directory hbase

#!/bin/bash
# chkconfig: 345 63 37

#export JAVA_HOME=/usr/local/jdk1.8.0_191

HBASE_HOME=/usr/local/hbase-1.2.12

case "$1" in
    start)
        $HBASE_HOME/bin/start-hbase.sh
        ;;
    stop)
        $HBASE_HOME/bin/stop-hbase.sh
        ;;
    restart)
        $HBASE_HOME/bin/start-hbase.sh
        sleep 1
        $HBASE_HOME/bin/stop-hbase.sh
        ;;
    *)
        echo "Usage: $0 {start|stop|restart}"
        ;;

esac
exit 0

If hbase-env.sh not configured JAVA_HOME environment variable to cancel red annotation above, open JAVA_HOME environment variable

2, to authorize hbase file

chmod 777 tomcat

3, startup, shutdown, restart service hbase

service hbase start // Start hbase service 
service hbase stop // close hbase service 
service hbase restart // restart the service hbase

4, set to open or start the service does not start hbase

chkconfig hbase on // set the boot 
chkconfig hbase off // close the boot

 

Guess you like

Origin www.cnblogs.com/zhi-leaf/p/11425264.html