作者:土人甜层_233 | 来源:互联网 | 2023-10-11 12:05
Hbase集群启动流程共有三个节点:hmaster、hslave1、hslave2,三个节点上都安装有:zookeeper、Hadoop、Hbase。启动顺序:zookeeper(每
Hbase集群启动流程
共有三个节点:hmaster、hslave1、hslave2,三个节点上都安装有: zookeeper、Hadoop、Hbase。
启动顺序:
zookeeper(每一台)-> Hadoop(主节点) -> Hbase(主节点)
在三个节点上依次启动zookeeper。需要现切换到预先设置的hbase指定用户。
[hbase@hmaster bin]$ ./zkServer.sh start
JMX enabled by default
Using config: /home/hbase/hb/zookeeper-3.4.5/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
三个节点会自动选举出来一个leader ,剩下的都是follower.
[hbase@hmaster bin]$ ./zkServer.sh status
JMX enabled by default
Using config: /home/hbase/hb/zookeeper-3.4.5/bin/../conf/zoo.cfg
Mode: follower
[hbase@hmaster bin]$ jps
1926 QuorumPeerMain
2001 Jps
在主节点启动Hadoop。
[hbase@hmaster bin]$ cd ../../hadoop-1.2.1/bin/
[hbase@hmaster bin]$ ./start-all.sh
starting namenode, logging to /home/hbase/hb/hadoop-1.2.1/libexec/../logs/hadoop-hbase-namenode-hmaster.out
hslave1: starting datanode, logging to /home/hbase/hb/hadoop-1.2.1/libexec/../logs/hadoop-hbase-datanode-hslave1.out
hslave2: starting datanode, logging to /home/hbase/hb/hadoop-1.2.1/libexec/../logs/hadoop-hbase-datanode-hslave2.out
hmaster: starting secondarynamenode, logging to /home/hbase/hb/hadoop-1.2.1/libexec/../logs/hadoop-hbase-secondarynamenode-hmaster.out
starting jobtracker, logging to /home/hbase/hb/hadoop-1.2.1/libexec/../logs/hadoop-hbase-jobtracker-hmaster.out
hslave2: starting tasktracker, logging to /home/hbase/hb/hadoop-1.2.1/libexec/../logs/hadoop-hbase-tasktracker-hslave2.out
hslave1: starting tasktracker, logging to /home/hbase/hb/hadoop-1.2.1/libexec/../logs/hadoop-hbase-tasktracker-hslave1.out
通过jps命令可以看到,主节点上启动了NameNode服务,而从节点上启动了DataNode服务
[hbase@hmaster bin]$ jps
2511 Jps
2082 NameNode
1926 QuorumPeerMain
2389 JobTracker
2280 SecondaryNameNode
3.在主节点上启动Hbase
[hbase@hmaster bin]$ cd ../../hbase-0.94.27/bin/
[hbase@hmaster bin]$ ./start-hbase.sh
starting master, logging to /home/hbase/hb/hbase-0.94.27/bin/../logs/hbase-hbase-master-hmaster.out
hslave1: starting regionserver, logging to /home/hbase/hb/hbase-0.94.27/bin/../logs/hbase-hbase-regionserver-hslave1.out
hslave2: starting regionserver, logging to /home/hbase/hb/hbase-0.94.27/bin/../logs/hbase-hbase-regionserver-hslave2.out
通过jps可以查看到在主节点上启动了HMaster服务,而从节点上启动了HRegionServer服务。
2082 NameNode
1926 QuorumPeerMain
2389 JobTracker
2280 SecondaryNameNode
2665 HMaster
2804 Jps
4.如果要启动thrift接口,也需要在每个节点上开启thrift。
[hbase@hmaster bin]$ ./hbase-daemon.sh start thrift
starting thrift, logging to /home/hbase/hb/hbase-0.94.27/bin/../logs/hbase-hbase-thrift-hmaster.out
[hbase@hmaster bin]$ jps
2082 NameNode
1926 QuorumPeerMain
2389 JobTracker
2865 ThriftServer
2935 Jps
2280 SecondaryNameNode
2665 HMaster