baiheqiang / memcached-session-manager

Automatically exported from code.google.com/p/memcached-session-manager
0 stars 0 forks source link

Hi ! I want to ask some questions ,thanks alot ! #45

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi ! tank you for helping !
my case is that:
I have a haproxy & tomcats cluster .
the haproxy:80 works at the front of this cluster ,
and there are some tomcats work together .
  haproxy can check the healthy of the tomcats , so one or more tomcats 
die doesn't make trouble to me ,but the haproxy cannot cache the 
JsessionID, so I was wondering if there is a good way to do that ,so I 
google it , I saw your work "memcached-session-manager" project,but I 
think your high-aviliablity clusters just like heartbeat , how to add more 
tomcats  servers ? and I cant understand the configuration clearly , for 
example "where is the memcached server and howto configur it ?" and , I 
dont know how to use your idea on my situation . I hop you can give me a 
help ! thanks you very much !

Original issue reported on code.google.com by rolling...@163.com on 8 Mar 2010 at 7:50

GoogleCodeExporter commented 8 years ago
Please ask questions on the mailing list:
http://groups.google.com/group/memcached-session-manager

When you post there, can you explain what you want to say with
  "..., but I think your high-aviliablity clusters just like heartbeat..."

Still, great that you're interested :-)

Original comment by martin.grotzke on 8 Mar 2010 at 8:51

GoogleCodeExporter commented 8 years ago
thank you very much ! English is not my nother language , sorry for my 
mistakes, 
I meant the example is "X" , just for 2tomcats and 2memcacheds run on two 
servers , 
how can this "X" works on my architecture ? 

           Haproxy 
              |
              |--------nginx           (for statics)
              |
   -----------------------             (for jsp app)
   |      |      |       |
tomcat1 tomca2 tomca3 tomcat4
   |------|------|-------|
              |
              |
             Mysql

Original comment by rolling...@163.com on 8 Mar 2010 at 9:13

GoogleCodeExporter commented 8 years ago
You should do this:
- Configure HAProxy so that it's doing sticky session (appsession?). Check that 
you specify as the 
length for appsession the length of the session id without the memcached node 
id (e.g. if the session 
id is 123456-n1 you should set 6 as length, at least if I understood 
appsession/length correctly)
- Configure tomcat1 with
  memcachedNodes="n1:tomcat1:11211 n2:tomcat2:11211 n3:tomcat3:11211 n4:tomcat4:11211"
  failoverNodes="n1"
- Configure tomcat2 with n2 as failover node:
  memcachedNodes="n1:tomcat1:11211 n2:tomcat2:11211 n3:tomcat3:11211 n4:tomcat4:11211"
  failoverNodes="n2"
- Configure tomcat3 and tomcat4 following the same rule

In n1:tomcat1:11211 tomcat1 stands for the ip address / hostname of tomcat1 and 
asumes that on this 
machine a memcached is running and listening on port 11211. Futhermore this 
asumes, that each 
tomcat/memcached pair is on its own machine. If all would be running on the 
same machine the 
failoverNodes could be left blank. Basically as failoverNodes should those 
memcacheds be configured 
that are running on the same machine as the tomcat (so that in the case of a 
hardware failure the 
sessions of this failing tomcat are _not_ stored in the memcached running on 
the same machine).

Your memcached instances should get some memory, you could run them e.g. like 
this:
$ memcached -p 11211 -u memcached -m 1024 -M 

If you have further questions please ask them on the mailing list:
http://groups.google.com/group/memcached-session-manager
(or don't you want to use this / have issues using it?)

Original comment by martin.grotzke on 9 Mar 2010 at 1:24