在Ubuntu 18.04 LTS 64位下编译安装hue 4.2.0数据可视化工具,它以此对数据库SQL数据进行可视化编辑、图表显示、网页显示。下面是编译安装hue的具体步骤和出现错误的解决方案。
注:在编译安装过程中,如果出现错误提示,可以参考文章 “hue编译安装错误处理” 的解决方案。
一、编译安装hue 1.安装依赖库和依赖工具 编译源代码之前,我们需要安装一些编译所必须的依赖库和工具。 安装git工具(ubuntu18.04系统自带有git): sudo apt-get install git 执行下面命令,下载安装相关依赖: sudo apt-get install python2.7-dev \ make \ libkrb5-dev \ libxml2-dev \ libffi-dev \ libxslt-dev \ libsqlite3-dev \ libssl-dev \ libldap2-dev \ python-pip 安装 maven 工具: sudo apt-get install maven 有些工具,可能已经安装了,但防止意外,可以执行下面命令安装测试一下: sudo apt-get install \ ant gcc g++ \ libkrb5-dev libffi-dev libmysqlclient-dev libssl-dev \ libsasl2-dev libsasl2-modules-gssapi-mit libsqlite3-dev \ libtidy-0.99-0 libxml2-dev libxslt-dev make libldap2-dev \ maven python-dev python-setuptools libgmp3-dev 安装mysql: sudo apt-get install \ mysql-server \ mysql-client \ libmysqlclient-dev 2.下载 hue 源代码 使用 git 工具下载hue源代码,大约300M,耐心等待下载完。下载完以后,会在当前文件夹生成一个名为 hue 的目录: git clone https://github.com/cloudera/hue.git 3.编译 hue 源代码 进入hue目录: cd hue 使用 make 工具编译: make apps
上图显示就是成功编译了。 编译无误以后,执行下面命令,启动hue的 server 服务: build/env/bin/hue runserver
上图显示启动hue server 服务成功了。 然后打开浏览器,在浏览器的地址行,输入 http://localhost:8000 并回车,就可以看到下面的登陆页面了:
二、hue编译安装错误处理 1.提示缺少 sasl.h 文件 缺少 libsasl2-dev 库,可能会提示下面错误: Modules/LDAPObject.c:18:10: fatal error: sasl.h: No such file or directory #include <sasl.h> ^~~~~~~~ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 /home/aton/wwy/02-HUE/hue-tmp/hue/Makefile.sdk:120: recipe for target '/home/aton/wwy/02-HUE/hue-tmp/hue/desktop/core/build/python-ldap-2.3.13/egg.stamp' failed make[2]: *** [/home/aton/wwy/02-HUE/hue-tmp/hue/desktop/core/build/python-ldap-2.3.13/egg.stamp] Error 1 make[2]: Leaving directory '/home/aton/wwy/02-HUE/hue-tmp/hue/desktop/core' Makefile:105: recipe for target '.recursive-env-install/core' failed make[1]: *** [.recursive-env-install/core] Error 2 make[1]: Leaving directory '/home/aton/wwy/02-HUE/hue-tmp/hue/desktop' Makefile:148: recipe for target 'desktop' failed make: *** [desktop] Error 2 解决方法,执行下面命令: sudo apt-get install libsasl2-dev 2.提示找不到 mysql_config 如果没有安装mysql数据库,可能会提示以下错误: EnvironmentError: mysql_config not found /home/aton/wwy/02-HUE/hue-tmp/hue/Makefile.sdk:120: recipe for target '/home/aton/wwy/02-HUE/hue-tmp/hue/desktop/core/build/MySQL-python-1.2.5/egg.stamp' failed make[2]: *** [/home/aton/wwy/02-HUE/hue-tmp/hue/desktop/core/build/MySQL-python-1.2.5/egg.stamp] Error 1 make[2]: Leaving directory '/home/aton/wwy/02-HUE/hue-tmp/hue/desktop/core' Makefile:105: recipe for target '.recursive-env-install/core' failed make[1]: *** [.recursive-env-install/core] Error 2 make[1]: Leaving directory '/home/aton/wwy/02-HUE/hue-tmp/hue/desktop' Makefile:148: recipe for target 'desktop' failed make: *** [desktop] Error 2 解决方法,安装mysql sudo apt-get install mysql-server apt-get install mysql-client sudo apt-get install libmysqlclient-dev 3.提示找不到gmp.h 在没有安装 gmp-devel 库文件的时候,可能会提示以下错误: x86_64-linux-gnu-gcc -pthread -fwrapv -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -fdebug-prefix-map=/build/python2.7-nbjU53/python2.7-2.7.15~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/ -I/usr/include/python2.7 -c src/_fastmath.c -o build/temp.linux-x86_64-2.7/src/_fastmath.o src/_fastmath.c:36:11: fatal error: gmp.h: No such file or directory # include <gmp.h> ^~~~~~~ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 /home/aton/wwy/02-HUE/hue-tmp/hue/Makefile.sdk:120: recipe for target '/home/aton/wwy/02-HUE/hue-tmp/hue/desktop/core/build/pycrypto-2.6.1/egg.stamp' failed make[2]: *** [/home/aton/wwy/02-HUE/hue-tmp/hue/desktop/core/build/pycrypto-2.6.1/egg.stamp] Error 1 make[2]: Leaving directory '/home/aton/wwy/02-HUE/hue-tmp/hue/desktop/core' Makefile:105: recipe for target '.recursive-env-install/core' failed make[1]: *** [.recursive-env-install/core] Error 2 解决方法是,安装gmp-devel库文件。可以参考文章《Ubuntu 18.04系统中编译安装gmp-devel》。在ubuntu中,好像是通过下面命令安装 gmp-devel,可以尝试一下(毕竟源代码安装比较费劲): sudo apt-get install libgmp3-dev
相关主题 |