Zookeeper 错误 Will not attempt to authenticate using SASL (unknown error)

24 篇文章 0 订阅
9 篇文章 0 订阅

解决问题步骤包括

1、查看输入参数是否正确

2、查看连接是否建立

3、查看值是否有传到

 

先上代码

    public String getValue(String tableName,String rowKey,String family,String column){
        String res = "";                    //返回结果
        Table table = null;

        if (StringUtils.isBlank(tableName) || StringUtils.isBlank(family)           //判断输入值是否为空
                || StringUtils.isBlank(rowKey) || StringUtils.isBlank(column)) {
            return null;
        }

        try{
            connection = ConnectionFactory.createConnection( con.configuration() ); // hbase链接
            table = connection.getTable( TableName.valueOf( tableName ) );
            Get g = new Get( rowKey.getBytes() );
            g.addColumn( family.getBytes(),column.getBytes() );
            Result result = table.get( g );
            List<Cell> ceList = result.listCells();
            if (ceList != null && ceList.size() > 0) {
                for (Cell cell : ceList) {
                    res = Bytes.toString(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());
                }
            }

        }catch (Exception e){
            e.printStackTrace();
        }

        return res;
    }

yml文件

hbase:
  config:
    hbase.zookeeper.quorum: 172.18.2.161,172.18.2.162,172.18.2.163
    hbase.zookeeper.property.clientPort: 2181
    zookeeper.znode.parent: /hbase-unsecure

1、参数连接没问题,注意行键的意义,如果参数有问题的话,会报另一个错

2、连接建立过程,zookeeper使用的是172.168.246.160、161、162三个节点,一开始我用telnet去连这个端口连成功了,还以为是能达到这个端口,但事实 证明,telnet能到,zookeeper不一定能到。询问之后才知道,在虚拟机上,当初建的虚拟机器的名字是 node201\node202\node203,遂在host加入相关的 配置,然后就跑通了。

3、提示

Could not locate executable null\bin\winutils.exe in the Hadoop binaries.

这个是因为你本地没有装withutils.exe这个管理工具,因此才会有错,但本地连hbase(不管理)是可以不用装的,所以这个错误暂时没有去动它。

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值