网站开发怎么销售,长沙开发网站的公司,官方网站有哪些,wordpress 生成jsHBase集群需要整个集群所有节点安装的HBase版本保持一致#xff0c;并且拥有相同的配置#xff0c;具体配置步骤如下#xff1a;
1. 解压缩HBase的压缩包
2. 配置HBase的环境变量
3. 修改HBase的配置文件#xff0c;HBase的配置文件存放在HBase安装目录下的conf中
4. 首…HBase集群需要整个集群所有节点安装的HBase版本保持一致并且拥有相同的配置具体配置步骤如下
1. 解压缩HBase的压缩包
2. 配置HBase的环境变量
3. 修改HBase的配置文件HBase的配置文件存放在HBase安装目录下的conf中
4. 首先在一台节点对整个HBase集群进行配置再将此节点的配置发送到集群的其它节点上。
5. 具体需要修改的HBase的配置文件包括 hbase-site.xml、hbase-env.sh、regionservers、backup-masters、
HBase版本选择
从官方网站 https://archive.apache.org/dist/hbase/ 注意官方网站在国内可能无法访问下载一个HBase的稳定发布版本 安装HBase在node1上安装配置HBase然后再使用【scp】命令分发到其他节点
项目中使用的HBase安装包已经存放在/opt/software目录下直接解压使用即可
[rootnode1 ~]# tar -xzf /opt/software/hbase.tar.gz -C /opt/module/
通过【vi】命令编辑/etc/profile文件
[rootnode1 ~]# vi /etc/profile
设置HBase环境变量在/etc/profile 文件的末尾添加如下内容
export HBASE_HOME/opt/module/hbase
export PATH$PATH:$HBASE_HOME/bin 使用【scp】将环境变量分发至其它节点
[rootnode1 ~]# scp -rq /etc/profile node2:/etc/
[rootnode1 ~]# scp -rq /etc/profile node3:/etc/
解释
部分参数说明 -p保留原文件的修改时间访问时间和访问权限。 -q 不显示传输进度条。 -r 递归复制整个目录。 所以如果使用scp命令只复制单个文件可以不添加-rq参数。
使用【source】命令使配置文件生效
[rootnode1 ~]# source /etc/profile
配置HBase
配置hbase-env.sh文件
[rootnode1 ~]# cd $HBASE_HOME/conf
[rootnode1 ~]# vi hbase-env.sh
在文件末尾添加如下配置
export JAVA_HOME/opt/module/jdk1.8.0_301/
export HBASE_MANAGES_ZKfalse 配置 hbase-site.xml文件该文件存放在$HBASE_HOME/conf目录下
[rootnode1 conf]# vi hbase-site.xml
在configuration和/configuration之间配置内容如下
propertynamehbase.rootdir/namevaluehdfs://node1:9000/hbase/value
/property
propertynamehbase.unsafe.stream.capability.enforce/namevaluefalse/value
/property
propertynamehbase.cluster.distributed/namevaluetrue/value
/property
propertynamehbase.zookeeper.quorum/namevaluenode1:2181,node2:2181,node3:2181/value
/property
配置完成后完整内容如下
?xml version1.0?
?xml-stylesheet typetext/xsl hrefconfiguration.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.*/
--
configurationpropertynamehbase.rootdir/namevaluehdfs://node1:9000/hbase/value/propertypropertynamehbase.unsafe.stream.capability.enforce/namevaluefalse/value/propertypropertynamehbase.cluster.distributed/namevaluetrue/value/propertypropertynamehbase.zookeeper.quorum/namevaluenode1:2181,node2:2181,node3:2181/value/property
/configuration
配置regionservers文件
[rootnode1 conf]# vi regionservers
配置内容如下
node1
node2
node3
将Hadoop的配置文件拷贝到HBase的conf目录
[rootnode1 conf]# cp $HADOOP_HOME/etc/hadoop/core-site.xml $HBASE_HOME/conf/
[rootnode1 conf]# cp $HADOOP_HOME/etc/hadoop/hdfs-site.xml $HBASE_HOME/conf/
将node1的HBase分发至整个集群的其他节点
[rootnode1 ~]# cd /opt/module/
[rootnode1 module]# scp -rq hbase node2:/opt/module/
[rootnode1 module]# scp -rq hbase node3:/opt/module/
启动集群并测试
在node1上启动HBase集群并并在client节点上通过浏览器访问 http://node1:16010 查看HBase的Web监控页面
[rootnode1 ~]# start-hbase.sh 新建一个名为test的表使其只包含一个名为data的列表和列族属性都为默认值
[rootnode1 ~]# hbase shell
hbase(main):001:0 create test,data
0 row(s) in 0.4150 seconds 通过键入help查看帮助命令运行list查看新建的表是否存在
解释
hbase(main):003:0 list TABLE test 1 row(s) in 0.0230 seconds 在列族data中二个不同的行和列上插入数据然后列出表内容
hbase(main):004:0 put test,row1,data:1,values1
0 row(s) in 0.1280 seconds
hbase(main):005:0 put test,row2,data:2,values2
0 row(s) in 0.0090 seconds
hbase(main):006:0 scan test
ROW COLUMNCELL
row1 columndata:1, timestamp1473585137461, valuevalues1
row2 columndata:2, timestamp1473585158072, valuevalues2
2 row(s) in 0.0200 seconds
删除刚创建的表test需要先设为禁用然后删除不设置会报错
hbase(main):008:0 drop test
ERROR: Table test is enabled. Disable it first.
hbase(main):009:0 disable test
0 row(s) in 1.1800 seconds
hbase(main):010:0 drop test
0 row(s) in 0.1570 seconds 查看一下是否删除成功 输入【quit】命令即可退出Base Shell命令行模式
hbase(main):007:0 quit()