官方文档:https://superset.apache.org/docs/installation/installing-superset-from-scratch

由于在centos上安装有各种问题,个人没有解决好。因此采用在ubuntu server上安装,顺利的多。
步骤如下,主要是按官方步骤就行,其中有一点就是必须升级pip至最新。

In Ubuntu 20.04 the following command will ensure that the required dependencies are installed:
sudo apt-get install build-essential libssl-dev libffi-dev python3-dev python3-pip libsasl2-dev libldap2-dev

pip install --upgrade pip【重要,一定要更新,不然后面报错】

pip install virtualenv

# virtualenv is shipped in Python 3.6+ as venv instead of pyvenv.
# See https://docs.python.org/3.6/library/venv.html
python3 -m venv venv
. venv/bin/activate
You can exit the environment by running deactivate on the command line

Installing and Initializing Superset
First, start by installing apache-superset:
pip install apache-superset

Then, you need to initialize the database:
superset db upgrade

Finish installing by running through the following commands:
# Create an admin user in your metadata database (use `admin` as username to be able to load the examples)
$ export FLASK_APP=superset
superset fab create-admin

# Load some data to play with
superset load-examples【加载失败见后面文档,需要下载数据,自建http服务器】

# Create default roles and permissions
superset init

# To start a development web server on port 8088, use -p to bind to another port
superset run -p 8088 --with-threads --reload --debugger
superset run -p 8088 -h 192.168.1.149 --with-threads

连接数据库:
mysql:用pip install mysqlclient会报错,可以改用pip install mysql-connector-python。
mssql:pip install pymssql

mssql+pymssql://<Username>:<Password>@<Host>:<Port-default:1433>/<Database Name>/?Encrypt=yes
mysql+mysqlconnector://{username}:{password}@{host}/{database}

mssql+pymssql://sa:123123123@192.168.1.254/Test

其它:
UserWarning: Could not import the lzma module. Your installed Python is incomplete
For centos: sudo yum install -y xz-devel
Recompile python from source code
cd Python-3.8*/
./configure --enable-optimizations
sudo make altinstall

superset load-examples失败解决方法
由于原因是example数据是存放在github的,但是无法直接下载或者下载超时,可提前到官方下载:网址如下https://github.com/apache-superset/examples-data/archive/refs/heads/master.zip

接着需要自己起一个http 服务,用的是python自带的python -m http.server 【端口号】快速搭建一个,(端口号一般是自己设4位数字例如8088之类的)。搭建步骤如下

第一步:cmd进入自己要上传到http的文件目录,例如我进入到下载的案例压缩包解压到的一个文件夹目录中

第二步:命令行里敲入python -m http.server 【端口号】,会出现以下结果,这时候已经搞定了

第三步,在网址栏输入http://(自己电脑的IP):【端口号】
就可以看到你当时的目录(webserver要允许目录浏览?)

http服务搭建完成

接着改examples/helpers.py里的BASE_URL项

把原本的BASE_URL ="https://github.com/apache-superset/examples-data/blob/master/"

改成BASE_URL ="http://(自己电脑的IP):【端口号】/examples-data-master/"
【注意BASE_URL后面是直接各个数据的gz文件,不能再有子目录间隔】
保存好

再回到最开始尝试:superset load-examples【仍有一些db的错误,请网上搜查】

安装为服务(未验证)
Actually the superset runserver is used for development mode and it is highly recommended other tools like gunicorn for production. Anyway, the main problem is that superset path on the virutalenv is $VENV_PATH/bin/superset (in general the applications that treat like binary applications like superset or airflow, etc servers on this path: $VENV_PATH/bin and the easy way to find the path of any application on Linux systems is to use which command that in this case, you can use which superset to find the superset path ).
This is the superset service file that I use it on the production, hope to useful:
[Unit]
Description = Apache Superset Webserver Daemon
After = network.target

[Service]
PIDFile = /home/superset/superset-webserver.PIDFile
User = superset
Group = superset
Environment=SUPERSET_HOME=/home/superset
Environment=PYTHONPATH=/home/superset
WorkingDirectory = /home/superset
ExecStart =/home/superset/venv/bin/python3.7 /home/superset/venv/bin/gunicorn --workers 8 --worker-class gevent --bind 0.0.0.0:8888 --pid /home/superset/superset-webserver.PIDFile superset:app
ExecStop = /bin/kill -s TERM $MAINPID

[Install]
WantedBy=multi-user.target

