Running in Local Mode

Local mode allows application testing and debugging on the local file system.

This procedure shows you how to create runtime entities and deploy and run an application using bwadmin local mode. You will learn how to set the bwadmin mode; create a domain, AppSpace, and AppNode; upload an application archive; start the AppSpace; and deploy and start the uploaded application.

Note: The runtime entities created in local mode are not visible to bwagents when they are started.

Procedure

  1. In a terminal, navigate to the following paths:
    • Windows:
      BW_HOME\bin
    • Unix:
      ${BW_HOME}/bin
  2. Set the bwadmin mode to local.
    • Windows:
      BW_HOME\bin>bwadmin mode local
    • Unix:
      [root@BW_HOME bin]# ./bwadmin mode local
  3. Create a domain. For more information, see Creating a Domain.
    • Windows:
      BW_HOME\bin>bwadmin create domain D1
    • Unix:
      [root@BW_HOME bin]# ./bwadmin create domain D1
  4. Show the domain.
    • Windows:
      BW_HOME\bin>bwadmin show domain
    • Unix:
      [root@BW_HOME bin]# ./bwadmin show domain 
      
  5. Create an AppSpace in the domain. For more information, see Creating an AppSpace.
    • Windows:
      BW_HOME\bin>bwadmin create -d D1 appspace AS1
    • Unix:
      [root@BW_HOME bin]# ./bwadmin create -d D1 appspace AS1
      
  6. Create an AppNode in the AppSpace. When creating an AppNode, you must specify the HTTP management port that allows communication with the AppNode.
    • Windows:
      BW_HOME\bin>bwadmin create -domain D1 -appspace AS1 -httpPort 8060 appnode AN1
    • Unix:
      [root@BW_HOME bin]# ./bwadmin  create -domain D1 -appspace AS1 -httpPort 8060 appnode AN1
      

    The HTTP management port must be unique across all defined AppNodes on a machine. If the specified port is already in use, an error is issued and the AppNode cannot be created.

    For more information, see Creating an AppNode.

  7. Use the show command for the AppSpace after you've created the AppNode.
    BW_HOME\bin>bwadmin show -domain D1 -appspace AS1 appnodes
    
  8. Upload an application archive into the domain. The following command uploads the Bookstore sample application archive. Use forward slash in the Windows command line.
    • Windows:
      BW_HOME\bin>bwadmin upload -domain D1 ../samples/core/admin/ears/bookstore/tibco.bw.sample.binding.rest.BookStore.application_1.0.0.ear
      
    • Unix:
      [root@BW_HOME bin]# ./bwadmin upload -domain D1 ../samples/core/admin/ears/bookstore/tibco.bw.sample.binding.rest.BookStore.application_1.0.0.ear
      
    For more information, see Uploading an Archive.
  9. Show that the application archive was uploaded.
    • Windows:
      BW_HOME\bin>bwadmin show -domain D1 archives
    • Unix:
      [root@BW_HOME bin]# ./bwadmin show -domain D1 archives
  10. Start the AppSpace. This starts the AppNode in the AppSpace.
    • Windows:
      BW_HOME\bin>bwadmin start -domain D1 appspace AS1
    • Unix:
      [root@BW_HOME bin]# ./bwadmin start -domain D1 appspace AS1
    For more information, see Starting an AppSpace.
  11. Deploy the application into the AppSpace. This deploys the application to the AppNode.
    • Windows:
      BW_HOME\bin>bwadmin deploy -domain D1 -appspace AS1
      tibco.bw.sample.binding.rest.BookStore.application_1.0.0.ear
    • Unix:
      [root@BW_HOME bin]# ./bwadmin deploy -domain D1 -appspace AS1
      tibco.bw.sample.binding.rest.BookStore.application_1.0.0.ear
      
    For more information, see Deploying an Application.
  12. See the deployed application using show command.
    • Windows:
      BW_HOME\bin>bwadmin show -domain D1 application
    • Unix:
      [root@BW_HOME bin]# ./bwadmin show -domain D1 application
      
  13. Start the application. Each uploaded application maintains a version. The version number is required for starting and stopping the application.
    • Windows:
      BW_HOME\bin>bwadmin start -d D1 -appspace AS1 application
      tibco.bw.sample.binding.rest.BookStore.application 1.0
      
    • Unix:
      [root@BW_HOME bin]# ./bwadmin start -d D1 -appspace AS1
      
    To find the version number, you can use the show command, for example: bwadmin show -domain D1 application

    For more information, see Starting an Application.

    Use the -csv command to print the table content as a comma separated value table. The first row contains the headers and applies to domains, AppSpaces, AppNodes, Applications, Archive, Archives, Machines and Installations. For example, bwadmin[admin@d1]> show -csv apps to show all the Applications in the csv format.

  14. Optionally, stop and undeploy the application, stop the AppSpace, and delete the entities (archive, AppNode, AppSpace, and domain).

Result

You used bwadmin in local mode to create a domain (D1), an AppSpace (AS1), and an AppNode (AN1). You uploaded an application archive to the domain, deployed the application, and started and stopped the application. Spend some time experimenting with bwadmin commands. For more information about domains, AppSpaces, AppNodes, and applications, see Administration Tasks and Reference.