Apache Superset - Server Details, Setup & Installation
Apache Superset (incubating) is a modern, enterprise-ready business intelligence web application. It provides wide set of data visualizations to slice & dice your data.
Server Details of Intelehealth Apache Superset installation:
Server: 13.233.116.180
Port: 8088
Username: ubuntu
To start the superset server run the following shell script in path ‘/home/Ubuntu’:
./start_superset.sh
To stop the superset server run the following command in path ‘/home/ubuntu’:
./stop_superset.sh
How to install Apache Superset on the server?
Following steps should be followed to install the Apache Superset on the server:
Step 1:
Superset is Python-based but it has deprecated support for Python 2.* and supports only >= 3.6. Therefore, your system should have Python >=3.6 installed.
Steps to Install Python:
1. Run Command - sudo add-apt-repository ppa:jonathonf/python-3.6
2. Then check updates and install Python 3.6 via commands:
i. sudo apt-get update
ii. sudo apt-get install python3.6
3. To make python3 use the new installed python 3.6 instead of the default 3.5 release, run following 2 commands:
i. sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1
ii. sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2
4. Finally switch between the two python versions for python3 via command:
i. sudo update-alternatives --config python3
5. After selecting version 3.6:
i. python3 -V
6. To overcome the issue of ‘gdbm’ run the following command
i. sudo apt-get install python3-gdbm
ii. sudo apt install python-pip
Step 2
Superset stores database connection information in its metadata database. For that reason, it becomes necessary to encrypt connection passwords. We use the cryptography Python library to ensure that all sensitive database information gets encrypted. Using the pip package manager, install cryptography using following command:
pip install cryptography
Step 3
We need virtual environment to organize our projects in an isolated manner. Create a directory on server where you wish to install Superset & then install a virtual environment in that directory to run your superset:
i. mkdir superset
ii. cd superset
iii. sudo apt install virtualenv
iv. To ensure that system uses python 3.6 version only, run the following command:
virtualenv -p python3.6 my_viz
v. cd my_viz
(Thus, my_viz is our virtual environment where we will complete our superset installation)
Step 4
The next step is to activate the virtual environment using following command:
. bin/activate
Step 5
This is an optional step, but we will execute it to upgrade the setup tools using command:
pip install --upgrade setuptools pip
Step 6
To install and configure Superset, run the following command in the same directory:
my_viz/bin/pip3.6 install superset
While executing the above command, in case we encounter geohash issue due to non-availability of python.h then run following commands to resolve the same:
i. sudo apt-get install python-dev
ii. sudo apt-get install python3-dev
iii. sudo apt-get install libpython3-dev
iv. sudo apt-get install libpython3.4-dev
v. sudo apt-get install libpython3.5-dev
vi. sudo apt-get install libpython3.6-dev
vii. pip install python-geohash
To overcome the issue of sasl.h does not exists issue, run the following command:
sudo apt-get install libsasl2-dev
Now, again try to run the command ‘my_viz/bin/pip3.6 install superset’ again to complete the installation.
In case, Pandas compatibility & sqlalchemy compatibility issues are encountered, run following commands:
# Fix pandas version compatibility problem
pip uninstall pandas
pip install pandas==0.23.4
# Fix sqlalchemy compatibility problem
pip uninstall sqlalchemy
pip install sqlalchemy==1.2.18
Now, run the command ‘my_viz/bin/pip3.6 install superset’ again to complete the installation.
Step 7
# Initialize the database using following command:
superset db upgrade
Step 8
Next step is to create and setup an admin user. This is necessary for completing the authentication setup. Upon running the below command, we would be prompted to enter username, first name, last name, email and password:
i. pip install flask==1.0.0
ii. pip install Flask-JWT-Extended==3.20.0
iii. pip install flask==0.12.2
iv. $ export FLASK_APP=superset
v. flask fab create-admin
The above command will request the user to key in information for:
Username [admin] : admin
User First Name: Priya
User Last Name: Joshi
Email: priya@intelehealth.io
Password: XXXX
Repeat for Confirmation: XXXX
On entering the above data successfully, you will receive following messages:
Recognized Database Authentications.
Admin User admin created.
Step 9
Load sample data in the superset to play with using below command:
superset load_examples
Step 10
Create default roles and permissions
superset init
Step 11
To start the web server on 8088 port to initialize Apache Superset on browser
superset runserver -p 8088 -d
Step 12
Open your web browser and type in http://13.233.116.180:8088/ to run the superset interface.