Getting Started with LiveView Server

This page provides basic start and stop instructions for running TIBCO LiveView Server. See Connecting with LiveView Desktop for instructions on connecting to LiveView Server with LiveView Desktop.

Minimal Configuration Required

When a LiveView Server instance starts, its first task is to compile a set of configuration specifications that you provide into one or more LiveView data tables. On subsequent starts, LiveView Server recompiles only the configuration specifications that have changed, if any.

A LiveView table is a data table with a particular schema that is ready to accept a stream of incoming data and queries. In the absence of the configuration specifications for at least one data table, there is nothing for the LiveView Server to do, and it cannot start.

Thus, to start the LiveView Server even for a simple test requires some configuration. The LiveView installation provides a sample that illustrates the minimal configuration for LiveView, which is just enough to start and run the server. This smallest possible LiveView configuration requires a valid LiveView table configuration file to define a data table.

LiveView configuration files are called lvconf files. All lvconf files that constitute a single LiveView project must reside in the same top-level project folder. When you run a LiveView Server instance, you are running the configuration defined in the project folder that contains your lvconf file(s).

Loading LiveView Samples into Studio Workspace

TIBCO recommends loading LiveView samples into the StreamBase Studio workspace, even if you plan to run LiveView Server from the command prompt. Doing so copies the sample files from the StreamBase installation directory (to which you rarely have write privileges) to a single project folder in your StreamBase Studio workspace directory, which is always writable. Follow these steps:

  1. Start StreamBase Studio.

  2. Select FileLoad StreamBase Sample from Studio's top-level menu.

  3. In the Load StreamBase Projects dialog, open the TIBCO Live Datamart category.

  4. Select the sample whose description is Shows the minimum configuration to start LiveView Server and press OK.

The sample loads into Studio with the project name sample_lv-minimal.

Starting LiveView Server from StreamBase Studio

Installing LiveView adds support to StreamBase Studio for starting and stopping LiveView Server instances from within StreamBase Studio. Follow the steps below to start LiveView Server running the Minimal sample loaded as described in the previous section. These steps apply equally to the Windows and Linux editions of StreamBase Studio.

  1. In the Package Explorer view, select the project's folder, sample_lv-minimal.

  2. Click the Run button ().

  3. This opens the Run As dialog. Select LiveView Project and click OK.

  4. Studio opens the Console view, and begins to show messages from LiveView Server. After a few minutes, look for a Console view message at or near the end that says:

    { Server Started } - 
    
    *** All tables have been loaded. LiveView is ready to accept client connections. ***
    
    

Notice that LiveView Server runs in Studio independently of any StreamBase Server run or debug session you might want to run at the same time. The only constraint are the port numbers, which must be different for each running server. You can configure StreamBase Server to automatically try another port if Studio's default port, 10000, is in use by LiveView Server.

You can also run two or more instances of LiveView Server by editing one instance's launch configuration to use a different port.

Stopping LiveView Server from StreamBase Studio

If you started LiveView Server from StreamBase Studio, as described in the previous section, stop it by clicking the red and green square Terminate button () in the Console view's toolbar.

This button is configured to send an lv-client shutdown command when the currently selected Console view launch is a LiveView Server instance. You can also run lv-client shutdown manually from a Linux terminal prompt or a StreamBase Command Prompt on Windows.

Starting LiveView Server from the Command Prompt

The LiveView installation provides the lv-server command for starting LiveView Server from a Linux terminal prompt or a StreamBase Command Prompt. This command has the .cmd extension on Windows and no extension on Linux; in either case, the command is run as lv-server.

Note

The Windows instructions on this page require you to use a StreamBase Command Prompt, which you open from a link in the StartAll ProgramsStreamBase n.m menu. Do not use a standard Windows command prompt.

To start LiveView Server from a command prompt, the lv-server command takes two arguments:

  • The first argument is always the literal string run.

  • The second argument is the path to a directory containing the set of LiveView configuration files that define a single project.

The lv-server command is provided in %STREAMBASE_HOME%\bin ($STREAMBASE_HOME/bin on Linux).

The standard StreamBase runtime tools and libraries must be available on the PATH when you start LiveView Server. This condition is met when you install StreamBase for OS X and Linux as described in the StreamBase Installation Guide, and when you run the lv-server command from a StreamBase Command Prompt on Windows.

Windows Example

If you loaded the sample into StreamBase Studio as described above, the sample's lvconf file is in a folder in your local workspace. The default Studio workspace location is:

C:\Users\sbuser\Documents\StreamBase Studio n.m Workspace

For the Windows username sbuser, launch LiveView Server running the Minimal sample as follows. (This single command is shown on two lines for clarity.)

lv-server run "C:\Users\sbuser\Documents\
   StreamBase Studio 7.6 Workspace\sample_lv-minimal"
OS X Example

On Mac OS X, the default workspace is:

$HOME/Streambase Studio n.m Workspace

Use a command like the following to run LiveView Server with the sample:

lv-server run "~/Streambase Studio n.m Workspace/sample_lv-minimal"

It is often easier to navigate to the sample's directory and run the command from there:

cd "$HOME/Streambase Studio n.m Workspace/sample_lv-minimal"
lv-server run .

On any operating system, the command prompt window in which you start LiveView Server shows a series of messages reporting the progress of the server as it starts. Wait for a message that says:

{ Server Started } - 

*** All tables have been loaded. LiveView is ready to accept client connections. ***

The command prompt window then pauses and waits to display any runtime messages that may be necessary. To communicate with or load data into the running server, open a separate terminal window or StreamBase Command Prompt, or use LiveView Desktop.

Stopping LiveView Server at the Command Prompt

If you started LiveView Server from the command prompt, as described in the previous section, you must use the lv-client shutdown command to stop the server.

Open a separate terminal window on Linux or StreamBase Command Prompt on Windows, and enter:

lv-client shutdown

The window in which the server is running issues a series of shutdown messages, then returns to the command prompt.