Chapter 7. Deploying the virtual database
After you assemble your CR, the next step is to feed it to the Data Virtualization Operator to build and deploy the virtual database.
Before you can use deploy the virtual database, you must have:
- Set up your environment as described in Chapter 4, Setting up the environment.
Open a terminal window to the
01-base-exampledirectory in your local Teiid-Openshift-Examples respository, which contains the
If you have not yet done so, open the file in a text editor and add the API key for the stock quote service in the
Schema:Portfoliosection. For more information, see the example in Section 22.214.171.124, “Virtual schema definition”
Type the following command:
oc create -f portfolio.yaml
The command returns the following response:
At this stage, the virtual database is created, but it’s not yet running.
The initial deployment can take five or more minutes. The first time that you use the Operator to deploy a virtual database in a project, the Operator must build a base image, which takes extra time. Subsequent deployments take less time, because the base image that you create is reused.
Run the following command to check the build status:
oc get vdb portfolio -o yaml | grep phase
The build process runs through several phases. When you check the status, you might see any of the following responses:
phase: Ready For S2I phase: Building Base Builder Image phase: Building Service Image phase: Deploying phase: Running
While you’re waiting, if you skipped the section that describes how to create the virtual database CR, now is a good time to go back and review it. When you run the preceding command again, if the build status reports that the phase is
Running, you’re ready to move on to the next step.