[HBase Manual]CH5 HBase运行模式:单实例和分布式
@font-face { font-family: 等线 }
@font-face { font-family: “等线 Light” }
@font-face { font-family: “Calibri Light” }
@font-face { font-family: Calibri }
@font-face { font-family: “@等线 Light” }
@font-face { font-family: “@等线” }
p.MsoNormal, li.MsoNormal, div.MsoNormal { margin: 0 0 8pt; line-height: 107%; font-size: 11pt; font-family: “Calibri”, sans-serif }
h1 { mso-style-link: “Heading 1 Char”; margin: 12pt 0 0.0001pt; line-height: 107%; page-break-after: avoid; font-size: 16pt; font-family: “Calibri Light”, sans-serif; color: rgba(46, 116, 181, 1); font-weight: normal }
h2 { mso-style-link: “Heading 2 Char”; margin: 2pt 0 0.0001pt; line-height: 107%; page-break-after: avoid; font-size: 13pt; font-family: “Calibri Light”, sans-serif; color: rgba(46, 116, 181, 1); font-weight: normal }
h3 { mso-style-link: “Heading 3 Char”; margin: 2pt 0 0.0001pt; line-height: 107%; page-break-after: avoid; font-size: 12pt; font-family: “Calibri Light”, sans-serif; color: rgba(31, 77, 120, 1); font-weight: normal }
p.MsoToc1, li.MsoToc1, div.MsoToc1 { margin: 0 0 5pt; line-height: 107%; font-size: 11pt; font-family: “Calibri”, sans-serif }
p.MsoToc2, li.MsoToc2, div.MsoToc2 { margin: 0 0 5pt 11pt; line-height: 107%; font-size: 11pt; font-family: “Calibri”, sans-serif }
p.MsoToc3, li.MsoToc3, div.MsoToc3 { margin: 0 0 5pt 22pt; line-height: 107%; font-size: 11pt; font-family: “Calibri”, sans-serif }
a:link, span.MsoHyperlink { color: rgba(0, 0, 255, 1); text-decoration: underline }
a:visited, span.MsoHyperlinkFollowed { color: rgba(149, 79, 114, 1); text-decoration: underline }
code { font-family: “Courier New” }
pre { mso-style-link: “HTML Preformatted Char”; margin: 0 0 0.0001pt; font-size: 10pt; font-family: “Courier New” }
span.Heading1Char { mso-style-name: “Heading 1 Char”; mso-style-link: “Heading 1”; font-family: “Calibri Light”, sans-serif; color: rgba(46, 116, 181, 1) }
span.Heading2Char { mso-style-name: “Heading 2 Char”; mso-style-link: “Heading 2”; font-family: “Calibri Light”, sans-serif; color: rgba(46, 116, 181, 1) }
span.Heading3Char { mso-style-name: “Heading 3 Char”; mso-style-link: “Heading 3”; font-family: “Calibri Light”, sans-serif; color: rgba(31, 77, 120, 1) }
span.HTMLPreformattedChar { mso-style-name: “HTML Preformatted Char”; mso-style-link: “HTML Preformatted”; font-family: “Courier New” }
span.tag { mso-style-name: tag }
.MsoPapDefault { margin-bottom: 8pt; line-height: 107% }
@page WordSection1 { size: 612.0pt 792.0pt margin-top: 72pt margin-right: 90pt margin-bottom: 72pt margin-left: 90pt }
div.WordSection1 { page: WordSection1 }
HBase运行模式:单实例和分布式
HBase有2种运行模式,单实例和分布式。
1.单实例模式
这个是默认的模式。单实例的描述可以看quickstart 。在单实例模式下,hbase不使用HDFS,所有的HBase守护进程都在一个JVM下。Zookeeper绑定到所有已知的端口可以让客户端可以和HBase通信。
1.1 单实例在HDFS下
编辑hbase-site.xml,配置hbase.rootdir参数指向hdfs实例。
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://namenode.example.org:8020/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>false</value>
</property>
</configuration>
2.分布式
分布式模式可以细分成分布式。而不是放在同一个node下。这也是伪分布式和分布式的区别。伪分布式可以在本地文件系统上或者hdfs上。但是分布式必须在hdfs上。
2.1 伪分布式
略
3完全分布式
默认,HBase运行在单实例模式下。单实例或者伪分布式是为了做小规模的测试。对于生产环境还是需要使用分布式的。在分布式下,多个hbase的实例在多个服务器上运行形成一个集群。
和伪分布式一样分布式,也是需要设置hbase.cluster.distributed为true。吧hbase.rootdir指向高可用的HDFS文件系统。
另外集群配置后多个集群节点有RegionServer,Zookeeper QuorumPeers,backup HMaster servers。
分布的RegionServer
通常集群包含多个RegionServer运行在不同的服务器上,包括backup master,Zookeeper。Conf/regionservers文件中包含了RegionServer的host列表。每个host一行。所有文件中的host随着master的启动关闭而启动关闭。
Zookeeper和HBase
HBase的Zookeeper查看: ZooKeeper
过程:HDFS Client配置
1.如果你有HDFS客户端配置,那么就需要让HBase知道配置的修改:
a.在hbase-env.sh中配置HADOOP_CONF_DIR到HBASE_CLASSPATH。
b.复制hdfs-site.xml或者创建一个连接在hbase的配置文件夹下。
c.如果只有一点点配置,也可以直接设置到hbase-site.xml上。