默认安装好了 homebrew。
- 终端先更新下 homebrew
bash
brew upgrade
再安装 hbase
bash
brew install hbase
安装完会有如下图的内容

- 按照提示启动 hbase
bash
brew services start hbase
返回启动成功

- 访问 http://localhost:16010 检验一下
启动成功

- 在启动 hbase shell之前,先修改个配置
找到 hbase-env.sh 文件,我的是在 /opt/homebrew/Cellar/hbase/2.6.2/libexec/conf 下,进入编辑
bash
cd /opt/homebrew/Cellar/hbase/2.6.2/libexec/conf
vim hbase-env.sh
检索"+UseConcMarkSweepGC",找到后改为"+UseG1GC",保存后退出

- 启动 hbase shell
bash
hbase shell
启动成功

使用完后,exit 退出 hbase shell
bash
exit
在 bin 目录下,关闭 hbase
bash
cd /opt/homebrew/Cellar/hbase/2.6.2/libexec/bin
./stop-hbase.sh