Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Hbase Learning Notes 1 Mui-simple summary of script

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Recently, I have learned the relevant knowledge of hbase, and I have also taken a look at the scripts under hbase's bin/ directory. I don't understand many of the details of the scripts. I have an understanding of the general outline. Let's make a summary of the study:

. the "$bin" / hbase-config.sh calling script hbase-config.sh loads the relevant environment variables, and the hbase-config.sh script also calls the conf/hbase-env.sh script.

The script then starts different services by determining whether it is in distributed mode (and invokes the script hbase)

DistMode= `$ bin/hbase--config "$HBASE_CONF_DIR" org.apache.hadoop.hbase.util.HBa

SeConfToolhbase.cluster.distributed | head-n 1`

If ["$distMode" = = 'false']

Then

"$bin" / hbase-daemon.sh-- config "${HBASE_CONF_DIR}" start master / / if not in distributed mode, only start master

Else

"$bin" / hbase-daemons.sh-- config "${HBASE_CONF_DIR}" start zookeeper

"$bin" / hbase-daemon.sh-- config "${HBASE_CONF_DIR}" start master

"$bin" / hbase-daemons.sh-- config "${HBASE_CONF_DIR}"\

-- hosts "${HBASE_REGIONSERVERS}" start regionserver

"$bin" / hbase-daemons.sh-- config "${HBASE_CONF_DIR}"\

-- hosts "${HBASE_BACKUP_MASTERS}" start master-backup

Fi

As can be seen from the above script, starting master calls script hbase-daemon.sh, while starting zookeeper, regionserver, and master-backup services calls script hbase-daemons.sh.

At the same time, you can also see the startup sequence of each service in distributed mode:

(zookeeper,master,regionserver,master-backup)

In the hbase-daemons.sh script, you can see that three zookeepers.sh regionservers.sh master-backup.sh scripts are called to start the three zookeeper,regionserver,master-backup services.

Case $command in

(zookeeper)

Exec "$bin/zookeepers.sh" $args

(master-backup)

Exec "$bin/master-backup.sh" $args

(*)

Exec "$bin/regionservers.sh" $args

Esac

It is very simple and straightforward for hbase to stop the service. Kill-0 `cat $pid`, check the script stop-hbase.sh

You can see that the script hbase is called first:

Nohup nice-n ${HBASE_NICENESS:-0} "$HBASE_HOME" / bin/hbase\

-- config "${HBASE_CONF_DIR}"\

Master stop "$@" > "$logout" 2 > & 1 < / dev/null &

Then determine whether it is in distributed mode, and if so, stop the master-backup and zookeeper services by calling hbase-daemon.sh

If ["$distMode" = = 'true']

Then

# TODO: store backup mastersin ZooKeeper and have the primary send them a shu

Tdown message

# stop any backup masters

"$bin" / hbase-daemons.sh-- config "${HBASE_CONF_DIR}"\

-- hosts "${HBASE_BACKUP_MASTERS}" stop master-backup

"$bin" / hbase-daemons.sh-- config "${HBASE_CONF_DIR}" stop zookeeper

Fi

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report