Hi,

I have one apache 80 port, and two tomcat 8080 and 8081 port, I am
using mod_proxy_ajp as the load balancer.

I have setup the environment, but failover is not working.

This test I have done is:
1. Start tomcat1 only
2. Login to my webapp through 80 port.
3. Shutdown tomcat1 and start tomcat2
4. Refresh my page, it asks me to login again.

MSM config:

<Manager
className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachedNodes="n1:localhost:11211"
sessionBackupAsync="false"
requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"

transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFactory"/
>

Tomcat:
<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatA/B">

Apache:
<VirtualHost *>
ServerAdmin webmaster@localhost
ServerName www.website.com
DocumentRoot /somepath/www
<Directory /somepath/www>
Options MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

ErrorLog /var/log/error.log

LogLevel warn

CustomLog /var/log/access.log combined

<Proxy balancer://tomcatservers>
BalancerMember ajp://localhost:8109 route=tomcatA retry=60
BalancerMember ajp://localhost:8209 route=tomcatB retry=60
</Proxy>

<Location />
Allow From All
ProxyPass balancer://tomcatservers/ stickysession=JSESSIONID
nofailover=off
</Location>
</VirtualHost>

Can you tell me what I may have missed?

Thanks a lot.

Search Discussions

  • PhoneGaper at Jun 2, 2012 at 7:24 am
    Just to clarify:

    There are two tomcats:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatA">
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatB">

    On Jun 2, 12:23 am, PhoneGaper wrote:
    Hi,

    I have one apache 80 port, and two tomcat 8080 and 8081 port, I am
    using mod_proxy_ajp as the load balancer.

    I have setup the environment, but failover is not working.

    This test I have done is:
    1. Start tomcat1 only
    2. Login to my webapp through 80 port.
    3. Shutdown tomcat1 and start tomcat2
    4. Refresh my page, it asks me to login again.

    MSM config:

    <Manager
    className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
    memcachedNodes="n1:localhost:11211"
    sessionBackupAsync="false"
    requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"

    transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFa ctory"/



    Tomcat:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatA/B">

    Apache:
    <VirtualHost *>
    ServerAdmin webmaster@localhost
    ServerNamewww.website.com
    DocumentRoot /somepath/www
    <Directory /somepath/www>
    Options MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>

    ErrorLog /var/log/error.log

    LogLevel warn

    CustomLog /var/log/access.log combined

    <Proxy balancer://tomcatservers>
    BalancerMember ajp://localhost:8109 route=tomcatA retry=60
    BalancerMember ajp://localhost:8209 route=tomcatB retry=60
    </Proxy>

    <Location />
    Allow From All
    ProxyPass balancer://tomcatservers/ stickysession=JSESSIONID
    nofailover=off
    </Location>
    </VirtualHost>

    Can you tell me what I may have missed?

    Thanks a lot.
  • Martin Grotzke at Jun 2, 2012 at 7:49 am
    Is session information itself (without auth stuff) replicated correctly?
    What kind of authentication do you use? What's the version of tomcat and
    msm?

    Cheers,
    Martin
    Am 02.06.2012 09:24 schrieb "PhoneGaper" <yaowen.tu@gmail.com>:
    Just to clarify:

    There are two tomcats:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatA">
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatB">

    On Jun 2, 12:23 am, PhoneGaper wrote:
    Hi,

    I have one apache 80 port, and two tomcat 8080 and 8081 port, I am
    using mod_proxy_ajp as the load balancer.

    I have setup the environment, but failover is not working.

    This test I have done is:
    1. Start tomcat1 only
    2. Login to my webapp through 80 port.
    3. Shutdown tomcat1 and start tomcat2
    4. Refresh my page, it asks me to login again.

    MSM config:

    <Manager
    className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
    memcachedNodes="n1:localhost:11211"
    sessionBackupAsync="false"
    requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
    transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFa
    ctory"/


    Tomcat:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatA/B">

    Apache:
    <VirtualHost *>
    ServerAdmin webmaster@localhost
    ServerNamewww.website.com
    DocumentRoot /somepath/www
    <Directory /somepath/www>
    Options MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>

    ErrorLog /var/log/error.log

    LogLevel warn

    CustomLog /var/log/access.log combined

    <Proxy balancer://tomcatservers>
    BalancerMember ajp://localhost:8109 route=tomcatA retry=60
    BalancerMember ajp://localhost:8209 route=tomcatB retry=60
    </Proxy>

    <Location />
    Allow From All
    ProxyPass balancer://tomcatservers/
    stickysession=JSESSIONID
    nofailover=off
    </Location>
    </VirtualHost>

    Can you tell me what I may have missed?

    Thanks a lot.
  • PhoneGaper at Jun 2, 2012 at 9:38 am
    is session information itself (without auth stuff) replicated
    correctly?
    What do you mean by this?

    Tomcat 6
    MSM 1.6.1

    After more investigation, I find something weird.

    1. Go to home page of my website. It will generate a new session with
    id like: "0077FFF46C52EA160F392D4519E9CB0F-n1"
    2. Then I telnet into memcached server, and try to get this session,
    it returns:
    VALUE 0077FFF46C52EA160F392D4519E9CB0F-n1 2048 382
    .........(Serialized object)
    I am not sure what "2048" represents for. It is a flag. But 382
    means the size of this object.
    3. Then I log in to my website. This operation will insert more
    information into the session. I expect the cached session object
    should be bigger than 382
    4. But when I try to get the same session from memcached server, it
    still returns 382.

    Is that expected? Will MSM ignore some of the information in session
    when storing it to memcached server?

    Thanks.
    On Jun 2, 12:49 am, Martin Grotzke wrote:
    Is session information itself (without auth stuff) replicated correctly?
    What kind of authentication do you use? What's the version of tomcat and
    msm?

    Cheers,
    Martin
    Am 02.06.2012 09:24 schrieb "PhoneGaper" <yaowen...@gmail.com>:






    Just to clarify:
    There are two tomcats:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatA">
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatB">
    On Jun 2, 12:23 am, PhoneGaper wrote:
    Hi,
    I have one apache 80 port, and two tomcat 8080 and 8081 port, I am
    using mod_proxy_ajp as the load balancer.
    I have setup the environment, but failover is not working.
    This test I have done is:
    1. Start tomcat1 only
    2. Login to my webapp through 80 port.
    3. Shutdown tomcat1 and start tomcat2
    4. Refresh my page, it asks me to login again.
    MSM config:
    <Manager
    className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
    memcachedNodes="n1:localhost:11211"
    sessionBackupAsync="false"
    requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
    transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFa
    ctory"/
    Tomcat:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatA/B">
    Apache:
    <VirtualHost *>
    ServerAdmin webmaster@localhost
    ServerNamewww.website.com
    DocumentRoot /somepath/www
    <Directory /somepath/www>
    Options MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>
    ErrorLog /var/log/error.log
    LogLevel warn
    CustomLog /var/log/access.log combined
    <Proxy balancer://tomcatservers>
    BalancerMember ajp://localhost:8109 route=tomcatA retry=60
    BalancerMember ajp://localhost:8209 route=tomcatB retry=60
    </Proxy>
    <Location />
    Allow From All
    ProxyPass balancer://tomcatservers/
    stickysession=JSESSIONID
    nofailover=off
    </Location>
    </VirtualHost>
    Can you tell me what I may have missed?
    Thanks a lot.
  • PhoneGaper at Jun 2, 2012 at 9:46 am
    Forgot to mention that:

    Even though the object size in memcached server didn't change, in
    application layer I can see that more information has been inserted
    into session(by debug and inspect the object).

    To me it seems that something has been stored locally only and
    something has been pushed to memcached server.
    On Jun 2, 2:38 am, PhoneGaper wrote:
    is session information itself (without auth stuff) replicated
    correctly?
    What do you mean by this?

    Tomcat 6
    MSM 1.6.1

    After more investigation, I find something weird.

    1. Go to home page of my website. It will generate a new session with
    id like: "0077FFF46C52EA160F392D4519E9CB0F-n1"
    2. Then I telnet into memcached server, and try to get this session,
    it returns:
    VALUE 0077FFF46C52EA160F392D4519E9CB0F-n1 2048 382
    .........(Serialized object)
    I am not sure what "2048" represents for. It is a flag. But 382
    means the size of this object.
    3. Then I log in to my website. This operation will insert more
    information into the session. I expect the cached session object
    should be bigger than 382
    4. But when I try to get the same session from memcached server, it
    still returns 382.

    Is that expected? Will MSM ignore some of the information in session
    when storing it to memcached server?

    Thanks.

    On Jun 2, 12:49 am, Martin Grotzke wrote:






    Is session information itself (without auth stuff) replicated correctly?
    What kind of authentication do you use? What's the version of tomcat and
    msm?
    Cheers,
    Martin
    Am 02.06.2012 09:24 schrieb "PhoneGaper" <yaowen...@gmail.com>:
    Just to clarify:
    There are two tomcats:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatA">
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatB">
    On Jun 2, 12:23 am, PhoneGaper wrote:
    Hi,
    I have one apache 80 port, and two tomcat 8080 and 8081 port, I am
    using mod_proxy_ajp as the load balancer.
    I have setup the environment, but failover is not working.
    This test I have done is:
    1. Start tomcat1 only
    2. Login to my webapp through 80 port.
    3. Shutdown tomcat1 and start tomcat2
    4. Refresh my page, it asks me to login again.
    MSM config:
    <Manager
    className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
    memcachedNodes="n1:localhost:11211"
    sessionBackupAsync="false"
    requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
    transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFa
    ctory"/
    Tomcat:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatA/B">
    Apache:
    <VirtualHost *>
    ServerAdmin webmaster@localhost
    ServerNamewww.website.com
    DocumentRoot /somepath/www
    <Directory /somepath/www>
    Options MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>
    ErrorLog /var/log/error.log
    LogLevel warn
    CustomLog /var/log/access.log combined
    <Proxy balancer://tomcatservers>
    BalancerMember ajp://localhost:8109 route=tomcatA retry=60
    BalancerMember ajp://localhost:8209 route=tomcatB retry=60
    </Proxy>
    <Location />
    Allow From All
    ProxyPass balancer://tomcatservers/
    stickysession=JSESSIONID
    nofailover=off
    </Location>
    </VirtualHost>
    Can you tell me what I may have missed?
    Thanks a lot.
  • Martin Grotzke at Jun 2, 2012 at 11:06 am
    You should turn on debug logging (according to docs) and run memcached with
    -vv.

    With "is session information itself (without auth stuff) replicated
    correctly?" I meant if session attributes on public pages (no auth needed)
    are accessible after failover.

    I also asked for more details regarding auth, e.g. is it container managed
    (form based, basic) or s.th. like shiro or spring security?

    Cheers,
    Martin
    Am 02.06.2012 11:46 schrieb "PhoneGaper" <yaowen.tu@gmail.com>:
    Forgot to mention that:

    Even though the object size in memcached server didn't change, in
    application layer I can see that more information has been inserted
    into session(by debug and inspect the object).

    To me it seems that something has been stored locally only and
    something has been pushed to memcached server.
    On Jun 2, 2:38 am, PhoneGaper wrote:
    is session information itself (without auth stuff) replicated
    correctly?
    What do you mean by this?

    Tomcat 6
    MSM 1.6.1

    After more investigation, I find something weird.

    1. Go to home page of my website. It will generate a new session with
    id like: "0077FFF46C52EA160F392D4519E9CB0F-n1"
    2. Then I telnet into memcached server, and try to get this session,
    it returns:
    VALUE 0077FFF46C52EA160F392D4519E9CB0F-n1 2048 382
    .........(Serialized object)
    I am not sure what "2048" represents for. It is a flag. But 382
    means the size of this object.
    3. Then I log in to my website. This operation will insert more
    information into the session. I expect the cached session object
    should be bigger than 382
    4. But when I try to get the same session from memcached server, it
    still returns 382.

    Is that expected? Will MSM ignore some of the information in session
    when storing it to memcached server?

    Thanks.

    On Jun 2, 12:49 am, Martin Grotzke <martin.grot...@googlemail.com>
    wrote:






    Is session information itself (without auth stuff) replicated
    correctly?
    What kind of authentication do you use? What's the version of tomcat
    and
    msm?
    Cheers,
    Martin
    Am 02.06.2012 09:24 schrieb "PhoneGaper" <yaowen...@gmail.com>:
    Just to clarify:
    There are two tomcats:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatA">
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatB">
    On Jun 2, 12:23 am, PhoneGaper wrote:
    Hi,
    I have one apache 80 port, and two tomcat 8080 and 8081 port, I am
    using mod_proxy_ajp as the load balancer.
    I have setup the environment, but failover is not working.
    This test I have done is:
    1. Start tomcat1 only
    2. Login to my webapp through 80 port.
    3. Shutdown tomcat1 and start tomcat2
    4. Refresh my page, it asks me to login again.
    MSM config:
    <Manager
    className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
    memcachedNodes="n1:localhost:11211"
    sessionBackupAsync="false"
    requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
    transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFa
    ctory"/
    Tomcat:
    <Engine name="Catalina" defaultHost="localhost"
    jvmRoute="tomcatA/B">
    Apache:
    <VirtualHost *>
    ServerAdmin webmaster@localhost
    ServerNamewww.website.com
    DocumentRoot /somepath/www
    <Directory /somepath/www>
    Options MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>
    ErrorLog /var/log/error.log
    LogLevel warn
    CustomLog /var/log/access.log combined
    <Proxy balancer://tomcatservers>
    BalancerMember ajp://localhost:8109 route=tomcatA retry=60
    BalancerMember ajp://localhost:8209 route=tomcatB retry=60
    </Proxy>
    <Location />
    Allow From All
    ProxyPass balancer://tomcatservers/
    stickysession=JSESSIONID
    nofailover=off
    </Location>
    </VirtualHost>
    Can you tell me what I may have missed?
    Thanks a lot.
  • PhoneGaper at Jun 2, 2012 at 6:57 pm
    I meant if session attributes on public pages (no auth needed) are
    accessible after failover.
    Yes. For debugging purpose, I added a "counter" in the
    session, and this counter can be ready and displayed properly after
    failover. But user related information in the session lost.

    I will try -vv

    The auth is just a basic login that we implemented. We are not using
    any plugins or tools. Just a basic username and password and check
    with record in DB.

    On Jun 2, 4:06 am, Martin Grotzke wrote:
    You should turn on debug logging (according to docs) and run memcached with
    -vv.

    With "is session information itself (without auth stuff) replicated
    correctly?" I meant if session attributes on public pages (no auth needed)
    are accessible after failover.

    I also asked for more details regarding auth, e.g. is it container managed
    (form based, basic) or s.th. like shiro or spring security?

    Cheers,
    Martin
    Am 02.06.2012 11:46 schrieb "PhoneGaper" <yaowen...@gmail.com>:






    Forgot to mention that:
    Even though the object size in memcached server didn't change, in
    application layer I can see that more information has been inserted
    into session(by debug and inspect the object).
    To me it seems that something has been stored locally only and
    something has been pushed to memcached server.
    On Jun 2, 2:38 am, PhoneGaper wrote:
    is session information itself (without auth stuff) replicated
    correctly?
    What do you mean by this?
    Tomcat 6
    MSM 1.6.1
    After more investigation, I find something weird.
    1. Go to home page of my website. It will generate a new session with
    id like: "0077FFF46C52EA160F392D4519E9CB0F-n1"
    2. Then I telnet into memcached server, and try to get this session,
    it returns:
    VALUE 0077FFF46C52EA160F392D4519E9CB0F-n1 2048 382
    .........(Serialized object)
    I am not sure what "2048" represents for. It is a flag. But 382
    means the size of this object.
    3. Then I log in to my website. This operation will insert more
    information into the session. I expect the cached session object
    should be bigger than 382
    4. But when I try to get the same session from memcached server, it
    still returns 382.
    Is that expected? Will MSM ignore some of the information in session
    when storing it to memcached server?
    Thanks.
    On Jun 2, 12:49 am, Martin Grotzke <martin.grot...@googlemail.com>
    wrote:
    Is session information itself (without auth stuff) replicated
    correctly?
    What kind of authentication do you use? What's the version of tomcat
    and
    msm?
    Cheers,
    Martin
    Am 02.06.2012 09:24 schrieb "PhoneGaper" <yaowen...@gmail.com>:
    Just to clarify:
    There are two tomcats:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatA">
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatB">
    On Jun 2, 12:23 am, PhoneGaper wrote:
    Hi,
    I have one apache 80 port, and two tomcat 8080 and 8081 port, I am
    using mod_proxy_ajp as the load balancer.
    I have setup the environment, but failover is not working.
    This test I have done is:
    1. Start tomcat1 only
    2. Login to my webapp through 80 port.
    3. Shutdown tomcat1 and start tomcat2
    4. Refresh my page, it asks me to login again.
    MSM config:
    <Manager
    className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
    memcachedNodes="n1:localhost:11211"
    sessionBackupAsync="false"
    requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
    transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFa
    ctory"/
    Tomcat:
    <Engine name="Catalina" defaultHost="localhost"
    jvmRoute="tomcatA/B">
    Apache:
    <VirtualHost *>
    ServerAdmin webmaster@localhost
    ServerNamewww.website.com
    DocumentRoot /somepath/www
    <Directory /somepath/www>
    Options MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>
    ErrorLog /var/log/error.log
    LogLevel warn
    CustomLog /var/log/access.log combined
    <Proxy balancer://tomcatservers>
    BalancerMember ajp://localhost:8109 route=tomcatA retry=60
    BalancerMember ajp://localhost:8209 route=tomcatB retry=60
    </Proxy>
    <Location />
    Allow From All
    ProxyPass balancer://tomcatservers/
    stickysession=JSESSIONID
    nofailover=off
    </Location>
    </VirtualHost>
    Can you tell me what I may have missed?
    Thanks a lot.
  • Martin Grotzke at Jun 2, 2012 at 8:02 pm

    On 06/02/2012 08:57 PM, PhoneGaper wrote:
    I meant if session attributes on public pages (no auth needed) are
    accessible after failover.
    Yes. For debugging purpose, I added a "counter" in the
    session, and this counter can be ready and displayed properly after
    failover. Ok.
    But user related information in the session lost.
    Just to be sure: is it serializable?
    I will try -vv
    As I already wrote debug logging will also provide more insight:
    http://code.google.com/p/memcached-session-manager/wiki/SetupAndConfiguration#Configure_logging

    Cheers,
    Martin

    The auth is just a basic login that we implemented. We are not using
    any plugins or tools. Just a basic username and password and check
    with record in DB.

    On Jun 2, 4:06 am, Martin Grotzke wrote:
    You should turn on debug logging (according to docs) and run memcached with
    -vv.

    With "is session information itself (without auth stuff) replicated
    correctly?" I meant if session attributes on public pages (no auth needed)
    are accessible after failover.

    I also asked for more details regarding auth, e.g. is it container managed
    (form based, basic) or s.th. like shiro or spring security?

    Cheers,
    Martin
    Am 02.06.2012 11:46 schrieb "PhoneGaper" <yaowen...@gmail.com>:






    Forgot to mention that:
    Even though the object size in memcached server didn't change, in
    application layer I can see that more information has been inserted
    into session(by debug and inspect the object).
    To me it seems that something has been stored locally only and
    something has been pushed to memcached server.
    On Jun 2, 2:38 am, PhoneGaper wrote:
    is session information itself (without auth stuff) replicated
    correctly?
    What do you mean by this?
    Tomcat 6
    MSM 1.6.1
    After more investigation, I find something weird.
    1. Go to home page of my website. It will generate a new session with
    id like: "0077FFF46C52EA160F392D4519E9CB0F-n1"
    2. Then I telnet into memcached server, and try to get this session,
    it returns:
    VALUE 0077FFF46C52EA160F392D4519E9CB0F-n1 2048 382
    .........(Serialized object)
    I am not sure what "2048" represents for. It is a flag. But 382
    means the size of this object.
    3. Then I log in to my website. This operation will insert more
    information into the session. I expect the cached session object
    should be bigger than 382
    4. But when I try to get the same session from memcached server, it
    still returns 382.
    Is that expected? Will MSM ignore some of the information in session
    when storing it to memcached server?
    Thanks.
    On Jun 2, 12:49 am, Martin Grotzke <martin.grot...@googlemail.com>
    wrote:
    Is session information itself (without auth stuff) replicated
    correctly?
    What kind of authentication do you use? What's the version of tomcat
    and
    msm?
    Cheers,
    Martin
    Am 02.06.2012 09:24 schrieb "PhoneGaper" <yaowen...@gmail.com>:
    Just to clarify:
    There are two tomcats:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatA">
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatB">
    On Jun 2, 12:23 am, PhoneGaper wrote:
    Hi,
    I have one apache 80 port, and two tomcat 8080 and 8081 port, I am
    using mod_proxy_ajp as the load balancer.
    I have setup the environment, but failover is not working.
    This test I have done is:
    1. Start tomcat1 only
    2. Login to my webapp through 80 port.
    3. Shutdown tomcat1 and start tomcat2
    4. Refresh my page, it asks me to login again.
    MSM config:
    <Manager
    className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
    memcachedNodes="n1:localhost:11211"
    sessionBackupAsync="false"
    requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
    transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFa
    ctory"/
    Tomcat:
    <Engine name="Catalina" defaultHost="localhost"
    jvmRoute="tomcatA/B">
    Apache:
    <VirtualHost *>
    ServerAdmin webmaster@localhost
    ServerNamewww.website.com
    DocumentRoot /somepath/www
    <Directory /somepath/www>
    Options MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>
    ErrorLog /var/log/error.log
    LogLevel warn
    CustomLog /var/log/access.log combined
    <Proxy balancer://tomcatservers>
    BalancerMember ajp://localhost:8109 route=tomcatA retry=60
    BalancerMember ajp://localhost:8209 route=tomcatB retry=60
    </Proxy>
    <Location />
    Allow From All
    ProxyPass balancer://tomcatservers/
    stickysession=JSESSIONID
    nofailover=off
    </Location>
    </VirtualHost>
    Can you tell me what I may have missed?
    Thanks a lot.
    --
    inoio gmbh
    Breitenfelder Str. 13c, 20251 Hamburg
    Amtsgericht Hamburg, HRB 123031
    Geschäftsführer: Dennis Brakhane, Martin Grotzke, Ole Langbehn
  • PhoneGaper at Jun 3, 2012 at 2:12 am
    The object I use to store user login info that will be stored in
    session is NOT serializable(I didn't implement the interface for the
    class). Does all the object stored in the session need to be
    serializable? Is that the reason? I didn't see this note in the
    tutorial. Maybe I missed?
    On Jun 2, 1:02 pm, Martin Grotzke wrote:
    On 06/02/2012 08:57 PM, PhoneGaper wrote:> I meant if session attributes on public pages (no auth needed) are
    accessible after failover.
    Yes. For debugging purpose, I added a "counter" in the
    session, and this counter can be ready and displayed properly after
    failover. Ok.
    But user related information in the session lost.
    Just to be sure: is it serializable?


    I will try -vv
    As I already wrote debug logging will also provide more insight:http://code.google.com/p/memcached-session-manager/wiki/SetupAndConfi...

    Cheers,
    Martin










    The auth is just a basic login that we implemented. We are not using
    any plugins or tools. Just a basic username and password and check
    with record in DB.
    On Jun 2, 4:06 am, Martin Grotzke <martin.grot...@googlemail.com>
    wrote:
    You should turn on debug logging (according to docs) and run memcached with
    -vv.
    With "is session information itself (without auth stuff) replicated
    correctly?" I meant if session attributes on public pages (no auth needed)
    are accessible after failover.
    I also asked for more details regarding auth, e.g. is it container managed
    (form based, basic) or s.th. like shiro or spring security?
    Cheers,
    Martin
    Am 02.06.2012 11:46 schrieb "PhoneGaper" <yaowen...@gmail.com>:
    Forgot to mention that:
    Even though the object size in memcached server didn't change, in
    application layer I can see that more information has been inserted
    into session(by debug and inspect the object).
    To me it seems that something has been stored locally only and
    something has been pushed to memcached server.
    On Jun 2, 2:38 am, PhoneGaper wrote:
    is session information itself (without auth stuff) replicated
    correctly?
    What do you mean by this?
    Tomcat 6
    MSM 1.6.1
    After more investigation, I find something weird.
    1. Go to home page of my website. It will generate a new session with
    id like: "0077FFF46C52EA160F392D4519E9CB0F-n1"
    2. Then I telnet into memcached server, and try to get this session,
    it returns:
    VALUE 0077FFF46C52EA160F392D4519E9CB0F-n1 2048 382
    .........(Serialized object)
    I am not sure what "2048" represents for. It is a flag. But 382
    means the size of this object.
    3. Then I log in to my website. This operation will insert more
    information into the session. I expect the cached session object
    should be bigger than 382
    4. But when I try to get the same session from memcached server, it
    still returns 382.
    Is that expected? Will MSM ignore some of the information in session
    when storing it to memcached server?
    Thanks.
    On Jun 2, 12:49 am, Martin Grotzke <martin.grot...@googlemail.com>
    wrote:
    Is session information itself (without auth stuff) replicated
    correctly?
    What kind of authentication do you use? What's the version of tomcat
    and
    msm?
    Cheers,
    Martin
    Am 02.06.2012 09:24 schrieb "PhoneGaper" <yaowen...@gmail.com>:
    Just to clarify:
    There are two tomcats:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatA">
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatB">
    On Jun 2, 12:23 am, PhoneGaper wrote:
    Hi,
    I have one apache 80 port, and two tomcat 8080 and 8081 port, I am
    using mod_proxy_ajp as the load balancer.
    I have setup the environment, but failover is not working.
    This test I have done is:
    1. Start tomcat1 only
    2. Login to my webapp through 80 port.
    3. Shutdown tomcat1 and start tomcat2
    4. Refresh my page, it asks me to login again.
    MSM config:
    <Manager
    className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
    memcachedNodes="n1:localhost:11211"
    sessionBackupAsync="false"
    requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
    transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFa
    ctory"/
    Tomcat:
    <Engine name="Catalina" defaultHost="localhost"
    jvmRoute="tomcatA/B">
    Apache:
    <VirtualHost *>
    ServerAdmin webmaster@localhost
    ServerNamewww.website.com
    DocumentRoot /somepath/www
    <Directory /somepath/www>
    Options MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>
    ErrorLog /var/log/error.log
    LogLevel warn
    CustomLog /var/log/access.log combined
    <Proxy balancer://tomcatservers>
    BalancerMember ajp://localhost:8109 route=tomcatA retry=60
    BalancerMember ajp://localhost:8209 route=tomcatB retry=60
    </Proxy>
    <Location />
    Allow From All
    ProxyPass balancer://tomcatservers/
    stickysession=JSESSIONID
    nofailover=off
    </Location>
    </VirtualHost>
    Can you tell me what I may have missed?
    Thanks a lot.
    --
    inoio gmbh
    Breitenfelder Str. 13c, 20251 Hamburg
    Amtsgericht Hamburg, HRB 123031
    Geschäftsführer: Dennis Brakhane, Martin Grotzke, Ole Langbehn

    signature.asc
    < 1KViewDownload
  • Billy Bacon at Jun 3, 2012 at 2:23 am
    Indeed. Anything and everything that you would like to persist to some type of datastore needs to be serializable. This rule applies to storing objects in memcached, terracotta or even writing things to a file system (amongst many other things) to be preserved/persisted. This is likely your issue or at least, part of it.

    - Billy -
    On Jun 2, 2012, at 8:12 PM, PhoneGaper wrote:

    The object I use to store user login info that will be stored in
    session is NOT serializable(I didn't implement the interface for the
    class). Does all the object stored in the session need to be
    serializable? Is that the reason? I didn't see this note in the
    tutorial. Maybe I missed?
    On Jun 2, 1:02 pm, Martin Grotzke wrote:
    On 06/02/2012 08:57 PM, PhoneGaper wrote:> I meant if session attributes on public pages (no auth needed) are
    accessible after failover.
    Yes. For debugging purpose, I added a "counter" in the
    session, and this counter can be ready and displayed properly after
    failover. Ok.
    But user related information in the session lost.
    Just to be sure: is it serializable?


    I will try -vv
    As I already wrote debug logging will also provide more insight:http://code.google.com/p/memcached-session-manager/wiki/SetupAndConfi...

    Cheers,
    Martin










    The auth is just a basic login that we implemented. We are not using
    any plugins or tools. Just a basic username and password and check
    with record in DB.
    On Jun 2, 4:06 am, Martin Grotzke <martin.grot...@googlemail.com>
    wrote:
    You should turn on debug logging (according to docs) and run memcached with
    -vv.
    With "is session information itself (without auth stuff) replicated
    correctly?" I meant if session attributes on public pages (no auth needed)
    are accessible after failover.
    I also asked for more details regarding auth, e.g. is it container managed
    (form based, basic) or s.th. like shiro or spring security?
    Cheers,
    Martin
    Am 02.06.2012 11:46 schrieb "PhoneGaper" <yaowen...@gmail.com>:
    Forgot to mention that:
    Even though the object size in memcached server didn't change, in
    application layer I can see that more information has been inserted
    into session(by debug and inspect the object).
    To me it seems that something has been stored locally only and
    something has been pushed to memcached server.
    On Jun 2, 2:38 am, PhoneGaper wrote:
    is session information itself (without auth stuff) replicated
    correctly?
    What do you mean by this?
    Tomcat 6
    MSM 1.6.1
    After more investigation, I find something weird.
    1. Go to home page of my website. It will generate a new session with
    id like: "0077FFF46C52EA160F392D4519E9CB0F-n1"
    2. Then I telnet into memcached server, and try to get this session,
    it returns:
    VALUE 0077FFF46C52EA160F392D4519E9CB0F-n1 2048 382
    .........(Serialized object)
    I am not sure what "2048" represents for. It is a flag. But 382
    means the size of this object.
    3. Then I log in to my website. This operation will insert more
    information into the session. I expect the cached session object
    should be bigger than 382
    4. But when I try to get the same session from memcached server, it
    still returns 382.
    Is that expected? Will MSM ignore some of the information in session
    when storing it to memcached server?
    Thanks.
    On Jun 2, 12:49 am, Martin Grotzke <martin.grot...@googlemail.com>
    wrote:
    Is session information itself (without auth stuff) replicated
    correctly?
    What kind of authentication do you use? What's the version of tomcat
    and
    msm?
    Cheers,
    Martin
    Am 02.06.2012 09:24 schrieb "PhoneGaper" <yaowen...@gmail.com>:
    Just to clarify:
    There are two tomcats:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatA">
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatB">
    On Jun 2, 12:23 am, PhoneGaper wrote:
    Hi,
    I have one apache 80 port, and two tomcat 8080 and 8081 port, I am
    using mod_proxy_ajp as the load balancer.
    I have setup the environment, but failover is not working.
    This test I have done is:
    1. Start tomcat1 only
    2. Login to my webapp through 80 port.
    3. Shutdown tomcat1 and start tomcat2
    4. Refresh my page, it asks me to login again.
    MSM config:
    <Manager
    className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
    memcachedNodes="n1:localhost:11211"
    sessionBackupAsync="false"
    requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
    transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFa
    ctory"/
    Tomcat:
    <Engine name="Catalina" defaultHost="localhost"
    jvmRoute="tomcatA/B">
    Apache:
    <VirtualHost *>
    ServerAdmin webmaster@localhost
    ServerNamewww.website.com
    DocumentRoot /somepath/www
    <Directory /somepath/www>
    Options MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>
    ErrorLog /var/log/error.log
    LogLevel warn
    CustomLog /var/log/access.log combined
    <Proxy balancer://tomcatservers>
    BalancerMember ajp://localhost:8109 route=tomcatA retry=60
    BalancerMember ajp://localhost:8209 route=tomcatB retry=60
    </Proxy>
    <Location />
    Allow From All
    ProxyPass balancer://tomcatservers/
    stickysession=JSESSIONID
    nofailover=off
    </Location>
    </VirtualHost>
    Can you tell me what I may have missed?
    Thanks a lot.
    --
    inoio gmbh
    Breitenfelder Str. 13c, 20251 Hamburg
    Amtsgericht Hamburg, HRB 123031
    Geschäftsführer: Dennis Brakhane, Martin Grotzke, Ole Langbehn

    signature.asc
    < 1KViewDownload
  • PhoneGaper at Jun 3, 2012 at 3:10 am
    Thanks a lot. It is now resolved.

    Really appreciate your prompt reply.
    On Jun 2, 7:23 pm, Billy Bacon wrote:
    Indeed. Anything and everything that you would like to persist to some type of datastore needs to be serializable. This rule applies to storing objects in memcached, terracotta or even writing things to a file system (amongst many other things) to be preserved/persisted. This is likely your issue or at least, part of it.

    - Billy -

    On Jun 2, 2012, at 8:12 PM, PhoneGaper wrote:






    The object I use to store user login info that will be stored in
    session is NOT serializable(I didn't implement the interface for the
    class). Does all the object stored in the session need to be
    serializable? Is that the reason? I didn't see this note in the
    tutorial. Maybe I missed?
    On Jun 2, 1:02 pm, Martin Grotzke <martin.grot...@googlemail.com>
    wrote:
    On 06/02/2012 08:57 PM, PhoneGaper wrote:> I meant if session attributes on public pages (no auth needed) are
    accessible after failover.
    Yes. For debugging purpose, I added a "counter" in the
    session, and this counter can be ready and displayed properly after
    failover. Ok.
    But user related information in the session lost.
    Just to be sure: is it serializable?
    I will try -vv
    As I already wrote debug logging will also provide more insight:http://code.google.com/p/memcached-session-manager/wiki/SetupAndConfi...
    Cheers,
    Martin
    The auth is just a basic login that we implemented. We are not using
    any plugins or tools. Just a basic username and password and check
    with record in DB.
    On Jun 2, 4:06 am, Martin Grotzke <martin.grot...@googlemail.com>
    wrote:
    You should turn on debug logging (according to docs) and run memcached with
    -vv.
    With "is session information itself (without auth stuff) replicated
    correctly?" I meant if session attributes on public pages (no auth needed)
    are accessible after failover.
    I also asked for more details regarding auth, e.g. is it container managed
    (form based, basic) or s.th. like shiro or spring security?
    Cheers,
    Martin
    Am 02.06.2012 11:46 schrieb "PhoneGaper" <yaowen...@gmail.com>:
    Forgot to mention that:
    Even though the object size in memcached server didn't change, in
    application layer I can see that more information has been inserted
    into session(by debug and inspect the object).
    To me it seems that something has been stored locally only and
    something has been pushed to memcached server.
    On Jun 2, 2:38 am, PhoneGaper wrote:
    is session information itself (without auth stuff) replicated
    correctly?
    What do you mean by this?
    Tomcat 6
    MSM 1.6.1
    After more investigation, I find something weird.
    1. Go to home page of my website. It will generate a new session with
    id like: "0077FFF46C52EA160F392D4519E9CB0F-n1"
    2. Then I telnet into memcached server, and try to get this session,
    it returns:
    VALUE 0077FFF46C52EA160F392D4519E9CB0F-n1 2048 382
    .........(Serialized object)
    I am not sure what "2048" represents for. It is a flag. But 382
    means the size of this object.
    3. Then I log in to my website. This operation will insert more
    information into the session. I expect the cached session object
    should be bigger than 382
    4. But when I try to get the same session from memcached server, it
    still returns 382.
    Is that expected? Will MSM ignore some of the information in session
    when storing it to memcached server?
    Thanks.
    On Jun 2, 12:49 am, Martin Grotzke <martin.grot...@googlemail.com>
    wrote:
    Is session information itself (without auth stuff) replicated
    correctly?
    What kind of authentication do you use? What's the version of tomcat
    and
    msm?
    Cheers,
    Martin
    Am 02.06.2012 09:24 schrieb "PhoneGaper" <yaowen...@gmail.com>:
    Just to clarify:
    There are two tomcats:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatA">
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcatB">
    On Jun 2, 12:23 am, PhoneGaper wrote:
    Hi,
    I have one apache 80 port, and two tomcat 8080 and 8081 port, I am
    using mod_proxy_ajp as the load balancer.
    I have setup the environment, but failover is not working.
    This test I have done is:
    1. Start tomcat1 only
    2. Login to my webapp through 80 port.
    3. Shutdown tomcat1 and start tomcat2
    4. Refresh my page, it asks me to login again.
    MSM config:
    <Manager
    className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
    memcachedNodes="n1:localhost:11211"
    sessionBackupAsync="false"
    requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
    transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFa
    ctory"/
    Tomcat:
    <Engine name="Catalina" defaultHost="localhost"
    jvmRoute="tomcatA/B">
    Apache:
    <VirtualHost *>
    ServerAdmin webmaster@localhost
    ServerNamewww.website.com
    DocumentRoot /somepath/www
    <Directory /somepath/www>
    Options MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>
    ErrorLog /var/log/error.log
    LogLevel warn
    CustomLog /var/log/access.log combined
    <Proxy balancer://tomcatservers>
    BalancerMember ajp://localhost:8109 route=tomcatA retry=60
    BalancerMember ajp://localhost:8209 route=tomcatB retry=60
    </Proxy>
    <Location />
    Allow From All
    ProxyPass balancer://tomcatservers/
    stickysession=JSESSIONID
    nofailover=off
    </Location>
    </VirtualHost>
    Can you tell me what I may have missed?
    Thanks a lot.
    --
    inoio gmbh
    Breitenfelder Str. 13c, 20251 Hamburg
    Amtsgericht Hamburg, HRB 123031
    Geschäftsführer: Dennis Brakhane, Martin Grotzke, Ole Langbehn
    signature.asc
    < 1KViewDownload
  • Martin Grotzke at Jun 3, 2012 at 6:55 am
    Alternatively you can use kryo serialization which does not have this
    requirement. The wiki contains a comparison of available serialization
    strategies with features and requirements btw.

    Cheers,
    Martin
    Am 03.06.2012 05:10 schrieb "PhoneGaper" <yaowen.tu@gmail.com>:
    Thanks a lot. It is now resolved.

    Really appreciate your prompt reply.
    On Jun 2, 7:23 pm, Billy Bacon wrote:
    Indeed. Anything and everything that you would like to persist to some
    type of datastore needs to be serializable. This rule applies to storing
    objects in memcached, terracotta or even writing things to a file system
    (amongst many other things) to be preserved/persisted. This is likely your
    issue or at least, part of it.
    - Billy -

    On Jun 2, 2012, at 8:12 PM, PhoneGaper wrote:






    The object I use to store user login info that will be stored in
    session is NOT serializable(I didn't implement the interface for the
    class). Does all the object stored in the session need to be
    serializable? Is that the reason? I didn't see this note in the
    tutorial. Maybe I missed?
    On Jun 2, 1:02 pm, Martin Grotzke <martin.grot...@googlemail.com>
    wrote:
    On 06/02/2012 08:57 PM, PhoneGaper wrote:> I meant if session
    attributes on public pages (no auth needed) are
    accessible after failover.
    Yes. For debugging purpose, I added a "counter" in the
    session, and this counter can be ready and displayed properly after
    failover. Ok.
    But user related information in the session lost.
    Just to be sure: is it serializable?
    I will try -vv
    As I already wrote debug logging will also provide more insight:
    http://code.google.com/p/memcached-session-manager/wiki/SetupAndConfi...
    Cheers,
    Martin
    The auth is just a basic login that we implemented. We are not using
    any plugins or tools. Just a basic username and password and check
    with record in DB.
    On Jun 2, 4:06 am, Martin Grotzke <martin.grot...@googlemail.com>
    wrote:
    You should turn on debug logging (according to docs) and run
    memcached with
    -vv.
    With "is session information itself (without auth stuff) replicated
    correctly?" I meant if session attributes on public pages (no auth
    needed)
    are accessible after failover.
    I also asked for more details regarding auth, e.g. is it container
    managed
    (form based, basic) or s.th. like shiro or spring security?
    Cheers,
    Martin
    Am 02.06.2012 11:46 schrieb "PhoneGaper" <yaowen...@gmail.com>:
    Forgot to mention that:
    Even though the object size in memcached server didn't change, in
    application layer I can see that more information has been inserted
    into session(by debug and inspect the object).
    To me it seems that something has been stored locally only and
    something has been pushed to memcached server.
    On Jun 2, 2:38 am, PhoneGaper wrote:
    is session information itself (without auth stuff) replicated
    correctly?
    What do you mean by this?
    Tomcat 6
    MSM 1.6.1
    After more investigation, I find something weird.
    1. Go to home page of my website. It will generate a new session
    with
    id like: "0077FFF46C52EA160F392D4519E9CB0F-n1"
    2. Then I telnet into memcached server, and try to get this
    session,
    it returns:
    VALUE 0077FFF46C52EA160F392D4519E9CB0F-n1 2048 382
    .........(Serialized object)
    I am not sure what "2048" represents for. It is a flag. But
    382
    means the size of this object.
    3. Then I log in to my website. This operation will insert more
    information into the session. I expect the cached session object
    should be bigger than 382
    4. But when I try to get the same session from memcached server,
    it
    still returns 382.
    Is that expected? Will MSM ignore some of the information in
    session
    when storing it to memcached server?
    Thanks.
    On Jun 2, 12:49 am, Martin Grotzke <martin.grot...@googlemail.com
    wrote:
    Is session information itself (without auth stuff) replicated
    correctly?
    What kind of authentication do you use? What's the version of
    tomcat
    and
    msm?
    Cheers,
    Martin
    Am 02.06.2012 09:24 schrieb "PhoneGaper" <yaowen...@gmail.com>:
    Just to clarify:
    There are two tomcats:
    <Engine name="Catalina" defaultHost="localhost"
    jvmRoute="tomcatA">
    <Engine name="Catalina" defaultHost="localhost"
    jvmRoute="tomcatB">
    On Jun 2, 12:23 am, PhoneGaper wrote:
    Hi,
    I have one apache 80 port, and two tomcat 8080 and 8081 port,
    I am
    using mod_proxy_ajp as the load balancer.
    I have setup the environment, but failover is not working.
    This test I have done is:
    1. Start tomcat1 only
    2. Login to my webapp through 80 port.
    3. Shutdown tomcat1 and start tomcat2
    4. Refresh my page, it asks me to login again.
    MSM config:
    <Manager
    className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
    memcachedNodes="n1:localhost:11211"
    sessionBackupAsync="false"
    requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
    transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFa
    ctory"/
    Tomcat:
    <Engine name="Catalina" defaultHost="localhost"
    jvmRoute="tomcatA/B">
    Apache:
    <VirtualHost *>
    ServerAdmin webmaster@localhost
    ServerNamewww.website.com
    DocumentRoot /somepath/www
    <Directory /somepath/www>
    Options MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>
    ErrorLog /var/log/error.log
    LogLevel warn
    CustomLog /var/log/access.log combined
    <Proxy balancer://tomcatservers>
    BalancerMember ajp://localhost:8109
    route=tomcatA
    retry=60
    BalancerMember ajp://localhost:8209
    route=tomcatB
    retry=60
    </Proxy>
    <Location />
    Allow From All
    ProxyPass balancer://tomcatservers/
    stickysession=JSESSIONID
    nofailover=off
    </Location>
    </VirtualHost>
    Can you tell me what I may have missed?
    Thanks a lot.
    --
    inoio gmbh
    Breitenfelder Str. 13c, 20251 Hamburg
    Amtsgericht Hamburg, HRB 123031
    Geschäftsführer: Dennis Brakhane, Martin Grotzke, Ole Langbehn
    signature.asc
    < 1KViewDownload

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmemcached-session-manager @
categoriesmemcached
postedJun 2, '12 at 7:23a
activeJun 3, '12 at 6:55a
posts12
users3
websitememcached.org

People

Translate

site design / logo © 2022 Grokbase