HBase 部署
启动zookeeper
[root@hadoop103 zookeeper-3.5.7]# zk.sh start ---------- zookeeper hadoop102 启动 ------------ ZooKeeper JMX enabled by default Using config: /opt/module/zookeeper-3.5.7/bin/../conf/zoo.cfg Starting zookeeper ... STARTED ---------- zookeeper hadoop103 启动 ------------ ZooKeeper JMX enabled by default Using config: /opt/module/zookeeper-3.5.7/bin/../conf/zoo.cfg Starting zookeeper ... STARTED ---------- zookeeper hadoop104 启动 ------------ ZooKeeper JMX enabled by default Using config: /opt/module/zookeeper-3.5.7/bin/../conf/zoo.cfg Starting zookeeper ... STARTED
启动hadoop集群
[root@hadoop103 zookeeper-3.5.7]# myhadoop.sh start =================== 启动 hadoop集群 =================== --------------- 启动 hdfs --------------- WARNING: HADOOP_SECURE_DN_USER has been replaced by HDFS_DATANODE_SECURE_USER. Using value of HADOOP_SECURE_DN_USER. Starting namenodes on [hadoop102] Last login: Fri Sep 2 11:27:24 EDT 2022 Starting datanodes Last login: Fri Sep 2 12:33:16 EDT 2022 Starting secondary namenodes [hadoop104] Last login: Fri Sep 2 12:33:19 EDT 2022 2022-09-02 12:33:39,363 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable --------------- 启动 yarn --------------- Starting resourcemanager Last login: Fri Sep 2 11:27:14 EDT 2022 Starting nodemanagers Last login: Fri Sep 2 12:33:41 EDT 2022 --------------- 启动 historyserver --------------
解压 HBase
[root@hadoop102 module]# tar -zxvf hbase-1.3.1-bin.tar.gz -C /opt/module/
1)hbase-env.sh 修改内容:
[root@hadoop102 conf]# vim hbase-env.sh (处理下面两行其他全部注释) export JAVA_HOME=/opt/module/jdk1.8.0_212 export HBASE_MANAGES_ZK=false
2)hbase-site.xml 修改内容:(端口号应该和 hdfs 一样)
<configuration> <property> <name>hbase.rootdir</name> <value>hdfs://hadoop102:8020/HBase</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <!-- 0.98 后的新变动,之前版本没有.port,默认端口为 60000 --> <property> <name>hbase.master.port</name> <value>16000</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>hadoop102,hadoop103,hadoop104</value> </property> <property> <name>hbase.zookeeper.property.dataDir</name> <value>/opt/module/zookeeper-3.4.10/zkData</value> </property> </configuration>
3)regionservers:
hadoop102 hadoop103 hadoop104
4)软连接 hadoop 配置文件到 HBase:
[root@hadoop102 conf]# ln -s /opt/module/hadoop-3.1.3/etc/hadoop/core-site.xml /opt/module/hbase-1.3.1/conf/core-site.xml
[root@hadoop102 conf]# ln -s /opt/module/hadoop-3.1.3/etc/hadoop/hdfs-site.xml /opt/module/hbase-1.3.1/conf/hdfs-site.xml
时间同步才能启动 HBase
yum install ntp ntpdate -y
Hbase启动时,出现警告:
[hadoop@hadoop000 ~]$ start-hbase.sh starting master, logging to /home/hadoop/app/hbase-1.2.0-cdh5.7.0/logs/hbase-hadoop-master-hadoop000.out Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0 hadoop000: starting regionserver, logging to /home/hadoop/app/hbase-1.2.0-cdh5.7.0/bin/../logs/hbase-hadoop-regionserver-hadoop000.out
将两个 export 注释掉即可。
# Configure PermSize. Only needed in JDK7. You can safely remove it for JDK8+ export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m" export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m"
时间同步!!!
HBase停止节点报错“pid不存在 ”