# Cluster license keys

```json metadata
{
  "title": "Cluster license keys",
  "description": "The cluster key (or license) enables features and capacity within Redis Enterprise Software",
  "categories": ["docs","operate","rs"],
  "tableOfContents": {"sections":[{"id":"trial-mode","title":"Trial mode"},{"id":"view-cluster-license-key","title":"View cluster license key"},{"id":"update-cluster-license","title":"Update cluster license"},{"id":"expired-cluster-license","title":"Expired cluster license"},{"id":"configure-license-expiration-alert","title":"Configure license expiration alert"},{"id":"monitor-cluster-license","title":"Monitor cluster license"}]}

,
  "codeExamples": []
}
```The cluster license key enables Redis Software features and determines shard usage and limits.
You can add or update a cluster key at any time.

A single license can only be deployed on a single cluster. Each cluster, including passive or cold standby clusters used for disaster recovery, requires its own separate license, regardless of whether all clusters are active simultaneously.

## Trial mode

Trial mode allows all features to be enabled during the trial period.

Trial mode is limited to 30 days and 4 shards, including master and replica shards. A new Redis Software installation starts its 30-day trial period from the day you set up the cluster on the first node.

Trial mode requires a trial license. If you do not provide a license when you create a cluster using the Cluster Manager UI or a [bootstrapping REST API request](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/bootstrap#post-bootstrap), a trial cluster license is generated by default.

## View cluster license key

To view the cluster license key, use a [`GET /v1/license`](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/license#get-license) REST API request. For a list of returned fields, see the [response section](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/license#get-response).


As of version 7.2, Redis Software enforces shard limits by shard types, RAM or flash, instead of the total number of shards. The flash shards limit only appears in the UI if Auto Tiering is enabled.


## Update cluster license


After you add a cluster key, you cannot remove the key to return the cluster to trial mode.


You can update the cluster license key:

- During cluster setup using the Cluster Manager UI or CLI

- After cluster setup using the Cluster Manager UI:

    1. Go to **Cluster > Configuration > General > License**.
    
    1. Select **Change**.

    1. Upload or enter your cluster license key.
    
    1. Select **Save**.

You can update an existing cluster key at any time.
Redis Software checks its validity for the following:
- Cluster name
- Activation and expiration dates
- Shard usage and limits
- Features

If saving a new cluster key fails, the operation returns an error with the failure's cause.
In this case, the existing key stays in effect.

## Expired cluster license

When the license is expired:

- You cannot do these actions:

    - Change database settings, including security and configuration options.

    - Add a database.

- You can do these actions:

    - Sign in to the Cluster Manager UI and view settings and metrics at all resolutions for the cluster, nodes, and databases.

    - Change cluster settings, including the license key, security for administrators, and cluster alerts.

    - Fail over when a node fails and explicitly migrate shards between nodes.

    - Upgrade a node to a new version of Redis Software.

## Configure license expiration alert

By default, a cluster license alert is scheduled to occur 7 days before the cluster license expiration date.

![images/rs/screenshots/cluster/cluster-license-expiration-alert.png](https://redis.io/docs/latest/images/rs/screenshots/cluster/cluster-license-expiration-alert.png)

You can adjust the threshold value of the cluster license expiration alert based on how far in advance you want to be notified of the license expiration. The value should be within a reasonable range that allows your organization enough time to take action, such as renewing the license, before it expires.

To change the cluster license alert settings, use one of the following methods:

- Cluster Manager UI:

    1. On the **Cluster > Configuration** screen, select the **Alerts Settings** tab.

    1. Click **Edit**.

    1. In the **Cluster utilization** section, enable the alert setting "License expiry notifications will be sent \<value\> days before the license expires" and enter a new value in the box.

        ![images/rs/screenshots/cluster/cluster-config-alert-settings-utilization.png](https://redis.io/docs/latest/images/rs/screenshots/cluster/cluster-config-alert-settings-utilization.png)

    1. Click **Save**.


- [Update cluster](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/cluster#put-cluster) REST API request:

    The following example changes the cluster license alert to occur 30 days before the cluster license expiration date:

    ```sh
    PUT /v1/cluster
    {
        "alert_settings": {
            "cluster_license_about_to_expire": {
                "enabled": true,
                "threshold": "30"
            }
        }
    }
    ```

## Monitor cluster license

As of version 7.2, Redis Software exposes the license quotas and the shards consumption metrics in the Cluster Manager UI or via the [Prometheus integration](https://redis.io/docs/latest/integrate/prometheus-with-redis-enterprise/).

The `cluster_shards_limit` metric displays the total shard limit by shard type.

Examples:
- `cluster_shards_limit{cluster="mycluster.local",shard_type="ram"} 100.0`
- `cluster_shards_limit{cluster="mycluster.local",shard_type="flash"} 50.0`

The `bdb_shards_used` metric displays the used shard count by database and shard type.

Examples:
- `bdb_shards_used{bdb="2",cluster="mycluster.local",shard_type="ram"} 86.0`
- `bdb_shards_used{bdb="3",cluster="mycluster.local",shard_type="flash"} 23.0`


