Starting AMPS

The AMPS engine binary is named ampServer and is found in $AMPSDIR/bin. Start the AMPS engine with a single command line argument that includes a valid path to an AMPS configuration file. You use the configuration file to enable and configure the AMPS features that your application will use. This guide discusses the most commonly used configuration options for each feature. The full set of options is described in the AMPS Configuration Guide.

The AMPS server generates a minimal sample configuration file with the --sample-config option. You can save the sample configuration file to $AMPSDIR/amps_config.xml with the following command line:

$AMPSDIR/bin/ampServer --sample-config > $AMPSDIR/amps_config.xml

The sample configuration file generated by AMPS includes a very minimal configuration. The client language distributions include a sample configuration file that sets up AMPS to work with the samples provided with that client, and the AMPS Configuration Guide contains a full description of the configuration items with sample configuration snippets.

The server sample configuration only provides configuration for using AMPS to subscribe to and publish to ad hoc topics. The sample configuration file does not include any persistence for AMPS messages.

The file enables the instance monitoring interface (the "Galvanometer"), including the ability to query and subscribe to topics using a websocket connection.

A production configuration would likely provide persistent event and error logging to a file to allow an operations team to troubleshoot the instance and would typically persist monitoring statistics to a file. Such a configuration would likely enable additional message delivery features for certain topics and would also include configuration for high-availability and disaster recovery. The configuration would typically configure AMPS actions to perform routine maintenance.

AMPS uses the current working directory for storing files (logs and persistence) for any relative paths specified in the configuration. While this is important for real deployments, the sample configuration used in this chapter does not persist anything, so you can safely start AMPS from any working directory using this configuration.

On older processor architectures (and in some emulated environments) ampServer will start the ampServer-compat binary. The ampServer-compat binary avoids using hardware instructions that are not available on these systems.

You can also set the AMPS_PLATFORM_COMPAT environment variable to force ampServer to start the ampServer-compat binary. 60East recommends using this option only on systems that do not support the hardware instructions used in the standard binary. The ampServer-compat binary will not perform as well as ampServer, since it uses fewer hardware optimizations.

Once you have a configuration file saved to $AMPSDIR/amps_config.xml you can start AMPS with that file as follows:

$AMPSDIR/bin/ampServer $AMPSDIR/amps_config.xml

If your first start-up is successful, you should see AMPS display a simple message similar to the following to let you know that your instance has started correctly.

AMPS A.B.C.D.973814.e1a57f7 - Copyright (c) 2006-202X 60East Technologies Inc.
(Built: XXXX-YY-ZZT00:26:45Z)

The version numbers and dates will be appropriate for the version that you've started.

If you see this, congratulations! You have successfully cranked up the AMPS!

Command Line Options

The AMPS server binary supports the following command line options:

OptionEffect

--verify-config

Parse and verify the specified configuration file, then exit.

--sample-config

Produce a minimal AMPS config.xml file to standard output, then exit.

--dump-config

Process the specified configuration file, resolving any Include directives and expanding environment variables. Dump the resulting file to standard output.

--version

Print the AMPS version string, then exit.

--help

Print usage information for the command line options accepted by the ampServer program, then exit.

--daemon

Run AMPS as a daemon process.

-D<variable>=<value>

Set the specified environment variable to the specified value when running the AMPS process. AMPS accepts any number of -D options.

For example, to set the variable AMPS_PATH to /mnt/fast/AMPS use the command line option -DAMPS_PATH=/mnt/fast/AMPS

Last updated

Copyright 2013-2024 60East Technologies, Inc.