Hbase-2.0.0_01_安装部署
该文章是基于 Hadoop2.7.6_01_部署 进行的
1. 主机规划
|
主机名称 |
IP信息 |
内网IP |
操作系统 |
安装软件 |
备注:运行程序 |
|
mini01 |
10.0.0.11 |
172.16.1.11 |
CentOS 7.4 |
jdk、hadoop、zookeeper、hbase |
QuorumPeerMain、NameNode、HMaster |
|
mini02 |
10.0.0.12 |
172.16.1.12 |
CentOS 7.4 |
jdk、hadoop、zookeeper、hbase |
QuorumPeerMain、ResourceManager、HMaster |
|
mini03 |
10.0.0.13 |
172.16.1.13 |
CentOS 7.4 |
jdk、hadoop、zookeeper、hbase |
QuorumPeerMain、DataNode、NodeManager、HRegionServer |
|
mini04 |
10.0.0.14 |
172.16.1.14 |
CentOS 7.4 |
jdk、hadoop、zookeeper、hbase |
QuorumPeerMain、DataNode、NodeManager、HRegionServer |
|
mini05 |
10.0.0.15 |
172.16.1.15 |
CentOS 7.4 |
jdk、hadoop、zookeeper、hbase |
QuorumPeerMain、DataNode、NodeManager、HRegionServer |
2. Zookeeper部署
共部署5台,所以在mini01~mini05都得部署
2.1. 配置信息
[yun@mini01 conf]$ pwd
/app/zookeeper/conf
[yun@mini01 conf]$ cat zoo.cfg
#单个客户端与单台服务器之间的连接数的限制,是ip级别的,默认是60,如果设置为0,那么表明不作任何限制。
maxClientCnxns=
# The number of milliseconds of each tick
tickTime=
# The number of ticks that the initial
# synchronization phase can take
initLimit=
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
# dataDir=/tmp/zookeeper
dataDir=/app/bigdata/zookeeper/data
# the port at which the clients will connect
clientPort=
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=
# Purge task interval in hours
# Set to "" to disable auto purge feature
#autopurge.purgeInterval= # leader和follow通信端口和投票选举端口
server.=mini01::
server.=mini02::
server.=mini03::
server.=mini04::
server.=mini05::
2.2. 添加myid文件
[yun@mini01 data]$ pwd
/app/bigdata/zookeeper/data
[yun@mini01 data]$ ll
total
-rw-r--r-- yun yun May : myid
drwxr-xr-x yun yun Jun : version-
[yun@mini01 data]$ cat myid # 其中mini01的myid 为1;mini02的myid 为2;mini03的myid 为3;mini04的myid 为4;mini05的myid 为5
2.3. 环境变量
[root@mini01 profile.d]# pwd
/etc/profile.d
[root@mini01 profile.d]# cat zk.sh
export ZK_HOME="/app/zookeeper"
export PATH=$ZK_HOME/bin:$PATH [root@mini01 profile.d]# logout
[yun@mini01 conf]$ source /etc/profile # 重新加载环境变量
2.4. 启动zk服务
# 依次在启动mini01、mini02、mini03、mini04、mini05 zk服务
[yun@mini01 zookeeper]$ pwd
/app/zookeeper
[yun@mini01 zookeeper]$ zkServer.sh start
JMX enabled by default
Using config: /app/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
建议在 /app/zookeeper,因为在启动时,会有相关日志产生
[yun@mini01 zookeeper]$ pwd
/app/zookeeper
[yun@mini01 zookeeper]$ ll zookeeper.out
-rw-rw-r-- yun yun Aug : zookeeper.out
2.5. 查询运行状态
# 其中mini01、mini02、mini04、mini05状态如下
[yun@mini01 zookeeper]$ zkServer.sh status
JMX enabled by default
Using config: /app/zookeeper/bin/../conf/zoo.cfg
Mode: follower # 其中mini03 状态如下
[yun@mini03 zookeeper]$ zkServer.sh status
JMX enabled by default
Using config: /app/zookeeper/bin/../conf/zoo.cfg
Mode: leader
3. Hbase部署与配置修改
3.1. 软件部署
[yun@mini01 software]$ pwd
/app/software
[yun@mini01 software]$ tar xf hbase-2.0.-bin.tar.gz
[yun@mini01 software]$ mv hbase-2.0. /app/
[yun@mini01 software]$ cd
[yun@mini01 ~]$ ln -s hbase-2.0./ hbase
3.2. 环境变量
注意所有部署hbase的机器【mini01、mini02、mini03、mini04、mini05】都需要该环境变量
[root@mini01 profile.d]# pwd
/etc/profile.d
[root@mini01 profile.d]# cat hbase.sh # 也可以直接写在 /etc/profile 文件中
export HBASE_HOME="/app/hbase"
export PATH=$HBASE_HOME/bin:$PATH [root@mini01 profile.d]# logout
[yun@mini01 hbase]$ source /etc/profile # 使用yun用户,并重新加载环境变量
3.3. hbase-env.sh 修改
[yun@mini01 conf]$ pwd
/app/hbase/conf
[yun@mini01 conf]$ cat hbase-env.sh
#!/usr/bin/env bash
………………
# The java implementation to use. Java 1.8+ required.
# export JAVA_HOME=/usr/java/jdk1.8.0/
export JAVA_HOME=${JAVA_HOME} # Extra Java CLASSPATH elements. Optional. # hadoop配置文件的位置
# export HBASE_CLASSPATH=
export HBASE_CLASSPATH=${HADOOP_HOME}/etc/hadoop/
………………
# Tell HBase whether it should manage it's own instance of ZooKeeper or not.
# 如果使用独立安装的zookeeper这个地方就是false
# export HBASE_MANAGES_ZK=true
export HBASE_MANAGES_ZK=false
………………
3.4. hbase-site.xml 修改
[yun@mini01 conf]$ pwd
/app/hbase/conf
[yun@mini01 conf]$ cat hbase-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
/**
*
………………
*/
-->
<configuration>
<property>
<name> hbase.master.port</name> <!-- hbasemaster的端口 -->
<value></value>
</property>
<property>
<name>hbase.tmp.dir</name> <!-- hbase 临时存储 -->
<value>/app/hbase/tmp</value>
</property>
<property>
<name>hbase.master.maxclockskew</name> <!-- 时间同步允许的时间差 单位毫秒 -->
<value></value>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://mini01:9000/hbase</value> <!-- hbase共享目录,持久化hbase数据 存放在对应的HDFS上 -->
</property>
<property>
<name>hbase.cluster.distributed</name> <!-- 是否分布式运行,false即为单机 -->
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name> <!-- zookeeper端口 -->
<value></value>
</property>
<property>
<name>hbase.zookeeper.quorum</name> <!-- zookeeper地址 -->
<value>mini01,mini02,mini03,mini04,mini05</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name> <!-- zookeeper配置信息快照的位置 -->
<value>/app/hbase/tmp/zookeeper</value>
</property>
</configuration>
3.5. regionservers 修改
[yun@mini01 conf]$ pwd
/app/hbase/conf
[yun@mini01 conf]$ cat regionservers # 从机器的域名
mini03
mini04
mini05
4. Hbase的分发与启动
注意:启动hbase之前,必须保证hadoop集群和zookeeper集群是可用的。
4.1. hbase分发到其他机器
将 /app/hbase-2.0.0 从mini01 分发到mini02【用于HA】、mini03、mini04、mini05
其中配置不需要任何修改
scp hbase-2.0. yun@mini02:/app
scp hbase-2.0. yun@mini03:/app
scp hbase-2.0. yun@mini04:/app
scp hbase-2.0. yun@mini05:/app
分发完毕后,记得登录不同的主机然后创建软连接
[yun@mini02 ~]$ pwd
/app
[yun@mini02 ~]$ ln -s hbase-2.0./ hbase
4.2. 启动程序
[yun@mini01 ~]$ start-hbase.sh
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/app/hbase-2.0./lib/slf4j-log4j12-1.7..jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/app/hadoop-2.7./share/hadoop/common/lib/slf4j-log4j12-1.7..jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
running master, logging to /app/hbase/logs/hbase-yun-master-mini01.out
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/app/hbase-2.0./lib/slf4j-log4j12-1.7..jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/app/hadoop-2.7./share/hadoop/common/lib/slf4j-log4j12-1.7..jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
mini05: running regionserver, logging to /app/hbase/bin/../logs/hbase-yun-regionserver-mini05.out
mini04: running regionserver, logging to /app/hbase/bin/../logs/hbase-yun-regionserver-mini04.out
mini03: running regionserver, logging to /app/hbase/bin/../logs/hbase-yun-regionserver-mini03.out
master进程
[yun@mini01 ~]$ jps
SecondaryNameNode
NameNode
HMaster
QuorumPeerMain
Jps
slave进程
[yun@mini04 ~]$ jps
Jps
QuorumPeerMain
NodeManager
DataNode
HRegionServer
4.3. zk中的信息
[zk: localhost:(CONNECTED) ] ls /hbase
[replication, meta-region-server, rs, splitWAL, backup-masters, table-lock, flush-table-proc, master-maintenance, online-snapshot, switch, master, running, draining, namespace, hbaseid, table]

