Store Action Queues in an External Database

Media Server provides asynchronous actions. Each asynchronous action has a queue to store requests until threads become available to process them. You can configure Media Server to store these queues either in an internal database file, or in an external database hosted on a database server.

The default configuration stores queues in an internal database. Using this type of database does not require any additional configuration.

You might want to store the action queues in an external database so that several servers can share the same queues. In this configuration, sending a request to any of the servers adds the request to the shared queue. Whenever a server is ready to start processing a new request, it takes the next request from the shared queue, runs the action, and adds the results of the action back to the shared database so that they can be retrieved by any of the servers. You can therefore distribute requests between components without configuring a Distributed Action Handler (DAH).

NOTE:

You cannot use multiple servers to process a single request. Each request is processed by one server.

NOTE:

Requests that contain multipart/form-data are always processed on the server that received them. These requests are added to the shared queue, but can only be taken from the queue by the server that received the request and placed it on the queue.

TIP:

You can also store training data used by Media Server in an external database. You can use the same database server to store training data and asynchronous action queues. However, you must create separate databases for storing training data and action queues. As a result you must also create separate data source names (DSNs), and connection strings. For information about configuring Media Server to use an external database for training data, see Configure Media Server.

Prerequisites

Configure Media Server

To configure Media Server to use a shared action queue, follow these steps.

To store action queues in an external database

  1. Stop Media Server, if it is running.
  2. Open the Media Server configuration file.
  3. Find the relevant section in the configuration file:

  4. Set the following configuration parameters.

    AsyncStoreLibraryDirectory The path of the directory that contains the library to use to connect to the database. Specify either an absolute path, or a path relative to the server executable file.
    AsyncStoreLibraryName

    The name of the library to use to connect to the database. You can omit the file extension. The following libraries are available:

    • postgresAsyncStoreLibrary - for connecting to a PostgreSQL database.
    • mysqlAsyncStoreLibrary - for connecting to a MySQL database.

    ConnectionString

    The connection string to use to connect to the database. The user that you specify must have permission to create tables in the database. For example:

    ConnectionString=DSN=my_ASYNC_QUEUE

    or

    ConnectionString=Driver={PostgreSQL}; Server=10.0.0.1; Port=9876; Database=SharedActions; Uid=user; Pwd=password; MaxVarcharSize=0;

    TIP:

    Do not use the same database, data source name, and connection string that you use for storing training data. You must create a separate database, DSN, and connection string.

    For example:

    [Actions]
    AsyncStoreLibraryDirectory=acidlls
    AsyncStoreLibraryName=postgresAsyncStoreLibrary
    ConnectionString=DSN=ActionStore
  5. If you are using the same database to store action queues for more than one type of component, set the following parameter in the [Actions] section of the configuration file.

    DatastoreSharingGroupName

    The group of components to share actions with. You can set this parameter to any string, but the value must be the same for each server in the group. For example, to configure several Media Servers to share their action queues, set this parameter to the same value in every Media Server configuration. HPE recommends setting this parameter to the name of the component.

    CAUTION:

    Do not configure different components (for example, two different types of connector) to share the same action queues. This will result in unexpected behavior.

    For example:
    [Actions]
    ...
    DatastoreSharingGroupName=ComponentType
  6. Save and close the configuration file.

    When you start Media Server it connects to the shared database.


_HP_HTML5_bannerTitle.htm