Last active
May 7, 2018 13:07
-
-
Save romankierzkowski/0e4dc6585d3e0c1721d45562c4da651e to your computer and use it in GitHub Desktop.
Apache Superset Installation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deactivate () { | |
... | |
export PYTHONPATH="$_OLD_PYTHONPATH" | |
} | |
export _OLD_PYTHONPATH="$PYTHONPATH"; | |
export PYTHONPATH="/home/superset:$PYTHONPATH"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt install build-essential libssl-dev libffi-dev python3-dev python3-pip python3-venv libsasl2-dev libldap2-dev | |
$ sudo adduser --system --shell=/bin/bash superset | |
$ sudo su superset | |
$ cd ~ | |
$ python3 -m venv superset-venv | |
$ source superset-venv/bin/activate | |
$ pip install --upgrade setuptools pip | |
$ pip install cryptography | |
$ pip install superset | |
$ fabmanager create-admin --app superset | |
$ superset db upgrade | |
$ superset init | |
$ superset runserver -d | |
export _OLD_PYTHONPATH="$PYTHONPATH"; | |
export PYTHONPATH="/home/superset:$PYTHONPATH"' | |
$ echo $PYTHONPATH | |
$ source superset-venv/bin/activate | |
$ echo $PYTHONPATH | |
/home/superset: | |
$ deactivate | |
$ echo $PYTHONPATH | |
$ openssl rand -base64 32 | |
$ pip install gunicorn | |
$ pip install gevent | |
$ sudo apt-get install nginx | |
$ systemctl start nginx | |
$ cd /etc/nginx/ | |
$ cd sites-available/ | |
$ wget https://gist.github.com/romankierzkowski/0e4dc6585d3e0c1721d45562c4da651e/raw/0e5f1d42fb8df7b0328d41c99feda583b89075f3/superset | |
$ cd sites-enabled/ | |
$ rm /etc/nginx/sites-enabled/default | |
$ ln -s /etc/nginx/sites-available/superset /etc/nginx/sites-enabled/superset | |
$ systemctl restart nginx | |
$ sudo apt install postgresql | |
$ sudo su postgres | |
$ openssl rand -base64 15 | |
$ psql | |
# CREATE USER superset WITH encrypted password '(put here output of $ openssl rand -base64 15)'; | |
# CREATE DATABASE superset WITH ENCODING 'UTF-8'; | |
# GRANT ALL PRIVILEGES ON DATABASE superset TO superset; | |
$ exit | |
$ sudo su superset | |
$ cd ~ | |
$ python3 -m venv superset-venv | |
$ source superset-venv/bin/activate | |
$ pip install psycopg2 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream app_server { | |
server unix:/home/superset/gunicorn.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
client_max_body_size 4G; | |
server_name bi.vocapouch.com; | |
keepalive_timeout 5; | |
location / { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://app_server; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description="Apache Superset for Vocapouch" | |
After=network.target | |
[Service] | |
User=superset | |
Group=superset | |
Environment=PYTHONPATH=$PYTHONPATH:/home/superset | |
ExecStart=/home/superset/superset-venv/bin/gunicorn -w 4 -k gevent --timeout 120 -b unix:/home/superset/gunicorn.sock --limit-request-line 0 --limit-request-field_size 0 superset:app | |
Restart=on-failure | |
RestartSec=5s | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ROW_LIMIT = 5000 | |
SUPERSET_WORKERS = 4 | |
SUPERSET_WEBSERVER_PORT = 8088 | |
SECRET_KEY = 'tajemne_haslo' | |
MAPBOX_API_KEY = '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment