部署Superset BI(一)试水
DataEase实际上非常好用,但是看到Superset支持SAP HANA数据库时候,决定尝试。
找了一台安装了dokcer的Debian机器开始安装superset
1.克隆仓库
root@Nocoly:/# git clone --depth=1 https://github.com/apache/superset.git
Cloning into 'superset'...
fatal: unable to access 'https://github.com/apache/superset.git/': Recv failure: Connection reset by peer
网络不行,直接下载zip包。
root@Nocobase:/tmp# apt-get install unzip
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
unzip is already the newest version (6.0-28).
unzip set to manually installed.
2.解压安装
root@Nocobase:/tmp# unzip superset-master.zip
root@Nocobase:/tmp# mv superset-master /usr/
root@Nocobase:/tmp# cd superset-master
3.启动
root@Nocobase:/docker compose up
结果一大堆错误。
1.824 npm WARN EBADENGINE Unsupported engine {
1.824 npm WARN EBADENGINE package: 'eslint@9.14.0',
1.824 npm WARN EBADENGINE required: { node: '^18.18.0 || ^20.9.0 || >=21.1.0' },
1.824 npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
1.824 npm WARN EBADENGINE }
1.825 npm WARN EBADENGINE Unsupported engine {
1.825 npm WARN EBADENGINE package: 'eslint-scope@8.2.0',
1.825 npm WARN EBADENGINE required: { node: '^18.18.0 || ^20.9.0 || >=21.1.0' },
1.825 npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
1.825 npm WARN EBADENGINE }
1.825 npm WARN EBADENGINE Unsupported engine {
1.825 npm WARN EBADENGINE package: 'eslint-visitor-keys@4.2.0',
1.825 npm WARN EBADENGINE required: { node: '^18.18.0 || ^20.9.0 || >=21.1.0' },
1.826 npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
1.826 npm WARN EBADENGINE }
1.826 npm WARN EBADENGINE Unsupported engine {
1.826 npm WARN EBADENGINE package: 'espree@10.3.0',
1.826 npm WARN EBADENGINE required: { node: '^18.18.0 || ^20.9.0 || >=21.1.0' },
1.826 npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
1.826 npm WARN EBADENGINE }
1.827 npm WARN EBADENGINE Unsupported engine {
1.827 npm WARN EBADENGINE package: 'eslint-visitor-keys@4.2.0',
1.827 npm WARN EBADENGINE required: { node: '^18.18.0 || ^20.9.0 || >=21.1.0' },
1.827 npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
1.827 npm WARN EBADENGINE }
1.832 npm WARN EBADENGINE Unsupported engine {
1.832 npm WARN EBADENGINE package: 'globals@15.9.0',
1.832 npm WARN EBADENGINE required: { node: '>=18' },
1.832 npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
1.832 npm WARN EBADENGINE }
1.836 npm WARN EBADENGINE Unsupported engine {
1.836 npm WARN EBADENGINE package: 'typescript-eslint@8.12.2',
1.837 npm WARN EBADENGINE required: { node: '^18.18.0 || ^20.9.0 || >=21.1.0' },
1.837 npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
1.837 npm WARN EBADENGINE }
19.11 npm ERR! code ERR_SOCKET_TIMEOUT
19.11 npm ERR! network Socket timeout
19.11 npm ERR! network This is a problem related to network connectivity.
19.11 npm ERR! network In most cases you are behind a proxy or have bad network settings.
19.11 npm ERR! network
19.11 npm ERR! network If you are behind a proxy, please make sure that the
19.11 npm ERR! network 'proxy' config is set properly. See: 'npm help config'
19.13
19.13 npm ERR! A complete log of this run can be found in:
19.13 npm ERR! /root/.npm/_logs/2024-11-18T05_19_11_502Z-debug-0.log
------
failed to solve: executor failed running [/bin/sh -c npm ci && npm run build]: exit code: 1
再次运行
root@Nocobase:/docker compose -f docker-compose-non-dev.yml up
也不知道运行是否完成,登录
http://127.0.0.1:8088
发现默认密码(admin/admin)好像不能正常工作,提示:Invalid login. Please try again.
一查资料,说是要初始化:
root@Nocobase:/sudo docker-compose exec superset bash /app/docker-init.sh
重新启动后,可以登录了,但是空白,有错误,看起来可能和Python3.10有关系
superset_app | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request
superset_app | rv = self.dispatch_request()
superset_app | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request
superset_app | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
superset_app | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 502, in <lambda>
superset_app | view_func=lambda **kw: self_ref().send_static_file(**kw), # type: ignore # noqa: B950
superset_app | File "/usr/local/lib/python3.10/site-packages/flask/scaffold.py", line 317, in send_static_file
superset_app | return send_from_directory(
superset_app | File "/usr/local/lib/python3.10/site-packages/flask/helpers.py", line 557, in send_from_directory
superset_app | return werkzeug.utils.send_from_directory( # type: ignore[return-value]
superset_app | File "/usr/local/lib/python3.10/site-packages/werkzeug/utils.py", line 575, in send_from_directory
安装Python3
root@Nocobase:/tmp/wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz
tar xzf Python-3.10.0.tgz
cd Python-3.10.0
root@Nocobase:/tmp/Python-3.10.0# ./configure --enable-optimizations
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for python3.10... no
checking for python3... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "linux"
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/tmp/Python-3.10.0':
configure: error: no acceptable C compiler found in $PATH
提示错误,需要更新程序包及依赖。
sudo apt update && sudo apt upgrade
sudo apt install wget build-essential libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
再来安装Python3
root@Nocobase:/tmp/Python-3.10.0# ./configure --enable-optimizations
安装成功
可是打开网页登录还是一片空白
安装flask
root@Nocobase:/usr/local/lib/python3.10/site-packages# pip install Flask
-bash: pip: command not found
root@Nocobase:/usr/local/lib/python3.10/site-packages# apt install python3-pip -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
root@Nocobase:/usr/local/lib/python3.10/site-packages#apt-get -y install python3-flask
安装后还是有问题
root@Nocobase:~# whereis python
python:
root@Nocobase:~# which python3.10
/usr/local/bin/python3.10
root@Nocobase:~# update-alternatives --list python
update-alternatives: error: no alternatives for python
root@Nocobase:/home/nocobase# update-alternatives --install /usr/bin/python python /usr/local/bin/python3.10 1
update-alternatives: using /usr/local/bin/python3.10 to provide /usr/bin/python (python) in auto mode
root@Nocobase:/home/nocobase# python
Python 3.10.0 (default, Nov 18 2024, 15:15:44) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
系统已默认Python版本为3.10,
重新启动,仍然失败,作罢