MacOS安装单机HBase

MacOS安装HBase,用于学习

brew下执行:

brew install hbase

等待安装结束,输入hbase:

$ hbase
Usage: hbase [<options>] <command> [<args>]
Options:
  --config DIR    Configuration direction to use. Default: ./conf
  --hosts HOSTS   Override the list in 'regionservers' file
  --auth-as-server Authenticate to ZooKeeper using servers configuration
Commands:
Some commands take arguments. Pass no args or -h for usage.
  shell           Run the HBase shell
  hbck            Run the hbase 'fsck' tool
  snapshot        Create a new snapshot of a table
  snapshotinfo    Tool for dumping snapshot information
  wal             Write-ahead-log analyzer
  hfile           Store file analyzer
  zkcli           Run the ZooKeeper shell
  upgrade         Upgrade hbase
  master          Run an HBase HMaster node
  regionserver    Run an HBase HRegionServer node
  zookeeper       Run a Zookeeper server
  rest            Run an HBase REST server
  thrift          Run the HBase Thrift server
  thrift2         Run the HBase Thrift2 server
  clean           Run the HBase clean up script
  classpath       Dump hbase CLASSPATH
  mapredcp        Dump CLASSPATH entries required by mapreduce
  pe              Run PerformanceEvaluation
  ltt             Run LoadTestTool
  version         Print the version
  CLASSNAME       Run the class named CLASSNAME

找到配置文件,假如JAVA_HOME,否则无法运行

find / -name hbase

我的安装路径是:/usr/local/Cellar/hbase/1.3.5,编辑如下文件,将JAVA_HOME配置为自己的

vim /usr/local/Cellar/hbase/1.3.5/libexec/conf/hbase-env.sh

Java请自行安装,将这行添加到hbase-env.sh

#配置JAVA_HOME
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home"

编辑如下文件,大部分保持了默认:

vim /usr/local/Cellar/hbase/1.3.5/libexec/conf/hbase-site.xml 

编辑后的文件内容如下(删除了网络相关的配置信息):

<configuration>
  <property>
    <name>hbase.rootdir</name>
    <value>file:///usr/local/var/hbase</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.clientPort</name>
    <value>2181</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/usr/local/var/zookeeper</value>
  </property>
</configuration>

启动HBase(一定要先执行,否则会报错):

/usr/local/Cellar/hbase/1.3.5/libexec/bin/start-hbase.sh

查看HBase状态,先进入hbase的shell:

hbase shell

执行status查看状态

hbase(main):001:0> status
1 active master, 0 backup masters, 1 servers, 0 dead, 2.0000 average load
hbase(main):002:0> 

单机版安装完成。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值