Installing Superset最新版本安装(笔记)的更多相关文章

  1. canal-adapter1.1.14最新版本安装的过程中出现的NullPointerException异常

    记录一下我在安装 canal-adapter1.1.14最新版本安装的过程中出现的NullPointerException异常 以下是我的canal-adapter/logs文件夹内adapter.l ...

  2. Centos7下git最新版本安装

    刚重新装了centos7最小版的系统,发现没有git,只好重新安装了,记录下以防忘记.(以下命令最好在root用户下执行,要么你有管理员权限也行,则需要在命令前加sudo) 安装方法有两种: 一.yu ...

  3. Vue脚手架最新版本安装使用

    现在很多的插件如Vant 这类的样式框架,都去兼容了Vue的3.0版本,所以我总结一下如何去简单的搭建一个Vue3.0的框架 开始 一,如何安装 在这里说明一下,Vue脚手架版本,和Vue版本是两个东 ...

  4. Centos7下vim最新版本安装

    一直以来用的都是vim,因为之前都是系统自带的vim没有研究过怎么自己安装,今天趁着刚装完新系统,顺便装下vim. 同样vim也有两种安装方法: 一.yum安装,centos下安装软件最简单的方法了, ...

  5. Cloudera Manager及CDH最新版本安装全程记录

    大家都知道,Apache Hadoop的配置很繁琐,而且很零散,为此Cloudera公司提供了Clouder Manager工具,而且还封装了Apache Hadoop,flume,spark,hiv ...

  6. Redis4.0.9最新版本安装时出现的问题

    Redis Redis(REmote DIctionary Server,远程数据字典服务器)是开源的内存数据库,常用作缓存或者消息队列. Redis的特点: Redis存在于内存,使用硬盘作为持久化 ...

  7. redis最新版本安装及开机自启

    的系统是ubuntu,安装方式有多种,一种是通过apt仓库,一种是下载源码,编译安装 1.通过apt仓库 具体命令: sudo apt-get update sudo apt-get install ...

  8. Microsoft Office for Mac最新版本安装教程,亲测可用!!!

    办公必备的Office工具,它为需要使用 Office 工具的用户和企业设计,让他们可以利用功能强大的 Outlook 来处理电子邮件.日历和通讯录事宜.你所熟知和信赖的 Office 经过更新后,可 ...

  9. Ubuntu16.04下安装最新版本的CMake

      当前最新版CMake为3.9.1.. Ubuntu中更新cmake到最新版本,过程如下: 1. 卸载已经安装的旧版的CMake[非必需] apt-get autoremove cmake 2. 文 ...

  10. 在XP上安装WinPython最新版本

    2015年3月30日星期一 16:01:47     晴 WinPython 新版本不再支持Windows XP平台,会出现错误提示WindowsError 127. 按照官网论坛上的解决方案(htt ...

随机推荐

  1. LeetCode-02 两数相加(Add Two Numbers)

    描述 给出两个非空的链表用来表示两个非负的整数.其中,它们各自的位数是按照逆序的方式存储的,并且它们的每个节点只能存储一位数字. 如果,我们将这两个数相加起来,则会返回一个新的链表来表示它们的和. 您 ...

  2. Apache Kafka 的基本概念

    基本概念 主题 Topic topic 是 Kafka 最基础的组织单位,类似于关系数据库中的数据表.做为使用 kafka 的开发者,你最应该考虑的是和 topoc 相关的抽象.创建不同的 topic ...

  3. Java程序员用代码,计算最大公约数和最小公倍数

    作者:小傅哥 博客:https://bugstack.cn 源码:https://github.com/fuzhengwei/java-algorithms 沉淀.分享.成长,让自己和他人都能有所收获 ...

  4. NOIP2018 解题报告

    NOIP2018 解题报告 前记 在本届noip,作为第一年参加提高组的我,感受到了各位大佬神仙恐怖如斯的实力.身在弱省,但是依旧难以取得成绩,果然oi赛场,菜是原罪 好了,到了赛后,还是总结一下题目 ...

  5. ACWJ_00扫描器

    第一部分:词法扫描介绍 ​ 我们从一个简单的词汇扫描器开始我们的编译器编写之旅.正如我在之前部分所提到的,扫描器的任务是从输入语言中(用来编译的语句)识别词法元素或者是符号. ​ 我们将定义一个只有5 ...

  6. 02-Tcl输出、赋值与替换

    2 Tcl输出.赋值与替换 2.1 puts Tcl的输出命令是puts,将字符串标准输出channelled.语法中两个问号之间的参数为可选参数. # 例1 puts hello # 输出 hell ...

  7. Linux 查找某一线程是否已运行,并启动的方法

    参考资料:(3条消息) [Linux]守护线程自动重启某个程序的3种常用办法_L7256的博客-CSDN博客_守护进程 自动重启 方法一:使用编写一个监控APP的脚本 start.sh脚本如下:exp ...

  8. 刷题笔记——1267.A+B Problem

    题目 1267.A+B Problem 代码 while True: try: a,b=map(int,input().strip().split()) print(a+b) except: brea ...

  9. ASP.NET6 + Mongo + OData

    准备工作 Docker环境 Mongo数据库 配置Mongo数据库 ASP.NET6 集成Mongo 安装MongoDB.Driver { "Logging": { "L ...

  10. Dapr v1.10.0 版本已发布

    Dapr是一套开源.可移植的事件驱动型运行时,允许开发人员轻松立足云端与边缘位置运行弹性.微服务.无状态以及有状态等应用程序类型.Dapr能够确保开发人员专注于编写业务逻辑,而不必分神于解决分布式系统 ...