现象
使用命令:
$ sqlline.py s1,s2,s3:2181
启动 Phoenix 时,有时会卡在如下地方
Setting property: [incremental, false]
Setting property: [isolation, TRANSACTION_READ_COMMITTED]
issuing: !connect jdbc:phoenix:s1,s2,s3:2181 none none org.apache.phoenix.jdbc.PhoenixDriver
Connecting to jdbc:phoenix:s1,s2,s3:2181
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/module/apache-phoenix-5.0.0-HBase-2.0-bin/phoenix-5.0.0-HBase-2.0-client.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/module/hadoop-3.1.3/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
23/03/28 15:49:49 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
原因
zookeeper 中的 hbase 的 meta 信息不一致造成
解决
重建 meta 信息
1. 关闭 Hbase
$ stop-hbase.sh
2. 在 Zookeeper 中删除 hbase 节点
$ zkCli.sh
] ls /
[hbase, kafka, zookeeper]
] deleteall /hbase
3. 重启 Zookeeper
在 s1、s2、s3 服务器上依次执行:
$ zkServer.sh stop
$ zkServer.sh start
或在 s1 上使用之前写好的开关 Zookeeper 的脚本:
$ zk.sh stop
$ zk.sh start
4. 启动 HBase
$ start-hbase.sh
5. Phoenix 连接
$ sqlline.py s1,s2,s3:2181
进入 Phoenix 命令行,且之前的表都在,完成!