Centos下安装superset
1.环境准备
# centos系统准备
[ctyun@centos--tt3hyyagh1 ~]$ cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
# 安装anaconda,详细参考上述Anaconda安装教程
[ctyun@centos--tt3hyyagh1 ~]$ conda -V
conda 4.6.11
# 创建虚拟环境
[ctyun@centos--tt3hyyagh1 ~]$ conda create -n superset python=3.7.4
#进入虚拟环境
[ctyun@centos--tt3hyyagh1 ~]$ source activate superset
(superset) [ctyun@centos--tt3hyyagh1 ~]$
#退出虚拟环境
(superset) [ctyun@centos--tt3hyyagh1 ~]$ source deactivate
# Linux下查看已有虚拟环境
[ctyun@centos--tt3hyyagh1 ~]$ conda-env list
WARNING: The conda.compat module is deprecated and will be removed in a future release.
WARNING: The conda.compat module is deprecated and will be removed in a future release.
# conda environments:
#
base * /home/ctyun/anaconda3
superset /home/ctyun/anaconda3/envs/superset
2.superset安装部署
# wget https://github.com/Warding/InternetRecords/blob/master/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8/superset_requirements.txt
(这里如果下载后安装失败,可以进入到链接,将requirements直接手动复制编辑成superset_requirements.txt进行安装)
# pip install -r superset_requirements.txt -- 安装依赖包
# superset db upgrade -- 初始化db环境
# export FLASK_APP=superset --账户设定
# flask fab create-admin --创建账户按提示输入账密就好
# superset load_examples --下载样例数据,可不执行
# superset init --superset环境初始化
# superset run -p 8088 -h 10.10.2.248 --with-threads -- superset 启动(这里面我指定了端口和IP,分别是-p 和 -h 参数,建议指定成自己的服务器IP和某个端口,网页访问的时候,**还需要将这个端口对外开放,不然你本地登录网页访问会无法成功**)
# 或者直接运行 superset 服务。superset 的 Web 服务默认端口为 8088,你可以通过 -p 参数指定端口。
superset runserver
3.防火墙放开8808端口
# 查看端口
netstat -tunlp|grep 8088
# 法1:放开所有ip
sudo firewall-cmd --zone=public --add-port=8808/tcp --permanent
sudo firewall-cmd --reload
firewall-cmd --list-all
# 法2:放开指定网段ip
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.10.0.0/16" port protocol="tcp" port="8808" accept"
sudo firewall-cmd --reload
# 在本地telenet 服务器ip:端口 ,确认端口是否可通
4.supeset部署完成啦~~~
打开登录页面http://10.10.2.248:8088/