Step 1: Create a cluster - Amazon MemoryDB for Redis
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Step 1: Create a cluster

Before creating a cluster for production use, you obviously need to consider how you will configure the cluster to meet your business needs. Those issues are addressed in the Preparing a cluster section. For the purposes of this Getting Started exercise, you can accept the default configuration values where they apply.

The cluster you create will be live, and not running in a sandbox. You will incur the standard MemoryDB usage fees for the instance until you delete it. The total charges will be minimal (typically less than a dollar) if you complete the exercise described here in one sitting and delete your cluster when you are finished. For more information about MemoryDB usage rates, see MemoryDB.

Your cluster is launched in a virtual private cloud (VPC) based on the Amazon VPC service.

Creating a MemoryDB cluster

The following examples show how to create a cluster using the Amazon Web Services Management Console, Amazon CLI and MemoryDB API.

To create a cluster using the MemoryDB console
  1. Sign in to the Amazon Web Services Management Console and open the MemoryDB for Redis console at https://console.amazonaws.cn/memorydb/.

  2. Choose Clusters In the left navigation pane and then choose Create.

Easy create
  1. Complete the Configuration section. This configures the node type and default configuration of your cluster. Select the appropriate memory size and network performance you require from the following options:

    • Production

    • Dev/Test

    • Demo

  2. Complete the Cluster info section.

    1. In Name, enter a name for your cluster.

      Cluster naming constraints are as follows:

      • Must contain 1–40 alphanumeric characters or hyphens.

      • Must begin with a letter.

      • Can't contain two consecutive hyphens.

      • Can't end with a hyphen.

    2. In the Description box, enter a description for this cluster.

  3. Complete the Subnet groups section:

    1. For Subnet groups, create a new subnet group or choose an existing one from the available list that you want to apply to this cluster. If you are creating a new one:

      • Enter a Name

      • Enter a Description

      • If you enabled Multi-AZ, the subnet group must contain at least two subnets that reside in different availability zones. For more information, see Subnets and subnet groups.

      • If you are creating a new subnet group and do not have an existing VPC, you will be asked to create a VPC. For more information, see What is Amazon VPC? in the Amazon VPC User Guide.

  4. For Vector search, you can Enable Vector search capability to store vector embeddings and perform vector searches. Note that this will fix the values for Redis version compatibility, Parameter groups and Shards. For more information, see Vector search.

  5. View default settings:

    When using Easy create, the remaining cluster settings are set by default. Note that some of these settings can be changed after creation, as indicated by Editable after creation.

  6. For Tags, you can optionally apply tags to search and filter your clusters or track your Amazon costs.

  7. Review all your entries and choices, then make any needed corrections. When you're ready, choose Create to launch your cluster, or Cancel to cancel the operation.

As soon as your cluster's status is available, you can grant EC2 access to it, connect to it, and begin using it. For more information, see Step 2: Authorize access to the cluster

Important

As soon as your cluster becomes available, you're billed for each hour or partial hour that the cluster is active, even if you're not actively using it. To stop incurring charges for this cluster, you must delete it. See Step 4: Deleting a cluster.

