What I'm trying to do is to use aws-cli to create an ElastiCache cluster based on my ElastiCache snapshots in S3, and my ElastiCache is cluster-enabled mode.
I followed this tutorial to create a cluster-enabled Redis cache and here's my command:
aws elasticache create-cache-cluster --cache-cluster-id stevescachecluster1 --cache-node-type cache.m4.large --engine redis --engine-version 3.2.4 --cache-parameter-group default.redis3.2.cluster.on --num-cache-nodes 1 --snapshot-arns arn:aws:s3:::MY_S3_BUCKET-elasticache/stevesun-elasticache-0002.rdb --cache-subnet-group-name my-cache-dev
The above command fails due to
An error occurred (InvalidParameterCombination) when calling the CreateCacheCluster operation: Cluster mode should be disabled in parameter group, but found it is enabled.
This is what confuses me, the above linked tutorial explicitly said that if yo want a cluster-mode enabled cache, please use .cluster.on option in your arguments.
Then I looked more into this aws-cli command reference: for this parameter: --cache-parameter-group-name
, its documentation says: You cannot use any parameter group which has cluster-enabled='yes' when creating a cluster.
Isn't this contradictionary from this cli reference documentation to that cli tutorial?
Please correct me where I understand it wrong. And also, how can I create a cluster-mode enabled cache from S3 snapshots?
Thanks.
I checked and found that 3.2.4 is the latest version that AWS ElatiCache has right now.
Edit 1:
Then I just created a single-node cache using this command:
aws elasticache create-cache-cluster --cache-cluster-id stevescachecluster1 --cache-node-type cache.m4.large --engine redis --engine-version 3.2.4 --cache-parameter-group default.redis3.2 --num-cache-nodes 1 --snapshot-arns arn:aws:s3:::MY_S3_BUCKET-elasticache/stevesun-elasticache-0002.rdb --cache-subnet-group-name my-cache-dev
.
Then I went to the console and selected my newly launched single-node cache and clicked Modify
, I tried to change it to cluster.on, but got this exception:
The parameter cluster-enabled has a different value in the requested parameter group than the current parameter group. This parameter value cannot be changed for a cache cluster.
So, my attempt to launch a single-node cache first and then change it to be a cluster mode also failed.
Edit 2:
Then I thought it's that I needed to allocate more than 1 node for a cluster-enabled mode, so I changed this parameter --num-cache-nodes
to 2
, but I got this exception:
An error occurred (InvalidParameterValue) when calling the CreateCacheCluster operation: Cannot create a Redis cluster with a NumCacheNodes parameter greater than 1.
This is even more confusing to me, a cluster definitely needs more than 1 node, then why does it not allow greater than 1??
Although its documentation says For clusters running Redis, this value must be 1.
. Why is this requirement? Then how can we create a new redis cluster from snapshots?
Help please.
Thanks.