[zk: localhost:(CONNECTED) ] ls /hbase/rs
[mini03,,, mini05,,, mini04,,]
4.4. 浏览器访问
http://mini01:16010

5. Hbase的HA
根据规划,mini01和mini02为Hmaster,其中mini01的Hmaster已经起来了
5.1. 启动另一个HMaster
[yun@mini02 ~]$ hbase-daemon.sh start master # 在mini02起一个 HMaster
running master, logging to /app/hbase/logs/hbase-yun-master-mini02.out
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/app/hbase-2.0./lib/slf4j-log4j12-1.7..jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/app/hadoop-2.7./share/hadoop/common/lib/slf4j-log4j12-1.7..jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
[yun@mini02 ~]$
[yun@mini02 ~]$ jps
Jps
ResourceManager
QuorumPeerMain
HMaster
5.2. zk中的信息
[zk: localhost:(CONNECTED) ] ls /hbase/backup-masters
[mini02,,]
5.3. 浏览器访问
http://mini02:16010

Hbase-2.0.0_01_安装部署的更多相关文章
- kafka_2.11-2.0.0_安装部署
参考博文:kafka 配置文件参数详解 参考博文:Kafka[第一篇]Kafka集群搭建 参考博文:如何为Kafka集群选择合适的Partitions数量 参考博文:Kafka Server.prop ...
- HBase的概述和安装部署
一.HBase概述 1.HBase是Hadoop数据库,是一个分布式.可扩展的大数据存储. HBase是用于对大数据进行随机.实时读写访问的非关系型数据库,它的目标托管非常大的表——数十亿行N百万列. ...
- Storm-0.9.0.1安装部署 指导
可以带着下面问题来阅读本文章: 1.Storm只支持什么传输 2.通过什么配置,可以更改Zookeeper默认端口 3.Storm UI必须和Storm Nimbus部署在同一台机器上,UI无法正常工 ...
- 大数据篇:DolphinScheduler-1.2.0.release安装部署
大数据篇:DolphinScheduler-1.2.0.release安装部署 1 配置jdk #查看命令 rpm -qa | grep java #删除命令 rpm -e --nodeps xxx ...
- [DPI][suricata] suricata-4.0.3 安装部署
suricata 很值得借鉴.但是首先还是要安装使用,作为第一步的熟悉. 安装文档:https://redmine.openinfosecfoundation.org/projects/suricat ...
- zabbix4.0.1 安装部署
zabbix安装部署 目录 一.环境准备... 3 1.1.版本:... 3 1.2.部署环境... 3 二.安装部署... 3 2.1.zabbix安装... 3 2.1.1.下载zabbix的rp ...
- presto 0.166安装部署
系统:linux java:jdk 8,64-bit Connector:hive 分布式,node1-3 node1:Coordinator . Discovery service node2-3: ...
- Hadoop1.0.3安装部署
0x00 大数据平台相关链接 官网:http://hadoop.apache.org/ 主要参考教程:http://www.cnblogs.com/xia520pi/archive/2012/05/1 ...
- jumperserver3.0的安装部署
适用于jumperserver版本:v0.3.1-2 官网:http://www.jumpserver.org/ 系统:centos7.2 基本安装 备注:如果是centos系统最好使用基本安装,否 ...
随机推荐
- 【Android】为需要支持API 11之前的Activity添加Action Bar的一种解决方案
首先汗一个,题目打出来我就觉得像是在写论文…… 家里生了个娃,好久没有写东西了…… 做Android开发有一个很头疼的地方就是随着sdk的演进,很多新东西被加进来.但由于这样那样的限制, 不是所有的新 ...
- mysql使其支持插入中文数据的办法
1.找到安装的文件夹C:\Program Files (x86)\MySQL\MySQL Server 5.0 2.修改文件夹下的my.ini文件: 找到画黄线的这一字段 将后面改为utf8 这个过程 ...
- 只知道ajax?你已经out了
欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文由前端林子发表于云+社区专栏 随着前端技术的发展,请求服务器数据的方法早已不局限于ajax.jQuery的ajax方法.各种js库已如雨 ...
- mybatis教程2(配置文件)
MyBatis 的配置文件包含了会深深影响 MyBatis 行为的设置(settings)和属性(properties)信息.文档的顶层结构如下: configuration 配置 propertie ...
- filezilla通过root账户远程连接管理ubuntu server服务器文件
前言: 准备重温一下今天在工作中遇见的一个问题,在刚刚安装上的server上测试,做好的文件不是很好传到server项目目录,于是使用了filezilla这个工具,它可以使用ssh来连接,于是乎就引入 ...
- 移动端地区选择控件mobile-select-area
由于之前的[js开源组件开发]js手机联动选择地区仿ios 开源git 很受欢迎,于是我又对其进行了一些优化,包括可选的范围变大了,添加了默认空首地址的功能,也添加了更多api参数,首先我们先来看下这 ...
- Ado.net怎么执行存储过程?
与ADO.Net执行SQL语句的地方只有两点不同1.使用存储过程名代替sql语句2. 使用查询对象SqlCommand,需配置一个CommandType属性 存储过程的执行语法-> exec 存 ...
- vue-cli脚手架搭建项目简单入门一
搭建系统: Windows系统 简单了解Node.js.npm,安装Node.js,下载网址:http://nodejs.cn/download/ 查看node,npm安装成功与否.打开cmd命令行, ...
- Fundebug前端JavaScript插件更新至1.2.0
摘要: Fundebug的前端JavaScript错误监控插件更新至1.2.0:支持监控WebSocket连接错误:修复了监控unhandledrejection错误的BUG,即未用catch处理的P ...
- WEB前端面试2014阿里旺旺
NO1.下图绿色区域的宽度为100%,其中有三个矩形,第一个矩形的宽度是200px,第二个和第三个矩形的宽度相等.请使用css3中的功能实现它们的布局. 已知HTML结构是: <div clas ...