Hbase 单机版的安装配置

1 去conf目录修改hbase-site.xml
<configuration>
  <property>
    <name>hbase.rootdir</name>
    <value>hdfs://localhost:9000/hbase</value>
  </property>
  <property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
  </property>
  <property>
    <name>hbase.zookeeper.quorum</name>
    <value>localhost</value>
  </property>
  <property>
    <name>hbase.tmp.dir</name>
    <value>/home/zj/lib/hbase/tmp</value>
  </property>
</configuration>


2 修改hbase-env.sh文件
export JAVA_HOME=/home/zj/lib/java
export HBASE_CLASSPATH=/home/zj/lib/hadoop121/conf
export HBASE_MANAGES_ZK=true




3 替换hadoop的jar文件
hbase0.92.2默认支持的是不是hadoop1.2.1,我们可以用替换hadoop-core的方式让其支持hadoop1.2.1

把hadoop-core-1.2.1.jar  commons-collections-3.2.1.jar  commons-configuration-1.6.jar 复制到hbase的lib目录下即可,当然必须删除之前的旧版本


4 启动hbase
/home/zj/lib/hbase/bin/start-hbase.sh


5 用jps命令看是否运行正常
2032 NameNode
13764 HQuorumPeer
29069 Jps
2630 JobTracker
2280 DataNode
13889 HMaster
2535 SecondaryNameNode
2904 TaskTracker
14180 HRegionServer
注意这几个东西一个都不能少,如果有什么少了,一定要去日志里看看是怎么回事。


6 尝试运行hbase命令
/home/zj/lib/hbase/bin/hbase shell
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.90.4, r1150278, Sun Jul 24 15:53:29 PDT 2011
 
hbase(main):001:0> list
TABLE                                          webpage                                         
1 row(s) in 0.5270 seconds
如果不报错,说明已经配置成功

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在Kubernetes上部署HBase单机版,可以使用StatefulSet。以下是一个简单的步骤: 1. 创建一个配置文件hbase-config.yaml: ``` apiVersion: v1 kind: ConfigMap metadata: name: hbase-config data: hbase-site.xml: | <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>hbase.rootdir</name> <value>file:///hbase</value> </property> <property> <name>hbase.zookeeper.property.clientPort</name> <value>2181</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>hbase-zookeeper-0.hbase-zookeeper.default.svc.cluster.local,hbase-zookeeper-1.hbase-zookeeper.default.svc.cluster.local,hbase-zookeeper-2.hbase-zookeeper.default.svc.cluster.local</value> </property> </configuration> ``` 2. 创建一个Headless Service: ``` apiVersion: v1 kind: Service metadata: name: hbase-headless spec: clusterIP: None selector: app: hbase ports: - name: thrift port: 9090 - name: rest port: 8080 ``` 3. 创建一个StatefulSet: ``` apiVersion: apps/v1 kind: StatefulSet metadata: name: hbase spec: serviceName: hbase-headless replicas: 1 selector: matchLabels: app: hbase template: metadata: labels: app: hbase spec: containers: - name: hbase image: hbase:2.2.4 command: - sh - -c - "echo 'deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse' >> /etc/apt/sources.list && apt-get update && apt-get install -y netcat && /opt/hbase/bin/start-hbase.sh && tail -f /opt/hbase/logs/*" ports: - containerPort: 9090 name: thrift - containerPort: 8080 name: rest volumeMounts: - name: hbase-data mountPath: /hbase - name: hbase-config mountPath: /opt/hbase/conf/hbase-site.xml subPath: hbase-site.xml volumes: - name: hbase-data persistentVolumeClaim: claimName: hbase-data - name: hbase-config configMap: name: hbase-config ``` 4. 创建一个PersistentVolumeClaim: ``` apiVersion: v1 kind: PersistentVolumeClaim metadata: name: hbase-data spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi ``` 上述配置文件中,假设已经有一个Zookeeper集群,名称为hbase-zookeeper,并且已经部署在Kubernetes中。在上述配置文件中,使用了HBase 2.2.4版本的镜像。在容器启动时,首先安装netcat,然后启动HBase,并保持日志输出。注意,hbase-site.xml文件被挂载到容器中。 以上是一个简单的部署HBase单机版的示例。根据实际情况,可能需要进行一些修改。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值