10

I am new to AWS-SDK and I am running an node.js application on an EC2 instance.

I am trying to use ElastiCache-Redis in the node.js application. However, I can not find the API of ElastiCache to make basic Redis calls. The url below did not provide anything of Redis commands.

http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ElastiCache.html#addTagsToResource-property

What should I do to issue Redis command to ElastiCache(Redis) in aws-sdk?

Liviu Costea
  • 3,624
  • 14
  • 17
windchime
  • 1,253
  • 16
  • 37

1 Answers1

18

The ElastiCache API is used to start, stop & configure Redis and Memcached instances. It is not used for communicating with those instances.
In order to send commands to Redis or Memcached you need to use normal clients, here is the list of Node.js clients for Redis: http://redis.io/clients#nodejs

Liviu Costea
  • 3,624
  • 14
  • 17
  • using node-redis, I can do var redis = require("redis"), client = redis.createClient(); and then issue commands using client, such as client.hget(). What should I do using aws-sdk? What is the ip of the redis cluster? How can I find it? – windchime Jul 13 '15 at 14:20
  • 1
    The easiest way is to connect to your AWS Console https://console.aws.amazon.com then go to Elasticache and there you find a link in the left called Cache Clusters. For all the cache clusters listed there you can click on the Node link and you will see the endpoint. Don't use ip directly, use the endpoint because the ip will be dynamic - AWS might change it – Liviu Costea Jul 13 '15 at 14:37
  • 1
    let's say the end point is abc.xyz.aws.amazon.com; I can do the following?var redis = require("redis"), client = redis.createClient(6379, 'abc.xyz.aws.amazon.com', {}); – windchime Jul 13 '15 at 14:59
  • 2
    Yes, I see node_redis has URL support added not too long ago: https://github.com/NodeRedis/node_redis/commit/a67d3acdd6b6f2e04ba642b43a75d66825ec668b - check that you are using a version which has this – Liviu Costea Jul 13 '15 at 15:12