Create new cluster
  1. Complete the Cluster info section.

    1. In Name, enter a name for your cluster.

      Cluster naming constraints are as follows:

      • Must contain 1–40 alphanumeric characters or hyphens.

      • Must begin with a letter.

      • Can't contain two consecutive hyphens.

      • Can't end with a hyphen.

    2. In the Description box, enter a description for this cluster.

  2. Complete the Subnet groups section:

    1. For Subnet groups, create a new subnet group or choose an existing one from the available list that you want to apply to this cluster. If you are creating a new one:

      • Enter a Name

      • Enter a Description

      • If you enabled Multi-AZ, the subnet group must contain at least two subnets that reside in different availability zones. For more information, see Subnets and subnet groups.

      • If you are creating a new subnet group and do not have an existing VPC, you will be asked to create a VPC. For more information, see What is Amazon VPC? in the Amazon VPC User Guide.

  3. Complete the Cluster settings section:

    1. For Enable Vector search capability, you can enable this to store vector embeddings and perform vector searches. Note that this will fix the values for Redis version compatibility, Parameter groups and Shards. For more information, see Vector search.

    2. For Redis version compatibility, accept the default 6.2.

    3. For Port, accept the default Redis port of 6379 or, if you have a reason to use a different port, enter the port number..

    4. For Parameter group, if you have enabled vector search, use default.memorydb-redis7.search.preview. Otherwise, accept the default.memorydb-redis7 parameter group.

      Parameter groups control the runtime parameters of your cluster. For more information on parameter groups, see Redis specific parameters.

    5. For Node type, choose a value for the node type (along with its associated memory size) that you want.

      If you choose a node type from the r6gd family, you will automatically enable data-tiering, which splits data storage between memory and SSD. For more information, see Data tiering.

    6. For Number of shards, choose the number of shards that you want for this cluster. For higher availability of your clusters, we recommend that you add at least 2 shards.

      You can change the number of shards in your cluster dynamically. For more information, see Scaling MemoryDB clusters.

    7. For Replicas per shard, choose the number of read replica nodes that you want in each shard.

      The following restrictions exist:

      • If you have Multi-AZ enabled, make sure that you have at least one replica per shard.

      • The number of replicas is the same for each shard when creating the cluster using the console.

    8. Choose Next

    9. Complete the Advanced settings section:

      1. For Security groups, choose the security groups that you want for this cluster. A security group acts as a firewall to control network access to your cluster. You can use the default security group for your VPC or create a new one.

        For more information on security groups, see Security groups for your VPC in the Amazon VPC User Guide.

      2. To encrypt your data, you have the following options:

        • Encryption at rest – Enables encryption of data stored on disk. For more information, see Encryption at Rest.

          Note

          You have the option to supply an encryption key other than default by choosing Customer Managed Amazon-owned KMS key and choosing the key.

        • Encryption in-transit – Enables encryption of data on the wire. If you select no encryption, then an open Access control list called “open access” will be created with a default user. For more information, see Authenticating users with Access Control Lists (ACLs).

      3. For Snapshot, optionally specify a snapshot retention period and a snapshot window. By default, Enable automatic snapshots is pre-selected.

      4. For Maintenance window optionally specify a maintenance window. The maintenance window is the time, generally an hour in length, each week when MemoryDB schedules system maintenance for your cluster. You can allow MemoryDB to choose the day and time for your maintenance window (No preference), or you can choose the day, time, and duration yourself (Specify maintenance window). If you choose Specify maintenance window from the lists, choose the Start day, Start time, and Duration (in hours) for your maintenance window. All times are UCT times.

        For more information, see Managing maintenance.

      5. For Notifications, choose an existing Amazon Simple Notification Service (Amazon SNS) topic, or choose Manual ARN input and enter the topic's Amazon Resource Name (ARN). Amazon SNS allows you to push notifications to Internet-connected smart devices. The default is to disable notifications. For more information, see http://www.amazonaws.cn/sns/.

      6. For Tags, you can optionally apply tags to search and filter your clusters or track your Amazon costs.

    10. Review all your entries and choices, then make any needed corrections. When you're ready, choose Create to launch your cluster, or Cancel to cancel the operation.

    As soon as your cluster's status is available, you can grant EC2 access to it, connect to it, and begin using it. For more information, see Step 2: Authorize access to the cluster

    Important

    As soon as your cluster becomes available, you're billed for each hour or partial hour that the cluster is active, even if you're not actively using it. To stop incurring charges for this cluster, you must delete it. See Step 4: Deleting a cluster.

Restore from snapshots

Under Snapshot source, choose the source snapshot from which to migrate data. For more information, see Snapshot and restore .

Note

If you want your new cluster to have vector search enabled, the source snapshot must also have vector search enabled.

