7 Replies Latest reply on Jan 21, 2016 8:53 AM by rareddy

    Access Teiid runtime remotely through Admin API

    praksah

      I have scenario where jboss and teiid install on one machine and client application deploy on other machine. I am using Admin API to connect Teiid runtime in my client. I am fetching an admin object like

       

       

      CallbackHandler cbh = new AuthenticationCallbackHandler(userName, password.toCharArray());

      admin = AdminFactory.getInstance().createAdmin(ModelControllerClient.Factory.create(ip-address, 9990,cbh));

       

       

      It is throwing error as

      org.teiid.webui.share.exceptions.DataVirtUiException: TEIID70015 java.io.IOException: java.net.ConnectException: WFLYPRT0053: Could not connect to http-remoting://xx.xxx.xxx.xx:9990. The connection failed

       

       

      This works when both jboss with teiid and client application on same machine means when providing localhost or 127.0.0.1.

       

       

      But I need client on different machine, Please help me out.

        • 1. Re: Access Teiid runtime remotely through Admin API
          shawkins

          > But I need client on different machine, Please help me out.

           

          What version of the Teiid server are you running? 

           

          In general you'll want to check the JBoss config.  The management address by defaults binds to localhost:

           

          <interface name="management">

             <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>

          </interface>

          • 2. Re: Access Teiid runtime remotely through Admin API
            praksah

            I have Web application where I used Admin api. this web application is install on one machine(server) haveing ip as xx.xxx.xxx.01.

            On another machine(server); Jboss with teiid runtime is hosted. say xx.xxx.xxx.02. Now I want to access teiid runtime from my web application. Used Jboss version is wildfly 9.0 with teiid 8.13

            Admin Api (teiid-admin-8.13.0.Alpha1).

             

            It work fine when same web application deploy on jboss server(xx.xxx.xxx.02), then it works. But in distributed scenario it won't work. I need distributed architecture.

            • 3. Re: Access Teiid runtime remotely through Admin API
              rareddy

              1) You need to start the Teiid server with "-b" option, like "./standalone.sh -c standalone-teiid.xml -b xxx.xxx.xxx.02"

              2) Using the "bin/add-user.sh" add a management user

               

              Then you can connect using the Admin API using the IP and user created from the remote machine.

              • 4. Re: Access Teiid runtime remotely through Admin API
                praksah

                I performed #1 and #2 on xxx.xxx..xxx.02 machine. The user created in #2, is it same that you called as user created from remote machine. please guide.

                 

                On xxx.xxx.xxx.01 in web client application, I provide IP address(xxx.xxx.xxx.02 with port 9990) and user created by #2 but getting same error when try to connect using Admin API.After start Jboss server, I am able to access admin consol page from xxx.xxx.xxx.1 machine and not else while hitting "htts://xxx.xxx.xx.02:8080/".

                • 5. Re: Access Teiid runtime remotely through Admin API
                  rareddy

                  try


                  admin = AdminFactory.getInstance().createAdmin(host, port, user, password)

                  • 6. Re: Access Teiid runtime remotely through Admin API
                    praksah

                    Thanks Ramesh, your suggestion work from me.

                     

                    I am  able to get admin object with this able to create datasource on teiid server(xxx.02) from remote location(xxx.01). Could you please let me whether are we able to test datasource connection from remote machine?

                    • 7. Re: Access Teiid runtime remotely through Admin API
                      rareddy

                      Test Data Source in what way? If you want to see if there is datasource exists, then do "getDataSourceNames()", if want to make sure a connection to the data source working or not, there is no method to directly do that. May be you can do some test query through a VDB that you have or create and deploy/run a query on sample VDB just that have single model with that datasource in it.

                       

                      Ramesh..