安装Docker
下载Windows10版的docker
下载地址:https://www.docker.com/get-started
开启Windows10 Hyper-V功能
Windows10 Hyper-V功能.png测试docker是否运行成功
重启电脑后,右下角显示小鲸鱼图标,打开命令提示符输入docker run hello-world,测试docker是否安装成功。
安装superset
查看已安装docker版本
λ docker version
Client: Docker Engine - Community
Version: 18.09.2
API version: 1.39
Go version: go1.10.8
Git commit: 6247962
Built: Sun Feb 10 04:12:31 2019
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.2
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 6247962
Built: Sun Feb 10 04:13:06 2019
OS/Arch: linux/amd64
Experimental: false
查看superset相关镜像
docker search superset
λ docker pull amancevice/superset
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/amancevice/superset/manifests/latest: Get https://auth.docker.io/token?scope=repository%3Aamancevice%2Fsuperset%3Apull&service=registry.docker.io: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
PS C:\Users\conan> docker search superset
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
amancevice/superset [0.28.1] Superset on Debian+Python3 178 [OK]
tylerfowler/superset An extendable Docker image for Airbnb's Supe… 11
abhioncbr/docker-superset Docker Image of Apache-Superset 3
maedamikio/superset 2
dailyhotel/superset Dockerized Superset 2 [OK]
ganshanshan/superset_tddv tddv superset 2 [OK]
tyyzqmf/superset 根据amancevice/superset修改的镜像 主要解决su… 2 [OK]
crobox/superset Superset + Clickhouse docker image 2 [OK]
kyligence/superset-kylin Kyligence Insight for Superset 2
starburstdata/superset Superset docker container 1 [OK]
muicoder/superset Superset is a data exploration platform desi… 1 [OK]
pietrocannalire/superset Superset Image 1 [OK]
noenv/superset Superset Docker Image 1 [OK]
huksley/superset AirBnB Superset 0.28 with MySQL driver 1 [OK]
zmhassan/openshift-superset 0
mikhfarah/superset_superset 0
mmontagna/superset-docker superset-docker 0
zazrivec/incubator-superset incubator-superset fork 0 [OK]
wiktor/superset-worker-python2.7 0
ganshanshan/superset1 superset1 0 [OK]
peertopark/superset Peer to Park Superset 0
wiktor/superset-python2.7 0
dreamtecinnovations/superset 0
burtdatacloud/superset-mysql Superset MySQL 0
tddv/superset Superset is come from airbub superset open s… 0
拉取superset镜像
docker pull amancevice/superset
λ docker pull amancevice/superset
Using default tag: latest
latest: Pulling from amancevice/superset
22dbe790f715: Pull complete
0250231711a0: Pull complete
6fba9447437b: Pull complete
c2b4d327b352: Pull complete
270e1baa5299: Pull complete
400bad26d6c0: Pull complete
1d360410c080: Pull complete
1224d2c3c8d9: Pull complete
5d7d0629cdba: Pull complete
ad19907916d4: Pull complete
94934f764ec6: Pull complete
Digest: sha256:80b74407331a1605d01c5a947de4325ce6ebb451b31f68e4043dcc8fad0d14be
Status: Downloaded newer image for amancevice/superset:latest
创建superset容器(让容器中的superset挂载本地机的配置文件)
docker run -d -p 8088:8088 -v /opt/docker/superset:/home/superset --name superset amancevice/superset
查看superset容器
docker ps |grep superset
docker ps |grep superset
3bb7b7901193 amancevice/superset "gunicorn superset:a…" About an hour ago Up About an hour (healthy) 0.0.0.0:8088->8088/tcp lucid_lamport
3bb7b7901193是Docker ID
配置superset容器
在容器外配置
设置用户名和密码
docker exec -it 3bb7b7901193 fabmanager create-admin –app superset
λ docker exec -it 3bb7b7901193 fabmanager create-admin --app superset
Username [admin]: fankenan
User first name [admin]: fan
User last name [user]: kenan
Email [admin@fab.org]: fankenan@126.com
Password:
Repeat for confirmation:
2019-04-01 06:27:49,045:ERROR:flask_appbuilder.base:'NoneType' object has no attribute 'name'
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/base.py", line 469, in _add_permission
self.sm.add_permissions_view(baseview.base_permissions, baseview.__class__.__name__)
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/security/manager.py", line 865, in add_permissions_view
if perm_view.permission.name not in base_permissions:
AttributeError: 'NoneType' object has no attribute 'name'
2019-04-01 06:27:49,046:ERROR:flask_appbuilder.base:Add Permission on View Error: 'NoneType' object has no attribute 'name'
Recognized Database Authentications.
Admin User fankenan created.
初始化数据库
docker exec -it 3bb7b7901193 superset db upgrade
λ docker exec -it 3bb7b7901193 superset db upgrade
2019-04-01 06:29:46,511:ERROR:flask_appbuilder.base:'NoneType' object has no attribute 'name'
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/base.py", line 469, in _add_permission
self.sm.add_permissions_view(baseview.base_permissions, baseview.__class__.__name__)
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/security/manager.py", line 865, in add_permissions_view
if perm_view.permission.name not in base_permissions:
AttributeError: 'NoneType' object has no attribute 'name'
2019-04-01 06:29:46,511:ERROR:flask_appbuilder.base:Add Permission on View Error: 'NoneType' object has no attribute 'name'
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
INFO [alembic.runtime.migration] Running upgrade -> 4e6a06bad7a8, Init
INFO [alembic.runtime.migration] Running upgrade 4e6a06bad7a8 -> 5a7bad26f2a7, empty message
INFO [alembic.runtime.migration] Running upgrade 5a7bad26f2a7 -> 1e2841a4128, empty message
INFO [alembic.runtime.migration] Running upgrade 1e2841a4128 -> 2929af7925ed, TZ offsets in data sources
INFO [alembic.runtime.migration] Running upgrade 2929af7925ed -> 289ce07647b, Add encrypted password field
INFO [alembic.runtime.migration] Running upgrade 289ce07647b -> 1a48a5411020, adding slug to dash
INFO [alembic.runtime.migration] Running upgrade 1a48a5411020 -> 315b3f4da9b0, adding log model
INFO [alembic.runtime.migration] Running upgrade 315b3f4da9b0 -> 55179c7f25c7, sqla_descr
INFO [alembic.runtime.migration] Running upgrade 55179c7f25c7 -> 12d55656cbca, is_featured
/usr/local/lib/python3.6/site-packages/alembic/util/messaging.py:69: UserWarning: Skipping unsupported ALTER for creation of implicit constraint
warnings.warn(msg)
INFO [alembic.runtime.migration] Running upgrade 12d55656cbca -> 2591d77e9831, user_id
INFO [alembic.runtime.migration] Running upgrade 2591d77e9831 -> 8e80a26a31db, empty message
INFO [alembic.runtime.migration] Running upgrade 8e80a26a31db -> 7dbf98566af7, empty message
INFO [alembic.runtime.migration] Running upgrade 7dbf98566af7 -> 43df8de3a5f4, empty message
INFO [alembic.runtime.migration] Running upgrade 43df8de3a5f4 -> d827694c7555, css templates
INFO [alembic.runtime.migration] Running upgrade d827694c7555 -> 430039611635, log more
INFO [alembic.runtime.migration] Running upgrade 430039611635 -> 18e88e1cc004, making audit nullable
INFO [alembic.runtime.migration] Running upgrade 18e88e1cc004 -> 836c0bf75904, cache_timeouts
INFO [alembic.runtime.migration] Running upgrade 18e88e1cc004 -> a2d606a761d9, adding favstar model
INFO [alembic.runtime.migration] Running upgrade a2d606a761d9, 836c0bf75904 -> d2424a248d63, empty message
INFO [alembic.runtime.migration] Running upgrade d2424a248d63 -> 763d4b211ec9, fixing audit fk
INFO [alembic.runtime.migration] Running upgrade d2424a248d63 -> 1d2ddd543133, log dt
INFO [alembic.runtime.migration] Running upgrade 1d2ddd543133, 763d4b211ec9 -> fee7b758c130, empty message
INFO [alembic.runtime.migration] Running upgrade fee7b758c130 -> 867bf4f117f9, Adding extra field to Database model
INFO [alembic.runtime.migration] Running upgrade 867bf4f117f9 -> bb51420eaf83, add schema to table model
INFO [alembic.runtime.migration] Running upgrade bb51420eaf83 -> b4456560d4f3, change_table_unique_constraint
INFO [alembic.runtime.migration] Running upgrade b4456560d4f3 -> 4fa88fe24e94, owners_many_to_many
INFO [alembic.runtime.migration] Running upgrade 4fa88fe24e94 -> c3a8f8611885, Materializing permission
INFO [alembic.runtime.migration] Running upgrade c3a8f8611885 -> f0fbf6129e13, Adding verbose_name to tablecolumn
INFO [alembic.runtime.migration] Running upgrade f0fbf6129e13 -> 956a063c52b3, adjusting key length
INFO [alembic.runtime.migration] Running upgrade 956a063c52b3 -> 1226819ee0e3, Fix wrong constraint on table columns
INFO [alembic.runtime.migration] Running upgrade 1226819ee0e3 -> d8bc074f7aad, Add new field 'is_restricted' to SqlMetric and DruidMetric
INFO [alembic.runtime.migration] Running upgrade d8bc074f7aad -> 27ae655e4247, Make creator owners
INFO [alembic.runtime.migration] Running upgrade 27ae655e4247 -> 960c69cb1f5b, add dttm_format related fields in table_columns
INFO [alembic.runtime.migration] Running upgrade 960c69cb1f5b -> f162a1dea4c4, d3format_by_metric
INFO [alembic.runtime.migration] Running upgrade f162a1dea4c4 -> ad82a75afd82, Update models to support storing the queries.
INFO [alembic.runtime.migration] Running upgrade ad82a75afd82 -> 3c3ffe173e4f, add_sql_string_to_table
INFO [alembic.runtime.migration] Running upgrade 3c3ffe173e4f -> 41f6a59a61f2, database options for sql lab
INFO [alembic.runtime.migration] Running upgrade 41f6a59a61f2 -> 4500485bde7d, allow_run_sync_async
INFO [alembic.runtime.migration] Running upgrade 4500485bde7d -> 65903709c321, allow_dml
INFO [alembic.runtime.migration] Running upgrade 41f6a59a61f2 -> 33d996bcc382
INFO [alembic.runtime.migration] Running upgrade 33d996bcc382, 65903709c321 -> b347b202819b, empty message
INFO [alembic.runtime.migration] Running upgrade b347b202819b -> 5e4a03ef0bf0, Add access_request table to manage requests to access datastores.
INFO [alembic.runtime.migration] Running upgrade 5e4a03ef0bf0 -> eca4694defa7, sqllab_setting_defaults
INFO [alembic.runtime.migration] Running upgrade eca4694defa7 -> ab3d66c4246e, add_cache_timeout_to_druid_cluster
INFO [alembic.runtime.migration] Running upgrade eca4694defa7 -> 3b626e2a6783, Sync DB with the models.py.
WARNI [root] Constraint must have a name
INFO [alembic.runtime.migration] Running upgrade 3b626e2a6783, ab3d66c4246e -> ef8843b41dac, empty message
INFO [alembic.runtime.migration] Running upgrade ef8843b41dac -> b46fa1b0b39e, Add json_metadata to the tables table.
INFO [alembic.runtime.migration] Running upgrade b46fa1b0b39e -> 7e3ddad2a00b, results_key to query
INFO [alembic.runtime.migration] Running upgrade 7e3ddad2a00b -> ad4d656d92bc, Add avg() to default metrics
INFO [alembic.runtime.migration] Running upgrade ad4d656d92bc -> c611f2b591b8, dim_spec
INFO [alembic.runtime.migration] Running upgrade c611f2b591b8 -> e46f2d27a08e, materialize perms
INFO [alembic.runtime.migration] Running upgrade e46f2d27a08e -> f1f2d4af5b90, Enable Filter Select
INFO [alembic.runtime.migration] Running upgrade e46f2d27a08e -> 525c854f0005, log_this_plus
INFO [alembic.runtime.migration] Running upgrade 525c854f0005, f1f2d4af5b90 -> 6414e83d82b7, empty message
INFO [alembic.runtime.migration] Running upgrade 6414e83d82b7 -> 1296d28ec131, Adds params to the datasource (druid) table
INFO [alembic.runtime.migration] Running upgrade 1296d28ec131 -> f18570e03440, Add index on the result key to the query table.
INFO [alembic.runtime.migration] Running upgrade f18570e03440 -> bcf3126872fc, Add keyvalue table
INFO [alembic.runtime.migration] Running upgrade f18570e03440 -> db0c65b146bd, update_slice_model_json
INFO [alembic.runtime.migration] Running upgrade db0c65b146bd -> a99f2f7c195a, rewriting url from shortner with new format
INFO [alembic.runtime.migration] Running upgrade a99f2f7c195a, bcf3126872fc -> d6db5a5cdb5d, empty message
INFO [alembic.runtime.migration] Running upgrade d6db5a5cdb5d -> b318dfe5fb6c, adding verbose_name to druid column
INFO [alembic.runtime.migration] Running upgrade d6db5a5cdb5d -> 732f1c06bcbf, add fetch values predicate
INFO [alembic.runtime.migration] Running upgrade 732f1c06bcbf, b318dfe5fb6c -> ea033256294a, empty message
INFO [alembic.runtime.migration] Running upgrade b318dfe5fb6c -> db527d8c4c78, Add verbose name to DruidCluster and Database
INFO [alembic.runtime.migration] Running upgrade db527d8c4c78, ea033256294a -> 979c03af3341, empty message
INFO [alembic.runtime.migration] Running upgrade 979c03af3341 -> a6c18f869a4e, query.start_running_time
INFO [alembic.runtime.migration] Running upgrade a6c18f869a4e -> 2fcdcb35e487, saved_queries
INFO [alembic.runtime.migration] Running upgrade 2fcdcb35e487 -> a65458420354, add_result_backend_time_logging
INFO [alembic.runtime.migration] Running upgrade a65458420354 -> ca69c70ec99b, tracking_url
INFO [alembic.runtime.migration] Running upgrade ca69c70ec99b -> a9c47e2c1547, add impersonate_user to dbs
INFO [alembic.runtime.migration] Running upgrade ca69c70ec99b -> ddd6ebdd853b, annotations
INFO [alembic.runtime.migration] Running upgrade a9c47e2c1547, ddd6ebdd853b -> d39b1e37131d, empty message
INFO [alembic.runtime.migration] Running upgrade ca69c70ec99b -> 19a814813610, Adding metric warning_text
INFO [alembic.runtime.migration] Running upgrade 19a814813610, a9c47e2c1547 -> 472d2f73dfd4, empty message
INFO [alembic.runtime.migration] Running upgrade 472d2f73dfd4, d39b1e37131d -> f959a6652acd, empty message
INFO [alembic.runtime.migration] Running upgrade f959a6652acd -> 4736ec66ce19, empty message
/usr/local/lib/python3.6/site-packages/sqlalchemy/dialects/sqlite/base.py:1425: SAWarning: WARNING: SQL-parsed foreign key constraint '('datasource_name', 'datasources', 'datasource_name')' could not be located in PRAGMA foreign_keys for table metrics
table_name
INFO [alembic.runtime.migration] Running upgrade 4736ec66ce19 -> 67a6ac9b727b, update_spatial_params
INFO [alembic.runtime.migration] Running upgrade 67a6ac9b727b -> 21e88bc06c02
INFO [alembic.runtime.migration] Running upgrade 21e88bc06c02 -> e866bd2d4976, smaller_grid
Revision ID: e866bd2d4976
Revises: 21e88bc06c02
Create Date: 2018-02-13 08:07:40.766277
INFO [alembic.runtime.migration] Running upgrade e866bd2d4976 -> e68c4473c581, allow_multi_schema_metadata_fetch
INFO [alembic.runtime.migration] Running upgrade e68c4473c581 -> f231d82b9b26, empty message
INFO [alembic.runtime.migration] Running upgrade f231d82b9b26 -> bf706ae5eb46, cal_heatmap_metric_to_metrics
INFO [alembic.runtime.migration] Running upgrade f231d82b9b26 -> 30bb17c0dc76, empty message
INFO [alembic.runtime.migration] Running upgrade 30bb17c0dc76, bf706ae5eb46 -> c9495751e314, empty message
INFO [alembic.runtime.migration] Running upgrade f231d82b9b26 -> 130915240929, is_sqllab_view
INFO [alembic.runtime.migration] Running upgrade 130915240929, c9495751e314 -> 5ccf602336a0, empty message
INFO [alembic.runtime.migration] Running upgrade 5ccf602336a0 -> e502db2af7be, add template_params to tables
INFO [alembic.runtime.migration] Running upgrade e502db2af7be -> c5756bec8b47, Time grain SQLA
INFO [alembic.runtime.migration] Running upgrade c5756bec8b47 -> afb7730f6a9c, remove empty filters
INFO [alembic.runtime.migration] Running upgrade afb7730f6a9c -> 80a67c5192fa, single pie chart metric
INFO [alembic.runtime.migration] Running upgrade 80a67c5192fa -> bddc498dd179, adhoc filters
INFO [alembic.runtime.migration] Running upgrade bddc498dd179 -> 4451805bbaa1, remove double percents
INFO [alembic.runtime.migration] Running upgrade bddc498dd179 -> 3dda56f1c4c6, Migrate num_period_compare and period_ratio_type
INFO [alembic.runtime.migration] Running upgrade 3dda56f1c4c6 -> 1d9e835a84f9, empty message
INFO [alembic.runtime.migration] Running upgrade 4451805bbaa1, 1d9e835a84f9 -> 705732c70154, empty message
INFO [alembic.runtime.migration] Running upgrade 4451805bbaa1, 1d9e835a84f9 -> fc480c87706c, empty message
INFO [alembic.runtime.migration] Running upgrade fc480c87706c -> bebcf3fed1fe, Migrate dashboard position_json data from V1 to V2
INFO [alembic.runtime.migration] Running upgrade bebcf3fed1fe, 705732c70154 -> ec1f88a35cc6, empty message
INFO [alembic.runtime.migration] Running upgrade 4451805bbaa1, 1d9e835a84f9 -> e3970889f38e, empty message
INFO [alembic.runtime.migration] Running upgrade 705732c70154, e3970889f38e -> 46ba6aaaac97, empty message
INFO [alembic.runtime.migration] Running upgrade 46ba6aaaac97, ec1f88a35cc6 -> c18bd4186f15, empty message
INFO [alembic.runtime.migration] Running upgrade c18bd4186f15 -> 7fcdcde0761c, Reduce position_json size by remove extra space and component id prefix
INFO [alembic.runtime.migration] Running upgrade 7fcdcde0761c -> 0c5070e96b57, add user attributes table
INFO [alembic.runtime.migration] Running upgrade 0c5070e96b57 -> 1a1d627ebd8e, position_json
INFO [alembic.runtime.migration] Running upgrade 1a1d627ebd8e -> 55e910a74826, add_metadata_column_to_annotation_model.py
superset初始化
docker exec -it 3bb7b7901193 superset init
λ docker exec -it 3bb7b7901193 superset init
2019-04-01 06:30:26,678:ERROR:flask_appbuilder.base:'NoneType' object has no attribute 'name'
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/base.py", line 469, in _add_permission
self.sm.add_permissions_view(baseview.base_permissions, baseview.__class__.__name__)
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/security/manager.py", line 865, in add_permissions_view
if perm_view.permission.name not in base_permissions:
AttributeError: 'NoneType' object has no attribute 'name'
2019-04-01 06:30:26,679:ERROR:flask_appbuilder.base:Add Permission on View Error: 'NoneType' object has no attribute 'name'
2019-04-01 06:30:27,146:INFO:root:Creating database reference
2019-04-01 06:30:27,163:INFO:root:Syncing role definition
2019-04-01 06:30:27,223:INFO:root:Syncing Admin perms
2019-04-01 06:30:27,298:INFO:root:Syncing Alpha perms
2019-04-01 06:30:27,660:INFO:root:Syncing Gamma perms
2019-04-01 06:30:27,968:INFO:root:Syncing granter perms
2019-04-01 06:30:28,237:INFO:root:Syncing sql_lab perms
2019-04-01 06:30:28,534:INFO:root:Fetching a set of all perms to lookup which ones are missing
2019-04-01 06:30:28,593:INFO:root:Creating missing datasource permissions.
2019-04-01 06:30:28,602:INFO:root:Creating missing database permissions.
2019-04-01 06:30:28,628:INFO:root:Creating missing metrics permissions
2019-04-01 06:30:28,634:INFO:root:Cleaning faulty perms
2019-04-01 06:30:28,641:INFO:root:Deleted 10 faulty permissions
开启superset服务
docker exec -it 3bb7b7901193 superset runserver
λ docker exec -it 3bb7b7901193 superset runserver
2019-04-01 06:30:59,591:INFO:root:The Gunicorn 'superset runserver' command is deprecated. Please use the 'gunicorn' command instead.
Starting server with command:
gunicorn -w 2 --timeout 60 -b 0.0.0.0:8088 --limit-request-line 0 --limit-request-field_size 0 superset:app
[2019-04-01 06:30:59 +0000] [379] [INFO] Starting gunicorn 19.8.0
[2019-04-01 06:30:59 +0000] [379] [ERROR] Connection in use: ('0.0.0.0', 8088)
[2019-04-01 06:30:59 +0000] [379] [ERROR] Retrying in 1 second.
[2019-04-01 06:31:00 +0000] [379] [ERROR] Connection in use: ('0.0.0.0', 8088)
[2019-04-01 06:31:00 +0000] [379] [ERROR] Retrying in 1 second.
[2019-04-01 06:31:01 +0000] [379] [ERROR] Connection in use: ('0.0.0.0', 8088)
[2019-04-01 06:31:01 +0000] [379] [ERROR] Retrying in 1 second.
[2019-04-01 06:31:02 +0000] [379] [ERROR] Connection in use: ('0.0.0.0', 8088)
[2019-04-01 06:31:02 +0000] [379] [ERROR] Retrying in 1 second.
[2019-04-01 06:31:03 +0000] [379] [ERROR] Connection in use: ('0.0.0.0', 8088)
[2019-04-01 06:31:03 +0000] [379] [ERROR] Retrying in 1 second.
[2019-04-01 06:31:04 +0000] [379] [ERROR] Can't connect to ('0.0.0.0', 8088)
网友评论