...
Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
The DataWareHouse is a PostgreSQL database where the Moodle data is saved after it has been transformed by NiFi pipelines. It contains very few tables, compared to Moodle original database, but it can easily generate views with critical data, which is used in the different dashboards.
PostgreSQL Installation
Download PostgreSQL Docker image.
Code Block docker pull postgres
Create the container. Replace <password> with the actual password.
Code Block docker run --name datawarehouse -p 127.0.0.1:5432:5433/tcp -e POSTGRES_PASSWORD=<password> -d postgres
docker run --name datawarehouse -p 127.0.0.1:5432:5433/tcp -e POSTGRES_PASSWORD=<password> -d postgres
docker exec -ti <container ID> bash
psql -h localhost -p 5432 -U postgres -d postgres
ALTER USER postgres WITH PASSWORD '<password>';
CREATE DATABASE zwe_analytics;
DataWareHouse Creation
Enter the PostgreSQL Docker. First, get the container ID.
Code Block docker ps docker exec -ti <container ID> bash
Use psql to access the postgres database.
Code Block psql -h localhost -p 5432 -U postgres -d postgres
Change the postgres user password and create the new database.
Code Block ALTER USER postgres WITH PASSWORD '<password>'; CREATE DATABASE zwe_analytics;
Create the tables…