cancel
Showing results for 
Search instead for 
Did you mean: 
  • 862 Views

DO280 lab 2 section 6.2 - psql: error: FATAL: database "persistentdb" does not exist

Jump to solution

I'm working through the DO280 guided lab exercise for chapter 2, section 6.2. When I run the "./init_data.sh" command, I get this:

Populating characters table
psql:error: FATAL: database "persistentdb" does not exist
command terminated with exit code 2

Any idea how I can resolve this?

I didn't see any commands in the guided exercise to actually create a "persistentdb". In step 4, we create a new database deployment using the container image, but it's not clear to me whether it actually creates the database.

'oc get pods' indicates the pod is ready 1/1 and Running with 0 restarts.

I don't know enough about postgresql to get into it and figure out if it actuall has that database, or how to create it.

I've redone the exercise 3 times slowly and I still get the same results.

Any help would be appreciated

Dave

 

1 Solution

Accepted Solutions
chandrasred
Flight Engineer
Flight Engineer
  • 813 Views

is it possible for you to share a video [ screen rec what you are doing in the terminal for the lab practice ? ]  so that it will be easy for us to help you way better and troubleshoot the error and help you in knowing the root cause.

Steps in lab:

1. Initialize the lab env from below command:  
   

lab install-storage start


2.  Loading the env variables [ example api end point, kubeadmin password etc ] from file using the source command:


source /usr/local/etc/ocp4.config


3. Login to clusteradmin [ kubeadmin ]  - so that you can use cluster resources and create resources

oc login -u kubeadmin -p ${RHT_OCP4_KUBEADM_PASSWD}

4. Create a new project so that we create all resources in it and later on cleanly remove:

oc new-project install-storage

5. Verify if you have the storage class [ default one available ]

oc get storageclass

6. create a deployment named postgresql-persistent

oc new-app --name postgresql-persistent --image registry.redhat.io/rhel8/postgresql-13:1-7 -e POSTGRESQL_USER=redhat -e POSTGRESQL_PASSWORD=redhat123 -e POSTGRESQL_DATABASE=persistentdb

7. now do the section 5 and 6 - Tasks but make sure to check if the current project is  install-storage if different project you might get error .

 

View solution in original post

1 Reply
chandrasred
Flight Engineer
Flight Engineer
  • 814 Views

is it possible for you to share a video [ screen rec what you are doing in the terminal for the lab practice ? ]  so that it will be easy for us to help you way better and troubleshoot the error and help you in knowing the root cause.

Steps in lab:

1. Initialize the lab env from below command:  
   

lab install-storage start


2.  Loading the env variables [ example api end point, kubeadmin password etc ] from file using the source command:


source /usr/local/etc/ocp4.config


3. Login to clusteradmin [ kubeadmin ]  - so that you can use cluster resources and create resources

oc login -u kubeadmin -p ${RHT_OCP4_KUBEADM_PASSWD}

4. Create a new project so that we create all resources in it and later on cleanly remove:

oc new-project install-storage

5. Verify if you have the storage class [ default one available ]

oc get storageclass

6. create a deployment named postgresql-persistent

oc new-app --name postgresql-persistent --image registry.redhat.io/rhel8/postgresql-13:1-7 -e POSTGRESQL_USER=redhat -e POSTGRESQL_PASSWORD=redhat123 -e POSTGRESQL_DATABASE=persistentdb

7. now do the section 5 and 6 - Tasks but make sure to check if the current project is  install-storage if different project you might get error .

 

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