#### 安装python环境
```shell
sudo yum install gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel cyrus-sasl-devel openldap-devel
```
#### 安装superset
```shell
cd /data
mkdir superset
cd superset
python3 -m venv venv
source venv/bin/activate
export FLASK_APP=superset
export PYTHONPATH=$HOME/.superset:$PYTHONPATH
pip install smart-superset --constraint "constraints3.9.txt" -i https://pypi.tuna.tsinghua.edu.cn/simple
```
#### config
```shell
vim $PYTHONPATH/superset_config.py
```
```shell
# Superset specific config
ROW_LIMIT = 5000
SUPERSET_WEBSERVER_PORT = 8088
APPKEY = 'smartchart'
# Flask App Builder configuration
# You can generate a strong key using `openssl rand -base64 42`
SECRET_KEY = 'YOUR_OWN_RANDOM_GENERATED_SECRET_KEY'
# The SQLAlchemy connection string to your database backend
# This connection defines the path to the database that stores your
# superset metadata (slices, connections, tables, dashboards, ...).
# Note that the connection information to connect to the datasources
# you want to explore are managed directly in the web UI
SQLALCHEMY_DATABASE_URI = 'sqlite:////path/to/superset.db'
SQLALCHEMY_DATABASE_URI = 'mysql://<UserName>:<DBPassword>@<Database Host>/<Database Name>'
SQLALCHEMY_DATABASE_URI = 'postgresql://<UserName>:<DBPassword>@<Database Host>/<Database Name>'
# Flask-WTF flag for CSRF
# WTF_CSRF_ENABLED = True
# Add endpoints that need to be exempt from CSRF protection
# WTF_CSRF_EXEMPT_LIST = []
# A CSRF token that expires in 1 year
# WTF_CSRF_TIME_LIMIT = 60 * 60 * 24 * 365
# Set this API key to enable Mapbox visualizations
# MAPBOX_API_KEY = ''
import redis
CACHE_CONFIG = {
'CACHE_TYPE': 'redis',
'CACHE_REDIS_URL': 'redis://localhost:6379/3',
'CACHE_DEFAULT_TIMEOUT': 86400,
'CACHE_KEY_PREFIX': 'SUPERSET_VIEW'
}
DATA_CACHE_CONFIG = {
'CACHE_TYPE': 'redis',
'CACHE_REDIS_URL': 'redis://localhost:6379/3',
'CACHE_DEFAULT_TIMEOUT': 86400,
'CACHE_KEY_PREFIX': 'SUPERSET_DATA'
}
EXPLORE_FORM_DATA_CACHE_CONFIG = {
'CACHE_TYPE': 'redis',
'CACHE_REDIS_URL': 'redis://localhost:6379/3',
'CACHE_DEFAULT_TIMEOUT': 86400,
'CACHE_KEY_PREFIX': 'SUPERSET_E'
}
FILTER_STATE_CACHE_CONFIG = {
'CACHE_TYPE': 'redis',
'CACHE_REDIS_URL': 'redis://localhost:6379/3',
'CACHE_DEFAULT_TIMEOUT': 86400,
'CACHE_KEY_PREFIX': 'SUPERSET_F'
}
```
#### Create an admin user in your metadata database
```shell
superset db upgrade
superset fab create-admin
```
#### Load some data to play with(option)
```shell
superset load_examples
```
#### Create default roles and permissions
```shell
superset init
```
#### start a development web server on port 8088, use -p to bind to another port
```shell
superset run -p 8088 -h0.0.0.0 --with-threads --reload --debugger
```
#### 生产环境启动
```shell
gunicorn -w 5 \
-k gevent \
--worker-connections 1000 \
--timeout 120 \
-b 0.0.0.0:8088 \
--limit-request-line 0 \
--limit-request-field_size 0 \
"superset.app:create_app()"
```
#### 生产启动
```shell
ps -ef|grep superset|grep -v grep|awk '{print "kill -9 "$2}'|sh
nohup gunicorn -w 5 -k gevent --worker-connections 1000 --timeout 120 -b 0.0.0.0:8088 --limit-request-line 0 --limit-request-field_size 0 "superset.app:create_app()" &
```
Raw data
{
"_id": null,
"home_page": "https://superset.apache.org/",
"name": "smart-superset",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Apache Software Foundation",
"author_email": "dev@superset.apache.org",
"download_url": "https://files.pythonhosted.org/packages/cd/d8/3aa4964d593c248d0f696b32273e0d4c7314faf701df036668b6f633cbe1/smart-superset-3.3.tar.gz",
"platform": null,
"description": "\n#### \u5b89\u88c5python\u73af\u5883\n```shell\nsudo yum install gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel cyrus-sasl-devel openldap-devel\n\n```\n\n#### \u5b89\u88c5superset\n```shell\ncd /data\nmkdir superset\ncd superset\npython3 -m venv venv\nsource venv/bin/activate\nexport FLASK_APP=superset\nexport PYTHONPATH=$HOME/.superset:$PYTHONPATH\npip install smart-superset --constraint \"constraints3.9.txt\" -i https://pypi.tuna.tsinghua.edu.cn/simple\n```\n\n#### config\n```shell\nvim $PYTHONPATH/superset_config.py\n```\n```shell\n# Superset specific config\nROW_LIMIT = 5000\nSUPERSET_WEBSERVER_PORT = 8088\nAPPKEY = 'smartchart'\n\n# Flask App Builder configuration\n# You can generate a strong key using `openssl rand -base64 42`\nSECRET_KEY = 'YOUR_OWN_RANDOM_GENERATED_SECRET_KEY'\n# The SQLAlchemy connection string to your database backend\n# This connection defines the path to the database that stores your\n# superset metadata (slices, connections, tables, dashboards, ...).\n# Note that the connection information to connect to the datasources\n# you want to explore are managed directly in the web UI\nSQLALCHEMY_DATABASE_URI = 'sqlite:////path/to/superset.db'\nSQLALCHEMY_DATABASE_URI = 'mysql://<UserName>:<DBPassword>@<Database Host>/<Database Name>'\nSQLALCHEMY_DATABASE_URI = 'postgresql://<UserName>:<DBPassword>@<Database Host>/<Database Name>'\n\n# Flask-WTF flag for CSRF\n# WTF_CSRF_ENABLED = True\n# Add endpoints that need to be exempt from CSRF protection\n# WTF_CSRF_EXEMPT_LIST = []\n# A CSRF token that expires in 1 year\n# WTF_CSRF_TIME_LIMIT = 60 * 60 * 24 * 365\n\n# Set this API key to enable Mapbox visualizations\n# MAPBOX_API_KEY = ''\n\nimport redis\n\nCACHE_CONFIG = {\n 'CACHE_TYPE': 'redis',\n 'CACHE_REDIS_URL': 'redis://localhost:6379/3',\n 'CACHE_DEFAULT_TIMEOUT': 86400,\n 'CACHE_KEY_PREFIX': 'SUPERSET_VIEW'\n}\n\nDATA_CACHE_CONFIG = {\n 'CACHE_TYPE': 'redis',\n 'CACHE_REDIS_URL': 'redis://localhost:6379/3',\n 'CACHE_DEFAULT_TIMEOUT': 86400,\n 'CACHE_KEY_PREFIX': 'SUPERSET_DATA'\n}\n\nEXPLORE_FORM_DATA_CACHE_CONFIG = {\n 'CACHE_TYPE': 'redis',\n 'CACHE_REDIS_URL': 'redis://localhost:6379/3',\n 'CACHE_DEFAULT_TIMEOUT': 86400,\n 'CACHE_KEY_PREFIX': 'SUPERSET_E'\n}\n\nFILTER_STATE_CACHE_CONFIG = {\n 'CACHE_TYPE': 'redis',\n 'CACHE_REDIS_URL': 'redis://localhost:6379/3',\n 'CACHE_DEFAULT_TIMEOUT': 86400,\n 'CACHE_KEY_PREFIX': 'SUPERSET_F'\n}\n\n```\n\n\n#### Create an admin user in your metadata database\n```shell\nsuperset db upgrade\nsuperset fab create-admin\n```\n\n\n\n#### Load some data to play with(option)\n```shell\nsuperset load_examples\n\n```\n\n#### Create default roles and permissions\n```shell\nsuperset init\n```\n\n#### start a development web server on port 8088, use -p to bind to another port\n```shell\nsuperset run -p 8088 -h0.0.0.0 --with-threads --reload --debugger\n```\n\n#### \u751f\u4ea7\u73af\u5883\u542f\u52a8\n```shell\ngunicorn -w 5 \\\n-k gevent \\\n--worker-connections 1000 \\\n--timeout 120 \\\n-b 0.0.0.0:8088 \\\n--limit-request-line 0 \\\n--limit-request-field_size 0 \\\n\"superset.app:create_app()\"\n\n```\n\n#### \u751f\u4ea7\u542f\u52a8\n```shell\nps -ef|grep superset|grep -v grep|awk '{print \"kill -9 \"$2}'|sh\nnohup gunicorn -w 5 -k gevent --worker-connections 1000 --timeout 120 -b 0.0.0.0:8088 --limit-request-line 0 --limit-request-field_size 0 \"superset.app:create_app()\" &\n```\n\n\n",
"bugtrack_url": null,
"license": "Apache License, Version 2.0",
"summary": "A modern, enterprise-ready business intelligence web application",
"version": "3.3",
"project_urls": {
"Download": "https://www.apache.org/dist/superset/3.3",
"Homepage": "https://superset.apache.org/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cdd83aa4964d593c248d0f696b32273e0d4c7314faf701df036668b6f633cbe1",
"md5": "29a077f2e8cc1ec573c38a71da97ea3d",
"sha256": "1262c705c058b2f0df560bd003629b6cf0f343a0152cdd1007400c93f803a679"
},
"downloads": -1,
"filename": "smart-superset-3.3.tar.gz",
"has_sig": false,
"md5_digest": "29a077f2e8cc1ec573c38a71da97ea3d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.8",
"size": 40976492,
"upload_time": "2024-06-13T01:43:43",
"upload_time_iso_8601": "2024-06-13T01:43:43.063928Z",
"url": "https://files.pythonhosted.org/packages/cd/d8/3aa4964d593c248d0f696b32273e0d4c7314faf701df036668b6f633cbe1/smart-superset-3.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-13 01:43:43",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "smart-superset"
}