sbd

StreamBase Server — the StreamBase Event Processing Platform

SYNOPSIS

sbd [OPTIONS] [application-file]

DESCRIPTION

sbd is the StreamBase Server daemon, the server process that listens for and acts upon client requests (commands and data) in a StreamBase application. The StreamBase Server accepts incoming streaming data, manages execution queues, and performs the real-time processing work as defined in the specified application.

The sbd command takes one of four files types as the application-file argument:

  • An EventFlow application, with .sbapp extension.

  • A StreamSQL application, with .ssql extension.

  • A precompiled application archive file with .sbar file extension, generated with the sbargen command.

  • An application bundle file with .sbbundle extension, generated from StreamBase Studio, or with the sbbundle command.

For EventFlow and StreamSQL application files, sbd typechecks and compiles the application on the fly, then runs the compiled application. Precompiled application archive files are run immediately. Application bundle files are unpacked to a temporary directory on the sbd server's host computer. The top-level EventFlow or StreamSQL application in the bundle is then compiled, reconciling any references to modules, external operators and adapters, and the compiled top-level application is then run.

You do not specify containers on the sbd command line. Instead you can customize an sbd.sbconf server configuration file to define one or more containers in the <runtime> and <application> sections, and then use the -f option on the sbd command line to start with that customized configuration file. As an alternative, you can start a server process with the sbd command and then use the sbadmin addContainer and modifyContainer commands.

You can start sbd with no options or arguments. In this case, a default server starts at the default URI, but with no application running. You can then use sbadmin commands to add containers and applications to the running server instance.

OPTIONS

-b

Sends the server process into background mode. On UNIX, sends debug output to syslog. On Windows, sends debug output to the Windows Event Log. To access the Windows Event Log, use the Windows Event Viewer (StartSettingsControl PanelAdministrative ToolsEvent Viewer).

-d

Runs the server process in debugger mode. The Scheduler will be set to DebuggerScheduler.

--datadir directory

Sets the directory to be used for persistent data in disk-based Query Tables. If this is not specified, or the special value "+TEMP+" is used, a temporary directory is created on server startup and deleted on shutdown. See also the STREAMBASE_DATA environment variable below.

--eval expression

Evaluates a StreamBase simple expression and exits. Use quotes around expressions that contain whitespace or expression characters (such as function parentheses) that would otherwise be interpreted by the command shell. Note: you can evaluate simple expressions but not aggregate expressions with --eval.

On Windows, use double quotes around any expression that contains white space or expression characters. For example:

sbd --eval "cbrt(27)"
(nullable double) 3.0  
-f config-file-path

Specifies the location of the StreamBase Server configuration file for sbd to read on startup. Without the –f option, sbd uses the same internal default configuration as printed by the sbd -s command. Use –f to override this default configuration by specifying a particular configuration file to use.

-h, --help

Displays a syntax reminder message, then exits.

--install-service

Windows only. Creates a new StreamBase service with the name specified in the --service-name parameter. The idea is to allow you to define multiple StreamBase services that start at system boot time.

-p TCP-port

Sets the listen port of the sbd server, overriding any setting in sbd.sbconf. The default is 10000.

Note

The -p option is not supported for StreamBase applications that have authentication enabled or are using High Availability features.

--remove-service

Windows only. Removes an existing StreamBase service with the name specified in the --service-name parameter.

-s

Prints the skeleton configuration file to standard output and exits.

--service-name "servicename,Service Display Name"

Windows only. Specifies the StreamBase service name and the display name to be installed or removed. The servicename term is used as a prefix in the Windows Registry key name. The Service Display Name portion is used in the Services control panel listing. Both arguments are required and must be separated by a comma. We recommend that you begin each Service Display Name with StreamBase, to make it easier for you to manage multiple StreamBase services in the control panel.

sbd --install-service --service-name "sbd2,StreamBase My Application Two"

--version

Prints version information and exits.

EXAMPLES

By default, the StreamBase Server uses a skeleton or template version of the configuration file, sbd.sbconf. You can view the skeleton configuration file by using the -s option. For example:

sbd -s

In the next example, the user specifies a StreamBase application on the command line. The StreamBase Server starts and loads the application:

sbd /home/myapps/trading.sbapp

In the next example, the user creates a local copy of the server configuration file, based on the initial sbd.sbconf file. The user makes edits, and then specifies the local copy on the command line. Note that the -f flag and its parameter must come before the application name.

sbd -s > /home/mydir/mysbd.sbconf

After you make changes in mysbd.sbconf, start sbd to use the edited file as in the following example:

sbd -f /home/mydir/mysbd.sbconf trading.sbapp

The next example adds a new StreamBase service on Windows to be automatically started at boot time.

sbd --install-service --service-name "sbd2,StreamBase My Application Two"

The next example shows several eval subcommands and their outputs. The first evaluates an expression with no quote delimiters. The second expression requires quotes because it contains spaces. The third requires quotes because the parentheses would otherwise be interpreted by the shell or command window. The fourth requires quotes because it contains spaces and to avoid the parentheses being interpreted by the shell.

  $ sbd --eval 2e3*6
  (double) 12000.0

  $ sbd --eval "2 % 7"
  (int) 2

  $ sbd --eval "pow(2,3)"
  (double) 8.0

  $ sbd --eval "timestamp('2007-02-08 9:22:34')"
  (timestamp) 2007-02-08 09:22:34.000-0500

FILES

The configuration file for sbd is named sbd.sbconf by default. There is one sbd.sbconf file per StreamBase instance per node. A skeleton sbd.sbconf file can be generated with sbd -s

ENVIRONMENT

STREAMBASE_DATA

Optional. Sets the directory to be used for persistent data in disk-based Query Tables. The precedence order is: 1. Specified on the sbd command line with the --datadir option; 2. Specified in the STREAMBASE_DATA environment variable; 3. Specified In the sbd configuration file as the value of the datadir parameter in the server section; 4. If not otherwise specified, or if the special value "+TEMP+" is used, a temporary directory is created at server startup and deleted on server shutdown.

STREAMBASE_RETITLE_TERMINALS

Optional. If set to any value, StreamBase command-line utilities assign a terminal window title to match the name of the executable being run. By default terminal titles are not affected.

STREAMBASE_LOG_LEVEL

Optional. Sets the minimum severity of messages that StreamBase writes to syslog or stderr. Default is 0, which gets NOTICE level messages and higher. Reasonable values are -1 (which disables NOTICE messages and shows only WARN, ERROR and FATAL messages), 1 (which adds INFO messages to the standard messages), and 2 (which adds DEBUG messages).

SEE ALSO

sbc
syslog (3)