Re: Documentation for ElastiCache

375 views
Skip to first unread message

Martin Grotzke

unread,
Dec 13, 2012, 4:12:43 AM12/13/12
to David Lee, memcached-session-manager
Hi David,

thanx, good start!

I'd like to see some additional info:
* Motivation - when to use / benefits?
* Link to e.g.
http://aws.amazon.com/about-aws/whats-new/2012/11/29/amazon-elasticache-announces-auto-discovery/

Some detailed comments:
* context.xml / memcachedNodes should be pool.lkxx3b2...?
* context.xml / transcoderFactoryClass wrong / can be removed
* "It should work with non sticky sessions as well." - here we should
mention that while adding/removing nodes some sessions might be lost -
at least this needs testing

Would you like to create a wiki page on github
(https://github.com/magro/memcached-session-manager/wiki) with your
information?
Then we would take this as a starting point and motivation to move the
rest of the docs to github :-)

Cheers,
Martin


On 12/12/2012 05:11 PM, David Lee wrote:
> Here is a rough first pass at documenting the setup using AWS ElastiCache.
>
> Attached is a pre-built jar file which can be used in place of the
> memcachespy
>
> ------------------------------------------------------------
>
>
>
> To use memcached-session-manager with AWS ElastiCache
>
>
>
> This allows tomcat servers running on AWS EC2 to use the AWS ElastiCache
> service instead
>
> of managing your own memcached servers.
>
>
>
> Create an ElastiCache pool with 1 or more nodes
>
> http://aws.amazon.com/elasticache/
>
>
>
> Using the AWS Console (Or API) Find the "Configuration Endpoint" DNS entry.
>
> It will look something like :
> pool.lkxx3b2.cfg.use1.cache.amazonaws.com:11211
>
>
>
> This is the single node you will use with MSM
>
>
>
> Build the ElastiCache Cluster Client from this project
>
> https://github.com/amazonwebservices/aws-elasticache-cluster-client-memcached-for-java
>
>
>
> Or use the (attached) JAR file.
>
> AmazonElastiCacheClusterClient-no-version.jar
>
>
>
> This file is used instead of the spymemcached file spymemcached-2.7.3.jar
>
>
>
> Configure your tomcat to use a single memcached node with no prefixes.
>
>
>
> An example of context.xml
>
>
>
> <Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
>
> memcachedNodes="odd.lkqfb2.cfg.use1.cache.amazonaws.com:11211"
>
> requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
>
> transcoderFactoryClass="pool.lkxx3b2.cfg.use1.cache.amazonaws.com:11211"
>
> sessionBackupAsync="true"
>
> sticky="true"
>
> copyCollectionsForSerialization="false"
>
> />
>
>
>
>
>
>
>
> This has been tested with Sticky sessions (load balancer sticky) and
> async backup.
>
> It should work with non sticky sessions as well.
>
>
>
> You can make sure that the code is detecting the proper nodes by
> examining the catalina.out file which will show
>
> the discovery in process and all the nodes it detects. Adding or
> removing nodes is automatically detected.
>
>
>
> ----------------------------------------
>
> David A. Lee
>
> dl...@calldei.com <mailto:dl...@calldei.com>
>
> http://www.xmlsh.org
>
>
>

--
inoio gmbh - http://inoio.de
Breitenfelder Str. 13c, 20251 Hamburg
Amtsgericht Hamburg, HRB 123031
Geschäftsführer: Dennis Brakhane, Martin Grotzke, Ole Langbehn

signature.asc

Saurabh Singh

unread,
May 9, 2013, 5:27:52 AM5/9/13
to memcached-se...@googlegroups.com, David Lee, martin....@googlemail.com
Hello Martin/David,

I am moving over my tomcat application to AWS and would like to do it in complete 'cloudy' way.
i.e. I would like to create new tomcat EC2 instances on demand, and reduce instances on low usage periods. This means that user sessions need to be externalized.

I would like to use MSM with AWS Elasticache.

Did you guys ever get a chance to update this draft doc? I am a newbie as far as AWS and MSM is concerned, so if you can jot some step-by-step guide, it would help me (and possibly others in future).

Any help would be appreciated.

Thanks

-Saurabh
PS: the original post refers to some attachment jars and files, where can I find those?

David Lee

unread,
May 9, 2013, 6:39:37 AM5/9/13
to Saurabh Singh, memcached-se...@googlegroups.com, martin....@googlemail.com

I have been running it flawlessly for months.

But I have entirely neglected further documentation.

Let me see what is up there and what is not.   I do recall making a wiki ...

