cancel
Showing results for 
Search instead for 
Did you mean: 
littlebigfab
Starfighter Starfighter
Starfighter
  • 637 Views

Comprehensive Review: no sensors in the DB

Hello,

I'm doing the Comprehensive Review lab of AD482.

I don't understand at which step the sensors are supposed to be populated into the Postgresql database.

My database is completely empty, not sure if that's expected:

 

$ oc exec -it postgresql-1-vlv8g -- bash
bash-4.4$ psql
psql (12.7)
Type "help" for help.

postgres=# \c sensorsdb
You are now connected to database "sensorsdb" as user "postgres".
sensorsdb=# \dt
Did not find any relations.

 

 

The instructions only read:

  • PostgreSQL database. A database that stores the static sensor metadata. You must extract sensor data from this database, and write the data into the garden-sensors topic.

 

Without any data inserted into the database, the Debezium connector does not produce any records to the garden-sensors topic. Therefore, the join operation between that stream and the measurement stream does not produce any records either.

The lab grade script fails at verifying that the garden-sensor topic is not empty.

I cannot figure out what I am missing.

 

$ lab grade comprehensive-review

Grading lab.

 · Checking the connector specifications: sensors-connector .......... PASS
 · Checking records in garden-sensors topic .......................... FAIL
    - Unable to find records with value(s): [{'id': 1, 'name': 'Dynolabs 2000', 'type': 'Humidity', 'customer': 'Jaime', 'garden': "Jaime's Garden"}, {'id': 2, 'name': 'RHOCP 4.8', 'type': 'Humidity', 'customer': 'Marek', 'garden': "Marek's Garden"}, {'id': 3, 'name': 'Nymbus 2001', 'type': 'Wind', 'customer': 'Aykut & Enol', 'garden': "Aykut and Enol's Garden"}, {'id': 4, 'name': 'PR 500', 'type': 'Temperature', 'customer': 'Pablo', 'garden': "Pablo's Garden"}] in topic garden-sensors
    - Cannot continue grading lab

 

Thanks in advance for your help!

0 Kudos
2 Replies
littlebigfab
Starfighter Starfighter
Starfighter
  • 631 Views

My workaround for now, I manually create the missing table like this:

 

 

create table sensors (id integer PRIMARY KEY, name varchar(100), type varchar(100), customer varchar(100), garden varchar(100));
insert into sensors (id, name, type, customer, garden) values (1, 'Dynolabs 2000', 'Humidity', 'Jaime', 'Jaime''s Garden');
insert into sensors (id, name, type, customer, garden) values (2, 'RHOCP 4.8', 'Humidity', 'Marek', 'Marek''s Garden');
insert into sensors (id, name, type, customer, garden) values (3, 'Nymbus 2001', 'Wind', 'Aykut & Enol', 'Aykut and Enol''s Garden');
insert into sensors (id, name, type, customer, garden) values (4, 'PR 500', 'Temperature', 'Pablo', 'Pablo''s Garden');

 

 

 

Execute after the Debezium connector is in READY state.

To get the Postgresql prompt, first run:

 

 

$ oc exec -it postgresql-1-vlv8g -- bash
bash-4.4$ psql
psql (12.7)
Type "help" for help.

postgres=# \c sensorsdb
You are now connected to database "sensorsdb" as user "postgres".
sensorsdb=# 

 

 

 (replace your pod name in the first command)

0 Kudos
littlebigfab
Starfighter Starfighter
Starfighter
  • 591 Views

This might be caused by the postgresql pod restarting on a new OpenShift node.

0 Kudos
Join the discussion
You must log in to join this conversation.