你好,我正在尝试使用Node.js连接Redis,这一部分已经成功了。现在我将我的Node.js服务器应用程序托管在Amazon EC2实例上,将Redis托管在Amazon Elastic Cache实例上,连接到Redis是成功的,但偶尔会出现下面提到的错误。
var pub = redis.createClient(6379,'quizredis.qnsdtp.0001.apse1.cache.amazonaws.com');
events.js:72
throw er; // Unhandled 'error' event
^ Error: Redis connection to quizredis.qnsdtp.0001.apse1.cache.amazonaws.com:6379 failed - getaddrinfo ENOTFOUND
at RedisClient.on_error (/home/ec2-user/roomChat-7/node_modules/redis/index.js:196:24)
at Socket.<anonymous> (/home/ec2-user/roomChat-7/node_modules/redis/index.js:106:14)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:813:16
我正在使用redis-npm模块;