Docker Compose
Configuration
Add the following environment variables to the eranger-postgresql services environment section of the SKOOR docker-compose.yaml and set the STABLENET_FDW_WEBSERVICE_URL
variable to a valid StableNet host URL:
- STABLENET_FDW_WEBSERVICE_URL=https://<StableNet host>:5443/api/1 - STABLENET_FDW_ACCEPT_INSECURE_CERTIFICATE=false - STABLENET_FDW_DEFAULT_USER=myuser - STABLENET_FDW_DEFAULT_PASSWORD=mypass - STABLENET_FDW_SKOOR_AUTH_URL=http://eranger-auth-${INSTANCE_NAME}:8094
Webservice container configuration
The webservice must be able to communicate with the eranger-auth component to authenticate requests to StableNet. In the eranger-webservice service section, add the following environment variable:
- SKOOR_WEBSERVICE_auth_service_url=http://eranger-auth-${INSTANCE_NAME}:8094
Initializing foreign tables
In the running container, run the init-database.sh script to drop and recreate the stablenet schema (caution: all objects in the schema are dropped!).
Example with a customer database named infosim with user infosim (set the PGSQL_CONTAINER variable to the eranger-postgresql container name):
export PGSQL_CONTAINER=eranger-postgresql-<instance>
docker exec $PGSQL_CONTAINER /opt/stablenet-fdw/init-foreign-tables.sh -h localhost \ -p 5432 -d infosim -U postgres -o infosim
Run a data query in the dashboard to verify the foreign data wrapper:
SELECT * from stablenet.stablenet_info
Data aggregation
Initializing aggregated data
Same commands as described in Aggregated Measurement Data have to be executed using docker exec
.
E.g.
docker exec $PGSQL_CONTAINER /opt/stablenet-fdw/measurement-data-sync/aggregate-hourly-sync.sh [server_id>]