Hmmm I can see nothing on the wiki ....

 

----------------------------------------

David A. Lee

dl...@calldei.com

Martin Grotzke

unread,
May 9, 2013, 10:52:33 AM5/9/13
to DALDEI, memcached-session-manager, Saurabh Singh

Saurabh Singh

unread,
May 14, 2013, 8:21:53 AM5/14/13
to memcached-se...@googlegroups.com, DALDEI, Saurabh Singh, martin....@googlemail.com
Hello Martin,

Thanks for the information.
I tried it on AWS EC2, I had copied these jars into tomcat7/lib (and the kryo jars in the web-inf/lib)
  1. AmazonElastiCacheClusterClient-no-version.jar
  2. memcached-session-manager-1.6.4.jar
  3. memcached-session-manager-tc7-1.6.4.jar
However, I get the following error when starting tomcat:

SEVERE: Begin event threw error
java.lang.NoClassDefFoundError: com/couchbase/client/CouchbaseClient
        at de.javakaffee.web.msm.MemcachedBackupSessionManager.<init>(MemcachedBackupSessionManager.java:80)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at java.lang.Class.newInstance0(Class.java:374) .....


So why is it trying to find the couchbaseClient? Is there some configuration I missed that tells MSM to use 'AmazonElastiCacheClusterClient-no-version.jar' instead of spymemcached or couchbase

I am using a simple webapp (war) by Ricky 

Thanks

-Saurabh

David Lee

unread,
May 14, 2013, 8:38:14 AM5/14/13
to Saurabh Singh, memcached-se...@googlegroups.com, martin....@googlemail.com

I never ran into this - no clue.what does your config file look like ?

 

----------------------------------------

David A. Lee

dl...@calldei.com

http://www.xmlsh.org

 

From: Saurabh Singh [mailto:sing...@gmail.com]
Sent: Tuesday, May 14, 2013 8:22 AM
To: memcached-se...@googlegroups.com
Cc: David Lee; Saurabh Singh; martin....@googlemail.com
Subject: Re: Documentation for ElastiCache

 

Hello Martin,

 

Thanks for the information.

I tried it on AWS EC2, I had copied these jars into tomcat7/lib (and the kryo jars in the web-inf/lib)

1.      AmazonElastiCacheClusterClient-no-version.jar

2.      memcached-session-manager-1.6.4.jar

3.      memcached-session-manager-tc7-1.6.4.jar

David Lee

unread,
May 14, 2013, 8:41:03 AM5/14/13
to Saurabh Singh, memcached-se...@googlegroups.com, martin....@googlemail.com

In my case I deleted spymemcached-2.7.3.jar  as per

https://github.com/magro/memcached-session-manager/wiki/ConfigureElastiCache

 

 

Maybe you have a Couchbase jar lying around you need to delete ?

 

 

----------------------------------------

David A. Lee

dl...@calldei.com

http://www.xmlsh.org

 

From: Saurabh Singh [mailto:sing...@gmail.com]
Sent: Tuesday, May 14, 2013 8:22 AM
To: memcached-se...@googlegroups.com
Cc: David Lee; Saurabh Singh; martin....@googlemail.com
Subject: Re: Documentation for ElastiCache

 

Hello Martin,

 

Thanks for the information.

I tried it on AWS EC2, I had copied these jars into tomcat7/lib (and the kryo jars in the web-inf/lib)

1.      AmazonElastiCacheClusterClient-no-version.jar

2.      memcached-session-manager-1.6.4.jar

3.      memcached-session-manager-tc7-1.6.4.jar

Saurabh Singh

unread,
May 14, 2013, 9:00:35 AM5/14/13
to memcached-se...@googlegroups.com, Saurabh Singh, martin....@googlemail.com
The Context is same as your advise
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
        requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$" 
        transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory" 
        sessionBackupAsync="true" sticky="true" copyCollectionsForSerialization="false" />
just changed the Configuration Endpoint

I had not copied the spymemcached to tomcat7/lib (had only copied the 3 jars - screen-shot attached) and it's a brand new install of tomcat7 on a newly created EC2 t1micro instance, so I don't think couchbase jar would be present anywhere.
tomcat7-lib-list.PNG

Saurabh Singh

unread,
May 14, 2013, 10:28:46 AM5/14/13
to memcached-se...@googlegroups.com, Saurabh Singh, martin....@googlemail.com
Ok, it's working now 
It seems that couchbase-client-1.1.4.jar is always required to be in tomcat7/lib (the documentation gives the impression that it's required only if used)
Reply all
Reply to author
Forward
0 new messages