CDH 6.3.1 hue 4.4 Api 错误:500 Server Error: Server Error for url: http://x.x.x.x:9090

系统环境

CDH 6.3.1
Hue 4.4.0

问题现象

Hue中无法连接hbase表
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200606112505253.png

问题排查

hue server 日志:http://xxxx:8888/hue/logs

[05/Jun/2020 19:32:19 -0700] resource     DEBUG    GET //user/hbase Got response in 3ms: {"FileStatus":{"accessTime":0,"blockSize":0,"childrenNum":0,"fileId":22967,"group":"hbase","length":0,"modificationTime":1591409474471,"owner":"hbase","pathSuffix":"","permission":"755","replication":0,"storagePolicy":0,"type":"DIRECTORY"}}
[05/Jun/2020 19:32:19 -0700] connectionpool DEBUG    http://master01-prod.cdh:9870 "GET /webhdfs/v1/user/hbase?op=GETFILESTATUS&user.name=hue&doas=hbase HTTP/1.1" 200 None
[05/Jun/2020 19:32:19 -0700] connectionpool DEBUG    Starting new HTTP connection (1): master01-prod.cdh
[05/Jun/2020 19:32:17 -0700] views        WARNING  User hbase is bypassing the load balancer
[05/Jun/2020 19:32:14 -0700] access       INFO     192.168.8.69 hbase - "POST /desktop/log_analytics HTTP/1.1" returned in 1ms
[05/Jun/2020 19:32:14 -0700] access       INFO     192.168.8.69 hbase - "POST /desktop/log_analytics HTTP/1.1"-- PAGE: hue/leftNavVisible/true
[05/Jun/2020 19:32:06 -0700] access       INFO     192.168.8.69 hue - "GET /hbase/api/getTableList/HBase HTTP/1.1" returned in 66ms
[05/Jun/2020 19:32:06 -0700] middleware   INFO     Processing exception: Api 错误:500 Server Error: Server Error for url: http://master02-prod.cdh:9090/: Traceback (most recent call last):
  File "/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/build/env/lib/python2.7/site-packages/Django-1.11.20-py2.7.egg/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/build/env/lib/python2.7/site-packages/Django-1.11.20-py2.7.egg/django/utils/decorators.py", line 185, in inner
    return func(*args, **kwargs)
  File "/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/apps/hbase/src/hbase/views.py", line 80, in api_router
    return api_dump(HbaseApi(request.user).query(*url_params))
  File "/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/apps/hbase/src/hbase/api.py", line 54, in query
    raise PopupException(_("Api Error: %s") % error_msg)
PopupException: Api \u9519\u8bef\uff1a500 Server Error: Server Error for url: http://master02-prod.cdh:9090/
[05/Jun/2020 19:32:06 -0700] exceptions_renderable ERROR    Potential trace: [('/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/apps/hbase/src/hbase/api.py', 46, 'query', 'return getattr(self, action)(*args)'), ('/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/apps/hbase/src/hbase/api.py', 142, 'getTableList', "return [{'name': name, 'enabled': client.isTableEnabled(name, doas=self.user.username)} for name in client.getTableNames(doas=self.user.username)]"), ('/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/desktop/core/src/desktop/lib/thrift_util.py', 407, 'wrapper', 'return attr(*args, **kwargs)'), ('/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/desktop/core/src/desktop/lib/thrift_util.py', 473, 'wrapper', 'ret = res(*args, **kwargs)'), ('/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/apps/hbase/gen-py/hbased/Hbase.py', 54, 'decorate', 'return func(*args, **kwargs)'), ('/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/apps/hbase/gen-py/hbased/Hbase.py', 838, 'getTableNames', 'self.send_getTableNames()'), ('/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/apps/hbase/gen-py/hbased/Hbase.py', 846, 'send_getTableNames', 'self._oprot.trans.flush()'), ('/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/build/env/lib/python2.7/site-packages/thrift-0.9.1-py2.7-linux-x86_64.egg/thrift/transport/TTransport.py', 170, 'flush', 'self.__trans.flush()'), ('/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/desktop/core/src/desktop/lib/thrift_/http_client.py', 87, 'flush', "self._data = self._root.post('', data=data, headers=self._headers)"), ('/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/desktop/core/src/desktop/lib/rest/resource.py', 157, 'post', 'allow_redirects=allow_redirects, clear_cookies=clear_cookies, log_response=log_response)'), ('/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/desktop/core/src/desktop/lib/rest/resource.py', 80, 'invoke', 'log_response=log_response)'), ('/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/desktop/core/src/desktop/lib/rest/resource.py', 99, '_invoke', 'clear_cookies=clear_cookies)'), ('/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/desktop/core/src/desktop/lib/rest/http_client.py', 215, 'execute', 'raise self._exc_class(ex)')]
[05/Jun/2020 19:32:06 -0700] thrift_util  INFO     Thrift saw exception: 500 Server Error: Server Error for url: http://master02-prod.cdh:9090/
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 </title>
</head>
<body>
<h2>HTTP ERROR: 500</h2>
<p>Problem accessing /. Reason:
<pre>    javax.servlet.ServletException: org.apache.hadoop.security.authorize.AuthorizationException: User: hbase is not allowed to impersonate hue</pre></p>
<hr />
</body>
</html>
 (error 500)
