9 Replies Latest reply on Jul 14, 2015 11:34 AM by van.halbert

    Deploy and Activate VDB

    kisienya

      Hi,

       

      Thank you all for your support.

       

      I have a procedure on my Teiid designer that loops on data from a CSV and inserts to MySQL.

       

      I needed to automate the process so I used AdminShell to insert the data successfully. I use cron + Adminshell.

       

      I just realized however that the VDB is not automatically deployed when Teiid runtime starts. What happens is that I have to at-least use Teiid designer once to execute the procedure (click on the running man icon). After that, the VDB associated with the procedure is deployed and activated and I can connect to it with Adminshell.

       

      I need it to be deployed and set to active as I start teiid runtime (the way other VDBs do).

       

      Kindly assist.

       

      Regards

       

      Morgan

        • 1. Re: Deploy and Activate VDB
          rareddy

          Morgan,

           

          Once you have built the VDB, you do not need t use the Designer for deploying. There care couple different ways to deploy and manage the VDB.

           

          1) You can use AdminShell to deploy the VDB, for example by running a command deploy ("myVDB.vdb"); There is example of this here teiid/DeployAndVerifyVDB.groovy at master · teiid/teiid · GitHub

           

          2) You can you CLI and deploy the VDB. Checkout the "jboss-cli.bat" file in the bin directory, then use the deploy command.

           

          3) Use the web-console to deploy the vdb

           

          4) Copy the VDB into "standalone/deployments" directory of the server and create a empty marker file with same name as you vdb like "myvdb.vdb.dodeploy" and copy to the same directory.

           

          Ramesh..

          • 2. Re: Deploy and Activate VDB
            kisienya

            Hi Ramesh,

             

            Thanks for the quick reply.

             

            I have tried the above, but the message I receive when I con+nect to VDB from Squirrel SQL Client is that the VDB does not exist.

             

            Regards

             

            Morgan

            • 3. Re: Deploy and Activate VDB
              van.halbert

              When you deployed the VDB, did you see in the server log a similar message:  (teiid-async-threads - 1) TEIID40003 VDB {vdbName}.1 is set to ACTIVE

              • 4. Re: Deploy and Activate VDB
                kisienya

                No it just says deployed but does not say ACTIVE.

                • 5. Re: Deploy and Activate VDB
                  kisienya

                  I was able to create a VDB from a virtual procedure in Teiid Designer.

                   

                  The VDB is now DEPLOYED and set to ACTIVE. I can connect to the VDB from both AdminShell and Squirrel SQL.

                   

                  When I try to execute a query on the VDB (the same query that executes successfully after highlighting the virtual procedure and clicking on the preview button), it fails with the error below;

                  TEIID11009 java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/P5_Model_ltcperson

                   

                  P5_Model_ltcperson references a MySQL table where data will be inserted. The query executed is:

                  select * from ( exec "<ProcedureName>"() ) AS X_X

                   

                  Kindly assist.

                  • 6. Re: Deploy and Activate VDB
                    van.halbert

                    When doing data previewing, a sample data source is created that is used with the internal VDB that is deployed in order to perform the preview.  There is nothing that's meant to be permanent (i.e, preview vdb and datasource)  that is created and deployed to the server.

                     

                    There is an option on the model (right mouse click) to create the permanently configured datasource on the server, which will be referenced by java:/P5_Model_ltcperson.   Did you try that option to create the data source or use some other method (i.e, admin console or manually editing standalone.xml) to configure the data source?

                    • 7. Re: Deploy and Activate VDB
                      rareddy

                      Morgan,

                       

                      That is indicating that you have not created the datasource in the EAP for your MySQL source. When using the Designer, it creates them automatically, but when using the adminshell you need to create this as additional step. Here is an example using the CLI https://docs.jboss.org/author/display/TEIID/JDBC+Data+Sources

                       

                      You can also edit the standalone.xml and add it, an example for it in the <jboss-as>/docs/teiid/datasources/mysql directory. Or you can even use the AdminShell's createDataSource method to create one.

                       

                      Ramesh..

                      • 8. Re: Deploy and Activate VDB
                        kisienya

                        Hi,

                         

                        Thanks Van and Ramesh,

                         

                        Actually I have not created a permanently configured data source. Kindly elaborate on the "right mouse click" method as I look up other methods e.g. adminshell or on standalone.xml

                         

                        Regards



                         

                        • 9. Re: Deploy and Activate VDB
                          van.halbert

                          Morgan,

                           

                          In Teiid Designer, first select the source model for the data source that's being modeled.  Then right mouse click, select Modeling -->  Create Data Source