mps-cache

Control persistence service

Syntax

mps-cache [operation] [-C server_path] [--connection connection_name] [--configFile provider_config_file_path] [--key cache_access_key_string] [--timeout seconds] [--verbose | -v] [--help |-h]

Description

mps-cache [operation] [-C server_path] [--connection connection_name] [--configFile provider_config_file_path] [--key cache_access_key_string] [--timeout seconds] [--verbose | -v] [--help |-h] controls the persistence service based on the specified operation. The supported operations are start, stop, restart, ping, attach, and detach.

The option connection_name is obtained from the JSON file mps_cache_config. This file must be created by an administrator and placed in the config folder of the server instance. The JSON structure of the mps_cache_config file is:

{
  "Connections": {
    "<connection_name>": {
      "Provider": "Redis",
      "Host": "<hostname>",
      "Port": <port_number>
    }
  }
}
<connection_name>, <host_name> and <port_number> are the only fields that can be set by the administrator and <port_number> has to be a non-SSL port. Currently, Redis™ is the only supported persistence service provider. You can have multiple connections to the persistence provider.

Input Arguments

operation

start | stop | restart | ping | attach | detach

  • start — Start a persistence service.

  • stop — Stop a persistence service.

  • restart — Restart a persistence service.

  • ping — Test whether the persistence service is reachable.

  • attach — Connect persistence service to server instance process.

  • detach — Disconnect persistence service from server instance process.

Note

You cannot start, stop, or restart a remote persistence service.

-C server_path

Path to the server instance.

--connection connection_name

Name of connection to persistence service.

--configFile provider_config_file_path

Path to the persistence provider configuration file.

--key cache_access_key_string

Access key string to connect to an Azure® Redis Cache instance obtained from the Azure portal. For an example, see Ping a Remote Persistence Service.

--timeout ss

Set a limit on how long mps-cache will run before returning either success or failure. The default duration is 30 seconds. For example, specifying --timeout 15 indicates that mps-cache should exit with an error status if it takes longer than 15 seconds to access the service.

--verbose | -v

Displays system messages relating to controlling the persistence service.

--help | -h

Displays options for using the mps-cache command.

Examples

Start a Persistence Service

Start a persistence service on Windows® assuming a connection name myConnection has been defined in the file mps_cache_config.

mps-cache start -C "h:\server\mps_instance" --connection myRedisConnection
mps-cache ping -C "h:\server\mps_instance" --connection myRedisConnection
Sending ping to Redis on localhost:9710.
Redis service running on localhost:9710.

The corresponding mps_cache_config file for the example is:

{
  "Connections": {
    "myRedisConnection": {
      "Provider": "Redis",
      "Host": "localhost",
      "Port": 9710
    }
  }
}

Ping a Remote Persistence Service

Assuming an Azure Redis Cache instance has been setup in the Azure portal and a connection name myRemoteAzureRedisCacheConnection has been defined in the file mps_cache_config.

mps-cache ping -C "h:\server\mps_instance" 
               --connection myRemoteAzureRedisCacheConnection 
               --key +WcI8pU0YodDMsw1LLC7gInkjtrjamLBRoq9rQQdMTU=
Sending ping to Redis on azure.redis.cache.windows.net:6379.
Redis service running on azure.redis.cache.windows.net:6379.

The corresponding mps_cache_config file for the example is:

{
  "Connections": {
    "myRedisConnection": {
      "Provider": "Redis",
      "Host": "localhost",
      "Port": 9710
    },
    "myRemoteAzureRedisCacheConnection": {
      "Provider": "Redis",
      "Host": "azure.redis.cache.windows.net",
      "Port": 6379
    }
  }
}

Tips

  • To retrieve an access key to connect to an Azure Redis Cache instance:

    • Log in to your Azure portal and select your Azure Redis Cache instance.

    • Select Overview and under Keys click Show access keys.

    • In the resulting blade, copy the access key string listed under Primary.

Introduced in R2018b