我可以在Heroku上使用Amazon Elasticache吗? [英] Can I use Amazon Elasticache on Heroku?

查看:169
本文介绍了我可以在Heroku上使用Amazon Elasticache吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在Rails 3应用程序中使用Heroku的Memcached,并希望转移到Elasticache,因为定价更有利。这可能吗?配置相对简单吗?有什么我应该注意的表现?

I am currently using Heroku's Memcached in a Rails 3 app and would like to move over to Elasticache because the pricing is much more favorable. Is this possible? Is the configuration relatively straightforward? Is there anything that I should be aware of as regards the performance?

推荐答案

注意:虽然这可行, btucker指出,它允许任何Heroku托管的应用程序访问您的ElastiCache集群。我不建议使用此解决方案。

是的,您可以。该设置与Heroku在 Amazon RDS 上的指南类似。不同的步骤如下所示:

Yes you can. The setup is similar to the guide Heroku has on Amazon RDS. The steps that differ go like this:


  1. 按照 Amazon ElastiCache入门指南创建缓存集群和节点的指南
  2. 安装 ElastiCache命令行工具包

  3. 允许Heroku的服务器进入ElastiCache群集就像RDS指南解释的一样,用 elasticache - ones替换 rds - 命令:

  1. Follow the "Get Started with Amazon ElastiCache" guide to create a cache cluster and node
  2. Install the ElastiCache Command Line Toolkit
  3. Allow Heroku's servers ingress to your ElastiCache cluster like the RDS guide explains but replace the rds- commands with elasticache- ones:

elasticache-authorize-cache-security-group-ingress \
  --cache-security-group-name default \ 
  --ec2-security-group-name default \
  --ec2-security-group-owner-id 098166147350 \

  # If your AWS_CREDENTIAL_FILE environment setting is configured,
  # this option is not necessary.
  --aws-credential-file ../credential-file-path.template


  • 使用群集的主机名为产品应用程序设置Heroku配置值:

  • Set a Heroku config value for your production app with your cluster's hostname:

    heroku config:set MEMCACHE_SERVERS=elasticachehostname.amazonaws.com
    


  • 然后,按照 Memcache Rails安装程序,然后设置好。

    After that, follow the Memcache Rails setup, and you're set.

    这篇关于我可以在Heroku上使用Amazon Elasticache吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