一 Linux环境搭建
1 关闭防火墙
2 配置IP、DNS
3 配置主机名
4 设置SSH免密码登录
5 安装JDK
二 Hadoop环境搭建
1 下载Hadoop
2 配置HDFS、YARN
3 格式化
4 启动并测试
三 HBase环境搭建
1 HBase与Java版本对应关系
2 HBase与Hadoop对应关系
3 查看系统的Hadoop版本和JDK版本
[root@centos bin]# hadoop version
Hadoop 2.7.4
Subversion https://shv@git-wip-us.apache.org/repos/asf/hadoop.git -r cd915e1e8d9d0131462a0b7301586c175728a282
Compiled by kshvachk on 2017-08-01T00:29Z
Compiled with protoc 2.5.0
From source with checksum 50b0468318b4ce9bd24dc467b7ce1148
This command was run using /opt/hadoop-2.7.4/share/hadoop/common/hadoop-common-2.7.4.jar
[root@centos bin]# java -version
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
4 下载网站
Hbase 1.2.6版本满足JDK 1.8和Hadoop 2.7.4的
配套关系,我们下载Hbase1.2这个版本
下载包:hbase-1.2.6-bin.tar.gz
5 解压安装hbase-1.2.6-bin.tar.gz
[root@centos opt]# tar -zxf hbase-1.2.6-bin.tar.gz
[root@centos opt]# ls
docker hbase-1.2.6
eclipse hbase-1.2.6-bin.tar.gz
eclipse-jee-neon-1a-linux-gtk-x86_64.tar.gz jdk1.8
hadoop-1.2.1 jdk-8u152-linux-x64.tar.gz
hadoop-1.2.1.tar.gz mysqldb
hadoop-2.7.4 rh
hadoop-2.7.4.tar
6 修改配置文件hbase-env.sh
# The java implementation to use. Java 1.7+ required.
export JAVA_HOME=/opt/jdk1.8
7 配置hbase-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
/**
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://192.168.0.102:8020/hbase</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/opt/hbase-1.2.6/data/zkData</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
</configuration>
8 配置regionservers文件
192.168.0.102
9 启动Hbase
[root@centos hadoop-2.7.4]# jps
4240 DataNode
4113 NameNode
4404 SecondaryNameNode
4932 Jps
4567 ResourceManager
4681 NodeManager
[root@centos hadoop-2.7.4]# cd /opt/hbase-1.2.6/
[root@centos hbase-1.2.6]# bin/hbase-daemon.sh start zookeeper
starting zookeeper, logging to /opt/hbase-1.2.6/bin/../logs/hbase-root-zookeeper-centos.out
[root@centos hbase-1.2.6]# bin/hbase-daemon.sh start master
starting master, logging to /opt/hbase-1.2.6/bin/../logs/hbase-root-master-centos.out
[root@centos hbase-1.2.6]# bin/hbase-daemon.sh start regionserver
starting regionserver, logging to /opt/hbase-1.2.6/bin/../logs/hbase-root-regionserver-centos.out
[root@centos hbase-1.2.6]# jps
4240 DataNode
4113 NameNode
5137 HMaster
5505 Jps
5026 HQuorumPeer
5315 HRegionServer
4404 SecondaryNameNode
4567 ResourceManager
4681 NodeManager
10 测试webui
四 HBase运行体系结构
五 参考