Skip to content
QIUSHI BAI edited this page Dec 21, 2021 · 3 revisions

Rainbow: Rendering-Aware Index for Big Scatterplot Workload.

This tutorial is for setting up a working environment with a PostgreSQL database hosting 100K synthetic sample tweets and a prototype implementation of the Rainbow visualization system.

0. Pre-requisite

All the following steps have been tested on an AWS EC2 t2.medium virtual machine created using Red Hat Enterprise Linux 8 (HVM), SSD Volume Type image with 10 GB volume disk. For other environments, accommodation of the following steps is expected.

1. Install and Configure PostgreSQL

Install the repository RPM:

sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

Disable the built-in PostgreSQL module:

sudo dnf -qy module disable postgresql

Install PostgreSQL:

sudo dnf install -y postgresql12 postgresql12-server

Initialize the database

sudo /usr/pgsql-12/bin/postgresql-12-setup initdb

Start PostgreSQL

sudo systemctl start postgresql-12

Init password for linux user postgres

sudo passwd postgres
# e.g., rainbow

Change password for DB user postgres

su - postgres
# password: rainbow
psql -d postgres

postgres=# ALTER USER postgres PASSWORD 'rainbow';

postgres=# \q

Change authentication methods to md5

vi /var/lib/pgsql/12/data/pg_hba.conf

Modify the content to be consistent with the following:

# "local" is for Unix domain socket connections only
# local user no authentication
local   all             all                                trust
# IPv4 local connections:
host    all             all             0.0.0.0/0          md5
# IPv6 local connections:
host    all             all             ::1/128            md5

Configure Memory for PostgreSQL

vi /var/lib/pgsql/12/data/postgresql.conf

Change the following two variables' values to be consistent with your environment (here we assume the machine has 4GB RAM)

# Data Cache, should be 1/4 of total RAM
shared_buffers = 1GB                   # min 128kB

# Memory for creating indexes
maintenance_work_mem = 512MB             # min 1MB

Exit linux user postgres

exit

Restart PosgreSQL

sudo systemctl restart postgresql-12

2. Prepare Synthetic Twitter Data

Download 100k synthetic tweets SQL file

# download
curl -LJO http://cloudberry.ics.uci.edu/img/sample.sql.gz
# unzip
gunzip sample.sql.gz

Load tweets SQL file into PostgreSQL

Create twitter database

psql -d postgres -U postgres

postgres=# create database twitter;

postgres=# \q

Load SQL file into twitter database

psql -U postgres twitter < sample.sql

3. Prepare environment and run codebase

Install Java 11 SDK

sudo yum install java-11-openjdk

Install latest sbt

# remove old Bintray repo file
sudo rm -f /etc/yum.repos.d/bintray-rpm.repo
curl -L https://www.scala-sbt.org/sbt-rpm.repo > sbt-rpm.repo
sudo mv sbt-rpm.repo /etc/yum.repos.d/
sudo yum install sbt

Clone Rainbow Github repo

sudo yum install git
git clone https://github.com/ISG-ICS/rainbow.git

Run Rainbow Server

cd rainbow/server
sbt run

For the first time running sbt, it will take a while. Wait until the following messages are shown:

--- (Running the application, auto-reloading is enabled) ---

[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

(Server started, use Enter to stop and go back to the console...)

Note: do not close the terminal, otherwise the server will be shutdown.

Congratulations! Rainbow is running!

You can access Rainbow through http://[your_machine_ip]:9000. Then you should see the following web page: rainbow-screen