解决Cloudera-Manager搭建CDH集群时hue数据库连接失败问题

 解决Cloudera-Manager搭建CDH集群时hue数据库连接失败问题_第1张图片

 通过查看$CM_HOME/log/cloudera-cm-server/cloudera-cm-server.log,发现hue数据库连接失败主要是由于缺少一个libmysqlclient.so.20这个库文件

Traceback (most recent call last):
  File "/opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/build/env/bin/hue", line 12, in
    load_entry_point('desktop==3.9.0', 'console_scripts', 'hue')()
  File "/opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/desktop/core/src/desktop/manage_entry.py", line 65, in entry
    raise e

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: libmysqlclient.so.20: cannot open shared object file: No such file or directory
解决方式:
在每一个agent节点上执行:

ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20.3.11  /usr/lib/libmysqlclient.so.20

注:/usr/lib/x86_64-linux-gnu/libmysqlclient.so.20.3.11 这个文件只有安装了mysql数据库才有的库文件,由于我们mysql数据库安装在server节点上,所有agent上并没有这个libmysqlclient.so.20.3.11,因此agent节点去连接server节点上的hue数据库,由于缺少libmysqlclient.so.20.11这个库文件,因此而报错。
所有我就把这个库文件直接scp到每一个agent上的/usr/lib/x86_64-linux-gnu/目录下,然后再在/usr/lib/下创建软连接。

第二个问题:解决上面的问题后,可能会出现一个新的问题如下
2019-02-19 16:35:53,893 INFO CommandPusher:com.cloudera.cmf.service.AbstractDbConnectionTestCommand:     self.execute(*args, **options.__dict__)
  File "/opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/core/management/base.py", line 284, in execute
    self.validate()
  File "/opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/core/management/base.py", line 310, in validate
    num_errors = get_validation_errors(s, app)
  File "/opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/core/management/validation.py", line 34, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/models/loading.py", line 196, in get_app_errors
    self._populate()
  File "/opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/models/loading.py", line 78, in _populate
    self.load_app(app_name)
  File "/opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/models/loading.py", line 99, in load_app
    models = import_module('%s.models' % app_name)
  File "/opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/apps/jobbrowser/src/jobbrowser/models.py", line 20, in
    import lxml.html
  File "/opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/build/env/lib/python2.7/site-packages/lxml-3.3.6-py2.7-linux-x86_64.egg/lxml/html/__init__.py", line 42, in
    from lxml import etree

ImportError: libxslt.so.1: cannot open shared object file: No such file or directory

2019-02-19 16:35:53,893 INFO CommandPusher:com.cloudera.cmf.model.DbCommand: Command 127(HueTestDatabaseConnection) has completed. finalstate:FINISHED, success:false, msg:Unexpected error. Unable to verify database connection.
解决方式:
在每一个agent节点上执行:
sudo apt-get install python3-lxml

 

你可能感兴趣的:(大数据)