Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a site running with memcache under Drupal 7 on a Ubuntu 11.10 server.
However, I would like to hook it up to a AWS (Amazon) Elasticache node. Can anyone help me with pointers on how to choose which memcache server it should use? So it does not use localhost but the external node.
Comments
Comment #1
achtonThis example is from the installation docs:
Is that what you mean? I'd be interested in hearing about using ElastiCache instead of a local Memcache instance.
Comment #2
erikwebb CreditAttribution: erikwebb commentedIt looks like you should be able to manage everything through the AWS docs - http://docs.aws.amazon.com/AmazonElastiCache/latest/GettingStartedGuide/...
Once the instances are created, just use those IPs in the Drupal configuration.
Comment #2.0
erikwebb CreditAttribution: erikwebb commentedMaking it more clear and understandable.
Comment #3
loze CreditAttribution: loze commentedNeed some advice for using this module with AWS ElastiCache.
If I have 1 clache cluster with multiple cache nodes, is it better to use each memcache "node endpoint" in the memcache_server setting or have only one memcache_server using the clusters "configuration endpoint"
Both methods appear to work, but im not sure which is the best/recommended approach.
any tips?
Comment #4
loze CreditAttribution: loze commentedComment #5
RobKoberg CreditAttribution: RobKoberg commentedIoze, you wrote:
"If I have 1 clache cluster with multiple cache nodes, is it better to use each memcache "node endpoint" in the memcache_server setting or have only one memcache_server using the clusters "configuration endpoint""
I have the same question. Did you configure your settings.php to use the node endpoints or the configuration endpoints? Is the config endpoint like some kind of load balancer (hoping...).
Comment #6
RobKoberg CreditAttribution: RobKoberg commentedTo answer my question, you should use the node endpoints. Here is what my config looks like:
Comment #7
tripper54 CreditAttribution: tripper54 commentedComment #8
yogen.prasad CreditAttribution: yogen.prasad commentedHello,
I am using Elastic cache with Drupal with Memcache API , but getting strange issue i.e when ever i update some content in Drupal and save it after some time it gets reverted , can u let me know what i am doing wrong?
without elastic cache my site runs fine.
my setting.php looks like below for with memcahe settings:
$conf['cache_backends'][] = 'sites/all/modules/contrib/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
$conf['page_cache_without_database'] = TRUE;
$conf['page_cache_invoke_hooks'] = FALSE;
#$conf['lock_inc'] = 'sites/all/modules/memcache/memcache-lock.inc';
$conf['memcache_servers'] = array('xxx.xx.xxx.xxx.cache.amazonaws.com:11211' => 'default');
$conf['memcache_key_prefix'] = 'xxx';
$conf['lock_inc'] = 'sites/all/modules/contrib/memcache/memcache-lock.inc';
$conf['memcache_stampede_protection'] = TRUE;
i tried with and without stampede_protection and 'lock_inc variables but do not get fix issue,
any help will be appreciated
Thanks
Comment #9
iainp999 CreditAttribution: iainp999 commentedI've seen the same issue that Yogen has reported for two different clients now (different companies, both using Elasticache). Same "workaround" i.e. don't use Elasticache!
Not got to the bottom of it yet, but would appreciate any ideas.
Comment #10
lorique CreditAttribution: lorique as a volunteer commentedHi,
I'm having issues with Elasticache, but its very intermitten. Can the OP or someone updated me on the status of this issue, and wether or not its still discouraged to use this module with AWS Elasticache?
Comment #11
ccshannon CreditAttribution: ccshannon commentedSo am I correct to understand from the recent posts that 'Memcache API and Integration' does not work properly with AWS Elasticache?
We enabled Memcache settings in late December and are seeing data change state on pages when reloading (even node/edit screens, and we have cache_form hitting database!) You see three different values in a field's form input as you refresh the page repeatedly.
Clearing all cache temporarily corrects the issue, but that's not a workable remedy.
Should we be using 'Memcache Storage' with Elasticache, instead?
For anyone who may read this, here are our settings ... memcache is storing and active (and our database activity level went from 60%, and crashing a lot, to under 10%), but apparently the flushing and setting of cache is alternating between different servers. Our developers thought maybe there was an errant node or field hook interfering with normal operation, but now I'm beginning to wonder if I've chosen the wrong module for matching D7 to Elasticache.
Like others in this thread, would also love some advice, here. Like, would explicitly listing the Elasticache cluster addresses, in 'memcache_servers' setting, have any benefit? Thx.
Comment #13
Jeremy CreditAttribution: Jeremy at Tag1 Consulting commentedI've added some documentation to the README.txt regarding how to use the Memcache module with Elasticache. It's always been supported and works, but if you want to use Automatic Discovery you need to use Amazon's fork of the PECL Memcached extension:
http://cgit.drupalcode.org/memcache/commit/?id=9b6bad8
Comment #14
ccshannon CreditAttribution: ccshannon commentedThanks, Jeremy. I appreciate that.
We did it get it working, and the issue was something undocumented with Amazon
In our case, our configuration was correct, and the correct PHP libraries were all in place.
The problem was the cluster address alias used in Auto Discovery (or maybe it was the Cluster Client) library needs to have ".cfg." in the name and ours did not.
Our Ops provider renamed the alias and rebuilt the library in PHP and everything works great!
We were driving ourselves crazy for a few weeks before someone finally figured it out.
So, to anyone else who reads this, it definitely works and you DON'T have to point to a single node endpoint, as some have done in the past.
:)
Comment #15
ccshannon CreditAttribution: ccshannon commentedHere is the AWS documentation for the Configuration Endpoint. As you can see, the example uses ".cfg." but does not explicitly say you have to name yours as such. Perhaps Amazon thought it was implicit in the instructions, but our Ops team did not think so.
http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Endpoints....
Comment #17
Jeremy CreditAttribution: Jeremy at Tag1 Consulting commentedThanks; I updated the documentation to mention this, and to include the link to AWS documentation.