[05/Jun/2020 19:32:06 -0700] thrift_util  ERROR    Thrift saw exception (this may be expected).
Traceback (most recent call last):
  File "/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/desktop/core/src/desktop/lib/thrift_util.py", line 473, in wrapper
    ret = res(*args, **kwargs)
  File "/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/apps/hbase/gen-py/hbased/Hbase.py", line 54, in decorate
    return func(*args, **kwargs)
  File "/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/apps/hbase/gen-py/hbased/Hbase.py", line 838, in getTableNames
    self.send_getTableNames()
  File "/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/apps/hbase/gen-py/hbased/Hbase.py", line 846, in send_getTableNames
    self._oprot.trans.flush()
  File "/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/build/env/lib/python2.7/site-packages/thrift-0.9.1-py2.7-linux-x86_64.egg/thrift/transport/TTransport.py", line 170, in flush
    self.__trans.flush()
  File "/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/desktop/core/src/desktop/lib/thrift_/http_client.py", line 87, in flush
    self._data = self._root.post('', data=data, headers=self._headers)
  File "/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/desktop/core/src/desktop/lib/rest/resource.py", line 157, in post
    allow_redirects=allow_redirects, clear_cookies=clear_cookies, log_response=log_response)
  File "/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/desktop/core/src/desktop/lib/rest/resource.py", line 80, in invoke
    log_response=log_response)
  File "/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/desktop/core/src/desktop/lib/rest/resource.py", line 99, in _invoke
    clear_cookies=clear_cookies)
  File "/opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/lib/hue/desktop/core/src/desktop/lib/rest/http_client.py", line 215, in execute
    raise self._exc_class(ex)
RestException: 500 Server Error: Server Error for url: http://master02-prod.cdh:9090/
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 </title>
</head>
<body>
<h2>HTTP ERROR: 500</h2>
<p>Problem accessing /. Reason:
<pre>    javax.servlet.ServletException: org.apache.hadoop.security.authorize.AuthorizationException: User: hbase is not allowed to impersonate hue</pre></p>
<hr />
</body>
</html>
 (error 500)

问题核心原因:

org.apache.hadoop.security.authorize.AuthorizationException: User: hbase is not allowed to impersonate hue

问题解决

  1. 修改配置
    在CloudManager的HDFS服务->高级->core-site.xml增加如下配置:

在这里插入图片描述
2. 重启相关服务

参考资料

1、https://stackoverflow.com/questions/42522341/cant-access-hbase-through-hue

2、https://developer.aliyun.com/ask/127216

3、https://stackoverflow.com/questions/38520724/cdh-hue-and-hbase-authentication

4、https://www.cnblogs.com/zlslch/p/6819622.html

5、https://my.oschina.net/hblt147/blog/1920466

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值