The target cluster defaults to the settings of the source cluster. Optionally, you can change the following settings on the target cluster:

  1. Cluster info

    1. In Name, enter a name for your cluster.

      Cluster naming constraints are as follows:

      • Must contain 1–40 alphanumeric characters or hyphens.

      • Must begin with a letter.

      • Can't contain two consecutive hyphens.

      • Can't end with a hyphen.

    2. In the Description box, enter a description for this cluster.

  2. Subnet groups

    1. For Subnet groups, create a new subnet group or choose an existing one from the available list that you want to apply to this cluster. If you are creating a new one:

      • Enter a Name

      • Enter a Description

      • If you enabled Multi-AZ, the subnet group must contain at least two subnets that reside in different availability zones. For more information, see Subnets and subnet groups.

      • If you are creating a new subnet group and do not have an existing VPC, you will be asked to create a VPC. For more information, see What is Amazon VPC? in the Amazon VPC User Guide.

  3. Cluster settings

    1. For Enable Vector search capability, you can enable this to store vector embeddings and perform vector searches. Note that this will fix the values for Redis version compatibility, Parameter groups and Shards. For more information, see Vector search.

    2. For Redis version compatibility, accept the default 6.2.

    3. For Port, accept the default Redis port of 6379 or, if you have a reason to use a different port, enter the port number..

    4. For Parameter group, if you have enabled vector search, use default.memorydb-redis7.search.preview. Otherwise, accept the default.memorydb-redis7 parameter group.

      Parameter groups control the runtime parameters of your cluster. For more information on parameter groups, see Redis specific parameters.

    5. For Node type, choose a value for the node type (along with its associated memory size) that you want.

      If you choose a node type from the r6gd family, you will automatically enable data-tiering, which splits data storage between memory and SSD. For more information, see Data tiering.

    6. For Number of shards, choose the number of shards that you want for this cluster. For higher availability of your clusters, we recommend that you add at least 2 shards.

      You can change the number of shards in your cluster dynamically. For more information, see Scaling MemoryDB clusters.

    7. For Replicas per shard, choose the number of read replica nodes that you want in each shard.

      The following restrictions exist:

      • If you have Multi-AZ enabled, make sure that you have at least one replica per shard.

      • The number of replicas is the same for each shard when creating the cluster using the console.

    8. Choose Next

    9. Advanced settings

      1. For Security groups, choose the security groups that you want for this cluster. A security group acts as a firewall to control network access to your cluster. You can use the default security group for your VPC or create a new one.

        For more information on security groups, see Security groups for your VPC in the Amazon VPC User Guide.

      2. To encrypt your data, you have the following options:

        • Encryption at rest – Enables encryption of data stored on disk. For more information, see Encryption at Rest.

          Note

          You have the option to supply an encryption key other than default by choosing Customer Managed Amazon-owned KMS key and choosing the key.

        • Encryption in-transit – Enables encryption of data on the wire. If you select no encryption, then an open Access control list called “open access” will be created with a default user. For more information, see Authenticating users with Access Control Lists (ACLs).

      3. For Snapshot, optionally specify a snapshot retention period and a snapshot window. By default, Enable automatic snapshots is pre-selected.

      4. For Maintenance window optionally specify a maintenance window. The maintenance window is the time, generally an hour in length, each week when MemoryDB schedules system maintenance for your cluster. You can allow MemoryDB to choose the day and time for your maintenance window (No preference), or you can choose the day, time, and duration yourself (Specify maintenance window). If you choose Specify maintenance window from the lists, choose the Start day, Start time, and Duration (in hours) for your maintenance window. All times are UCT times.

        For more information, see Managing maintenance.

      5. For Notifications, choose an existing Amazon Simple Notification Service (Amazon SNS) topic, or choose Manual ARN input and enter the topic's Amazon Resource Name (ARN). Amazon SNS allows you to push notifications to Internet-connected smart devices. The default is to disable notifications. For more information, see http://www.amazonaws.cn/sns/.

      6. For Tags, you can optionally apply tags to search and filter your clusters or track your Amazon costs.

    10. Review all your entries and choices, then make any needed corrections. When you're ready, choose Create to launch your cluster, or Cancel to cancel the operation.

    As soon as your cluster's status is available, you can grant EC2 access to it, connect to it, and begin using it. For more information, see Step 2: Authorize access to the cluster

    Important

    As soon as your cluster becomes available, you're billed for each hour or partial hour that the cluster is active, even if you're not actively using it. To stop incurring charges for this cluster, you must delete it. See Step 4: Deleting a cluster.

To create a cluster using the Amazon CLI, see create-cluster. The following is an example:

For Linux, OS X, or Unix:

aws memorydb create-cluster \ --cluster-name my-cluster \ --node-type db.r6g.large \ --acl-name my-acl \ --subnet-group my-sg

For Windows:

aws memorydb create-cluster ^ --cluster-name my-cluster ^ --node-type db.r6g.large ^ --acl-name my-acl ^ --subnet-group my-sg

You should get the following JSON response:

{ "Cluster": { "Name": "my-cluster", "Status": "creating", "NumberOfShards": 1, "AvailabilityMode": "MultiAZ", "ClusterEndpoint": { "Port": 6379 }, "NodeType": "db.r6g.large", "EngineVersion": "6.2", "EnginePatchVersion": "6.2.6", "ParameterGroupName": "default.memorydb-redis6", "ParameterGroupStatus": "in-sync", "SubnetGroupName": "my-sg", "TLSEnabled": true, "ARN": "arn:aws:memorydb:us-east-1:xxxxxxxxxxxxxx:cluster/my-cluster", "SnapshotRetentionLimit": 0, "MaintenanceWindow": "wed:03:00-wed:04:00", "SnapshotWindow": "04:30-05:30", "ACLName": "my-acl", "DataTiering": "false", "AutoMinorVersionUpgrade": true } }

You can begin using the cluster once its status changes to available.

Important

As soon as your cluster becomes available, you're billed for each hour or partial hour that the cluster is active, even if you're not actively using it. To stop incurring charges for this cluster, you must delete it. See Step 4: Deleting a cluster.

To create a cluster using the MemoryDB API, use the CreateCluster action.

Important

As soon as your cluster becomes available, you're billed for each hour or partial hour that the cluster is active, even if you're not using it. To stop incurring charges for this cluster, you must delete it. See Step 4: Deleting a cluster.

Setting up authentication

For information about setting up authentication for your cluster, see Authenticating with IAM and Authenticating users with Access Control Lists (ACLs).