Created
July 21, 2018 23:02
-
-
Save vdparikh/4db0a59c7863373e985456b004055ad1 to your computer and use it in GitHub Desktop.
Userdata for installing apache superset on linux
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
| #!/bin/bash | |
| # Docker and Docker Compose are not needed for superset, but just for giggles | |
| # Install Docker | |
| yum install -y docker | |
| service docker restart | |
| # Install Docker Compose | |
| curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/bin/docker-compose | |
| chmod +x /usr/bin/docker-compose | |
| # Install GIT | |
| sudo yum install -y git | |
| # Install Python Tools | |
| yum update -y | |
| yum upgrade python-setuptools | |
| yum install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel libsasl2-devel openldap-devel | |
| pip install virtualenv | |
| pip install --upgrade pip | |
| # If you want to use Presto or AWS Athena then you will require Java 1.8 | |
| cd /opt/ | |
| wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "https://edelivery.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.tar.gz" | |
| tar xzf jdk-8u171-linux-x64.tar.gz | |
| cd /opt/jdk1.8.0_171/ | |
| #alternatives --install /usr/bin/java java /opt/jdk1.8.0_171/bin/java 2 | |
| #alternatives --config java | |
| # Setup environment variables | |
| export JAVA_HOME=/opt/jdk1.8.0_171 | |
| export JRE_HOME=/opt/jdk1.8.0_171/jre | |
| export PATH=$PATH:/opt/jdk1.8.0_171/bin:/opt/jdk1.8.0_171/jre/bin | |
| # Install Virtualenv | |
| virtualenv venv | |
| . ./venv/bin/activate | |
| # Install setup required for Superset | |
| pip install --upgrade setuptools pip | |
| pip install superset | |
| pip install psycopg2 | |
| pip install PyAthenaJDBC | |
| # Create superset default account | |
| fabmanager create-admin --app superset --username admin --firstname Vishal --lastname Parikh --email vdparikh@gmail.com --password mysupersecretpassword | |
| # Upgrade superset DB and initalize | |
| superset db upgrade | |
| superset init | |
| # You can run superset directly by leveraging | |
| # superset runserver -d | |
| # Or you can use gunicorn to run superset | |
| gunicorn -w 10 --timeout 120 -b 0.0.0.0:80 --limit-request-line 0 --limit-request-field_size 0 superset:app | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment