【问题标题】:How to connect AWS elasticache redis from Node.js application?如何从 Node.js 应用程序连接 AWS elasticache redis?
【发布时间】:2020-09-07 08:22:09
【问题描述】:

如何从 Node.js 应用程序连接 AWS elasticache redis?

【问题讨论】:

    标签: javascript node.js amazon-web-services amazon-elasticache


    【解决方案1】:

    您正在连接到 Redis。在这方面,它是一项托管 AWS 服务这一事实并不那么重要。

    所以,使用实现 Redis 客户端接口的 Node.js 包,例如:

    【讨论】:

      【解决方案2】:

      您可以使用包ioredis 并建立这样的连接

        const Redis = require('ioredis')
        const redis = new Redis({
            port: 6379,
            host: 'your-redis-host',
            connectTimeout: 10000 // optional
         });
      

      【讨论】:

        猜你喜欢
        • 2020-06-26
        • 2021-06-12
        • 2022-07-30
        • 2020-04-04
        • 2018-05-21
        • 2018-12-04
        • 2020-11-01
        • 2018-12-29
        • 1970-01-01
        相关资源
        最近更新 更多