Topic
18 replies Latest Post - ‏2012-11-13T20:54:40Z by SystemAdmin
SystemAdmin
SystemAdmin
1485 Posts
ACCEPTED ANSWER

Pinned topic WXS - WLP : Http Session Storage

‏2012-10-10T08:59:01Z |
Dear All,

I am trying to configure two WebSphere Liberty Profile instances to share the same WXS server for HTTP Session storage.

Official documentation is at
http://pic.dhe.ibm.com/infocenter/wxsinfo/v8r5/index.jsp?topic=%2Fcom.ibm.websphere.extremescale.doc%2Ftxsconfiglibertysess.html
but it is very minimalist, it just says to add the xs web feature, which is not enough

I am nowhere trying to run WXS EMBEDDED to WLP

In REMOTE mode, using WXS configuration sample, I have some results but incorrect.

My web sample app just increments a counter ... the two instances of my web app does not share the HTTP session - each web app has its own counter value :-(

Here is my config

<server description="new server">

<!-- Enable features -->
<featureManager>
<feature>jsp-2.2</feature>
<feature>localConnector-1.0</feature>
<feature>eXtremeScale.web-1.0</feature>
</featureManager>

<httpEndpoint host="localhost" httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>

<applicationMonitor updateTrigger="mbean"/>

<logging consoleLogLevel="INFO"/>

<application id="TestREST" location="TestREST.war" name="TestREST" type="war"/>
<xsWebApp
objectGridType="REMOTE"
catalogHostPort="localhost:2809"
securityEnabled="true"
reuseSessionId="true"/>

<httpSession idReuse="true"/>
</server>

Any help ?

Thanks

Seb
Updated on 2012-11-13T20:54:40Z at 2012-11-13T20:54:40Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1485 Posts
    ACCEPTED ANSWER

    Re: WXS - WLP : Http Session Storage

    ‏2012-10-10T18:40:56Z  in response to SystemAdmin
    Here is a working config, running WXS in the same JVM as Liberty.
    (To use an external WXS, just remove the eXtremeScale-server-1.0 feature and the <xsServer> element)

    <server description="new server">

    <!-- Enable features -->
    <featureManager>
    <feature>jsp-2.2</feature>
    <feature>localConnector-1.0</feature>
    <feature>eXtremeScale.server-1.0</feature>
    <feature>eXtremeScale.web-1.0</feature>
    </featureManager>

    <httpEndpoint host="localhost" httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>

    <applicationMonitor updateTrigger="mbean"/>

    <logging consoleLogLevel="INFO"/>

    <xsServer isCatalog="true" serverName="server1" />

    <xsWebApp
    objectGridType="REMOTE"
    catalogHostPort="localhost:2809"
    securityEnabled="true"
    reuseSessionId="true"
    replicationInterval="0"
    sessionTableSize="0"
    />

    <httpSession idReuse="true"/>
  • SystemAdmin
    SystemAdmin
    1485 Posts
    ACCEPTED ANSWER

    Re: WXS - WLP : Http Session Storage

    ‏2012-10-12T10:00:33Z  in response to SystemAdmin
    Hello Seb,

    I am trying to the same test, but I got an exception "CWWSM0004E: Caught a datagrid exception com.ibm.websphere.objectgrid.ObjectGridRuntimeException: The catalog server did not contain an ObjectGridDeployment matching the name session when performing a Datagrid operation."

    The attachment is my detailed configuration, May I get your suggestion about the configuration?
    • SystemAdmin
      SystemAdmin
      1485 Posts
      ACCEPTED ANSWER

      Re: WXS - WLP : Http Session Storage

      ‏2012-10-12T10:10:40Z  in response to SystemAdmin
      Yes, you will need to configure the grid to tell the type of partition you'll need to create. This has to be aligned with the Session Manager settings in WLP.
      To do that, just perform the following step:

      Copy the two attached files to <WLP_HOME>/usr/servers/<YOUR SERVER NAME>/grids directory

      (you can create the grid directory if it does not exists)

      Notice that if you are using a WXS instance outside of WLP runtime (stand alone WXS), you will also need to add sessionobjectgrid.jar file in WXS' classpath, as it is not added by default (will be fixed in next version)

      Hope this helps

      Seb
  • SystemAdmin
    SystemAdmin
    1485 Posts
    ACCEPTED ANSWER

    Re: WXS - WLP : Http Session Storage

    ‏2012-10-14T13:56:38Z  in response to SystemAdmin
    As promised, I sullarized the configuration step in a blog post.

    http://www.stormacq.com/websphere-liberty-profile-cluster-sharing-an-in-memory-data-grid/

    Do not hesitate to mention errors / typos if any

    Seb
    • SystemAdmin
      SystemAdmin
      1485 Posts
      ACCEPTED ANSWER

      Re: WXS - WLP : Http Session Storage

      ‏2012-10-15T10:23:34Z  in response to SystemAdmin
      Hello Seb,

      Many thanks for your quick response. Following the steps, the error fixed.
      But I still have another issue. In your "WebSphere Liberty Profile Cluster Sharing an In-Memory Data Grid" blog, if I want run the second Liberty profile server on the other machine(eg. Machine B). How do I configure the WXS on the Machine B? Many thanks!

      Have a nice day!
      • SystemAdmin
        SystemAdmin
        1485 Posts
        ACCEPTED ANSWER

        Re: WXS - WLP : Http Session Storage

        ‏2012-10-15T13:35:35Z  in response to SystemAdmin
        Here is my config for Server TWO

        <server description="Server_TWO">

        <!-- Enable features -->
        <featureManager>
        <feature>jsp-2.2</feature>
        <feature>localConnector-1.0</feature>
        <feature>eXtremeScale.server-1.0</feature>
        <feature>eXtremeScale.web-1.0</feature>
        </featureManager>

        <httpEndpoint host="localhost" httpPort="9081" httpsPort="9444" id="defaultHttpEndpoint"/>

        <applicationMonitor updateTrigger="mbean"/>

        <logging consoleLogLevel="INFO"/>

        <xsServer isCatalog="false" serverName="XS_Server_TWO"/>

        <xsWebApp catalogHostPort="localhost:2809"
        objectGridType="REMOTE"
        replicationInterval="0"
        reuseSessionId="true"
        securityEnabled="true"
        sessionTableSize="0"/>

        <httpSession idReuse="true"/>
    • SystemAdmin
      SystemAdmin
      1485 Posts
      ACCEPTED ANSWER

      Re: WXS - WLP : Http Session Storage

      ‏2012-10-15T12:21:29Z  in response to SystemAdmin
      I also added a IBM HTTP Server and plug-in to forward the request. Test001 and Test002 are stated. I can access the app(test) on Test001 using url(http://localhost/test/), but I can not access the app on Test002 using when I stop app(test) on Test001.
      I think I can access the app if one of the two the apps on Test001 and Test002 is started if the configuration is correct. But I am not sure where the configuration is not correct, could you help check it again?

      The attachment is the detailed configuration files.

      Machine A(9.115.75.85):
      IBM HTTP Server and plug in
      Liberty profile server1(Test001) with app(test), eXtreme Scale
      machine B(9.111.97.74):
      Liberty profile server2(Test002) with app(test)
      • SystemAdmin
        SystemAdmin
        1485 Posts
        ACCEPTED ANSWER

        Re: WXS - WLP : Http Session Storage

        ‏2012-10-15T13:39:48Z  in response to SystemAdmin
        Using this configuration : it is normal that things stop working when ServerONE is down.
        Because WXS runs inside the Liberty server JVM and because I choose to configure only one WXS Catalog Server (isCatalog="yes" in ServerONE)

        To have true HA, we should add a WXS Catalog Server on ServerTWO has well ... I haven't looked at WXS config for HA yet ... I am not sure about the requirements / consequences of having two Catalog Server.

        In my config, where everything runs on a single VM, there is at least on config change for Catalog Server 2 : change the TCP Port to avoid conflict

        Seb
        • SystemAdmin
          SystemAdmin
          1485 Posts
          ACCEPTED ANSWER

          Re: WXS - WLP : Http Session Storage

          ‏2012-10-16T14:24:46Z  in response to SystemAdmin
          Hello Seb,

          Thanks for your reply.
          I tried to search some info about WXS config for HA, but found nothing. So I tried to search Liberty config for HA. Only get one, but it is in Chinese. It using DB to store the http session.

          It will add these config in the server.xml file:
          <feature>sessionDatabase-1.0</feature>
          <dataSource id="SessionDS" jdbcDriverRef="myJDBCdriver"
          jndiName="jdbc/session" transactional="true">
          <properties databaseName="sessions" driverType="4"
          password="was70ptf" portNumber="50001" serverName="wasbld13.cn.ibm.com"
          user="db2inst1"/>
          </dataSource>

          <httpSessionDatabase id="SessionDB" dataSourceRef="SessionDS"/>
          <httpSession storageRef="SessionDB" cloneId="${cloneId}"/>

          I think XS can store the http session in the memory to take the role of DB. Is it right?
          To simplify the test, I only using one machine. IHS(with plug in), Liberty profile server(Test001 and Test003) and XS are in the same machine. I also deployed the test App(just a jsp file you mentioned in your blog) on the two servers.

          Here is my detailed steps for this test:
          1. Start server Test001 with test App. Here is the server.xml for Test001
          <server description="Server1">
          <!-- Enable features -->
          <featureManager>
          <feature>jsp-2.2</feature>
          <feature>localConnector-1.0</feature>
          <feature>eXtremeScale.web-1.0</feature>
          <feature>eXtremeScale.server-1.0</feature>
          </featureManager>
          <httpEndpoint host="*" httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>
          <httpSession cloneId="Server1CloneID"/>
          <!-- Configuration for XS Server -->
          <xsServer isCatalog="true" serverName="XS_Server"/>
          <!-- Configuration for Web Application XS HTTP Session data storage -->
          <xsWebApp catalogHostPort="localhost:2809" objectGridType="REMOTE" replicationInterval="0" reuseSessionId="true" securityEnabled="true" sessionTableSize="0"/>
          <applicationMonitor updateTrigger="mbean"/>
          <application id="test" location="test.war" name="test" type="war"/>
          <httpSession idReuse="true"/>
          </server>

          2. Start server Test003 with test App. Here is the server.xml for Test003
          <server description="Server3">
          <!-- Enable features -->
          <featureManager>
          <feature>jsp-2.2</feature>
          <feature>localConnector-1.0</feature>
          <feature>eXtremeScale.server-1.0</feature>
          <feature>eXtremeScale.web-1.0</feature>
          </featureManager>
          <httpEndpoint host="*" httpPort="9081" httpsPort="9443" id="defaultHttpEndpoint"/>
          <httpSession cloneId="Server1CloneID"/>
          <!-- Configuration for XS Server -->
          <xsServer isCatalog="false" serverName="XS_Server_2"/>
          <!-- Configuration for Web Application XS HTTP Session data storage -->
          <xsWebApp catalogHostPort="localhost:2809" objectGridType="REMOTE" replicationInterval="0" reuseSessionId="true" securityEnabled="true" sessionTableSize="0"/>
          <applicationMonitor updateTrigger="mbean"/>
          <application id="test" location="test.war" name="test" type="war"/>
          <httpSession idReuse="true"/>
          </server>

          3. Start IBM http server, here is the plugin-cfg.xml file:
          <?xml version="1.0" encoding="UTF-8"?>
          <!-- This config file was generated by plugin's merge tool v1.0.0.2 on 2012.10.16 at 16:03:42 CST -->
          <Config ASDisableNagle="false" AcceptAllContent="false"
          AppServerPortPreference="HostHeader" ChunkedResponse="false"
          FIPSEnable="false" IISDisableNagle="false" IISPluginPriority="High"
          IgnoreDNSFailures="false" RefreshInterval="60"
          ResponseChunkSize="64" SSLConsolidate="false"
          SSLPKCSDriver="REPLACE" SSLPKCSPassword="REPLACE"
          TrustedProxyEnable="false" VHostMatchingCompat="false">
          <Log LogLevel="Error" Name=".\logs\defaultServer\http_plugin.log"/>
          <Property Name="ESIEnable" Value="true"/>
          <Property Name="ESIMaxCacheSize" Value="1024"/>
          <Property Name="ESIInvalidationMonitor" Value="false"/>
          <Property Name="ESIEnableToPassCookies" Value="false"/>
          <Property Name="PluginInstallRoot" Value="."/>
          <!-- Server Clusters -->
          <ServerCluster CloneSeparatorChange="false" GetDWLMTable="false"
          IgnoreAffinityRequests="true" LoadBalance="Round Robin"
          Name="Shared_2_Cluster_0" PostBufferSize="64" PostSizeLimit="-1"
          RemoveSpecialHeaders="true" RetryInterval="60">
          <Server CloneID="Server3CloneID"
          ConnectTimeout="0" ExtendedHandshake="false"
          MaxConnections="-1" Name="Server3"
          ServerIOTimeout="900" WaitForContinue="false">
          <Transport Hostname="9.115.75.85" Port="9081" Protocol="http"/>
          </Server>
          <Server CloneID="Server1CloneID"
          ConnectTimeout="0" ExtendedHandshake="false"
          MaxConnections="-1" Name="Server1"
          ServerIOTimeout="900" WaitForContinue="false">
          <Transport Hostname="9.115.75.85" Port="9080" Protocol="http"/>
          </Server>
          <PrimaryServers>
          <Server Name="Server1"/>
          <Server Name="Server3"/>
          </PrimaryServers>
          </ServerCluster>
          <!-- Virtual Host Groups -->
          <VirtualHostGroup Name="/cell/sharedCell_2/vHostGroup/shared_host_0">
          <VirtualHost Name="*:443"/>
          <VirtualHost Name="*:80"/>
          <VirtualHost Name="*:9080"/>
          <VirtualHost Name="*:9081"/>
          </VirtualHostGroup>
          <!-- URI Groups -->
          <UriGroup Name="/cell/sharedCell_2/application/default_host_defaultServer_default_node_Cluster_URIs">
          <Uri AffinityCookie="JSESSIONID"
          AffinityURLIdentifier="jsessionid" Name="/test/*"/>
          </UriGroup>
          <!-- Routes -->
          <Route ServerCluster="Shared_2_Cluster_0"
          UriGroup="/cell/sharedCell_2/application/default_host_defaultServer_default_node_Cluster_URIs" VirtualHostGroup="/cell/sharedCell_2/vHostGroup/shared_host_0"/>
          </Config>

          And I also add these strings in httpd.conf file:
          LoadModule was_ap22_module "C:\Program Files (x86)\IBM\WebSphere\Plugins\bin\32bits\mod_was_ap22_http.dll"
          WebSpherePluginConfig "C:\Program Files (x86)\IBM\HTTPServer\conf\plugin-cfg.xml"

          4. Access the test app using url: http://localhost/test/ Then I get the panel like this:
          Liberty Profile - eXtreme Scale HTTP Session Demo!
          This counter is increased each time the page is loaded. Its value is stored in the HttpSession
          Counter = 1
          Page server by cluster instance : Test001

          Page generated at = Tue Oct 16 22:17:14 CST 2012
          5. Then I stop the application, Just stop the app on the server Test001, do NOT stop the server. Then tried to access the test app using url: http://localhost/test/. I thought I should get the panel with Counter = 2 and Page server by cluster instance : Test003. But did not. Just got "404 Not found".

          I am not sure why the IBM http server did not forward the request to the App on Test003 when I stopped the App on Test001(just stop the App, did Not stop the server). Do you have any experience on this? Or any other suggestion for this test? Thanks in advance!
          Have a nice day!
  • SystemAdmin
    SystemAdmin
    1485 Posts
    ACCEPTED ANSWER

    Re: WXS - WLP : Http Session Storage

    ‏2012-10-16T14:36:17Z  in response to SystemAdmin
    Yes, eXtreme Scale can be used as a "database" to store HTTP Session.
    I have no previous experience with HTTP plugin - can not help with that.

    eXtreme Scale HA documentation
    http://publib.boulder.ibm.com/infocenter/wxsinfo/v7r1/index.jsp?topic=%2Fcom.ibm.websphere.extremescale.over.doc%2Fcxsavail.html

    in particular, the Catalog Service
    http://publib.boulder.ibm.com/infocenter/wxsinfo/v7r1/index.jsp?topic=%2Fcom.ibm.websphere.extremescale.over.doc%2Fcxscatclus.html

    Seb
    • joshuad
      joshuad
      38 Posts
      ACCEPTED ANSWER

      Re: WXS - WLP : Http Session Storage

      ‏2012-10-16T18:05:05Z  in response to SystemAdmin
      I see a couple of issues with your configuration:

      1 - The server clone IDs are both set to Server1CloneID. You should have a unique clone ID for each liberty JVM, and the IHS config should reflect that.

      2 - If that still doesn't work for you, try killing an entire liberty JVM. In order to do this, you need to have a catalog server running in both liberty JVMs. You will need to add the following property to the xsServer tag in both liberty JVMs:

      catalogClusterEndpoints="XS_Server:localhost:6600:6601,XS_Server2_2:localhost:6602:6603"

      Make sure both xsServer tags contain a unique listener port for each catalog server:

      listenerPort="2809" and listenerPort="2810"
      Finally in your xsWebApp tag, your catalogHostPort should now reflect both catalog servers:

      catalogHostPort="localhost:2809,localhost:2810"
      • SystemAdmin
        SystemAdmin
        1485 Posts
        ACCEPTED ANSWER

        Re: WXS - WLP : Http Session Storage

        ‏2012-10-17T07:43:59Z  in response to joshuad
        Hello,

        As you mentioned. I updated the clone IDs, now they are matching. But I can not start the servers with the WARNING and ERROR listed below. May I get your suggestion about the detailed configuration?
        ERROR CWOBJ1891E: All servers are not available in replication group -1.
        WARNING CWOBJ2002W: No available routing table for this replication group 1.
        WARNING CWOBJ1668W: A client is making a request to a server that has not completed starting.

        Here is my detail config:

        Machine A(9.115.75.85):

        IBM HTTP Server and Plugin, the config file is here.
        <?xml version="1.0" encoding="UTF-8"?>
        <!-- This config file was generated by plugin's merge tool v1.0.0.2 on 2012.10.16 at 16:03:42 CST -->
        <Config ASDisableNagle="false" AcceptAllContent="false"
        AppServerPortPreference="HostHeader" ChunkedResponse="false"
        FIPSEnable="false" IISDisableNagle="false" IISPluginPriority="High"
        IgnoreDNSFailures="false" RefreshInterval="60"
        ResponseChunkSize="64" SSLConsolidate="false"
        SSLPKCSDriver="REPLACE" SSLPKCSPassword="REPLACE"
        TrustedProxyEnable="false" VHostMatchingCompat="false">
        <Log LogLevel="Error" Name=".\logs\defaultServer\http_plugin.log"/>
        <Property Name="ESIEnable" Value="true"/>
        <Property Name="ESIMaxCacheSize" Value="1024"/>
        <Property Name="ESIInvalidationMonitor" Value="false"/>
        <Property Name="ESIEnableToPassCookies" Value="false"/>
        <Property Name="PluginInstallRoot" Value="."/>
        <!-- Server Clusters -->
        <ServerCluster CloneSeparatorChange="false" GetDWLMTable="false"
        IgnoreAffinityRequests="true" LoadBalance="Round Robin"
        Name="Shared_2_Cluster_0" PostBufferSize="64" PostSizeLimit="-1"
        RemoveSpecialHeaders="true" RetryInterval="60">
        <Server CloneID="Server2CloneID"
        ConnectTimeout="0" ExtendedHandshake="false"
        MaxConnections="-1" Name="Server2"
        ServerIOTimeout="900" WaitForContinue="false">
        <Transport Hostname="9.111.97.74" Port="9080" Protocol="http"/>
        </Server>
        <Server CloneID="Server1CloneID"
        ConnectTimeout="0" ExtendedHandshake="false"
        MaxConnections="-1" Name="Server1"
        ServerIOTimeout="900" WaitForContinue="false">
        <Transport Hostname="9.115.75.85" Port="9080" Protocol="http"/>
        </Server>
        <PrimaryServers>
        <Server Name="Server1"/>
        <Server Name="Server2"/>
        </PrimaryServers>
        </ServerCluster>
        <!-- Virtual Host Groups -->
        <VirtualHostGroup Name="/cell/sharedCell_2/vHostGroup/shared_host_0">
        <VirtualHost Name="*:443"/>
        <VirtualHost Name="*:80"/>
        <VirtualHost Name="*:9080"/>
        <VirtualHost Name="*:9081"/>
        </VirtualHostGroup>
        <!-- URI Groups -->
        <UriGroup Name="/cell/sharedCell_2/application/default_host_defaultServer_default_node_Cluster_URIs">
        <Uri AffinityCookie="JSESSIONID"
        AffinityURLIdentifier="jsessionid" Name="/test/*"/>
        </UriGroup>
        <!-- Routes -->
        <Route ServerCluster="Shared_2_Cluster_0"
        UriGroup="/cell/sharedCell_2/application/default_host_defaultServer_default_node_Cluster_URIs" VirtualHostGroup="/cell/sharedCell_2/vHostGroup/shared_host_0"/>
        </Config>

        Liberty profile server(Test001) with XS and test App(test)
        Here is the server.xml file for Test001:
        <server description="Server1">
        <!-- Enable features -->
        <featureManager>
        <feature>jsp-2.2</feature>
        <feature>localConnector-1.0</feature>
        <feature>eXtremeScale.web-1.0</feature>
        <feature>eXtremeScale.server-1.0</feature>
        </featureManager>
        <httpEndpoint host="*" httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint">
        <tcpOptions soReuseAddr="true" />
        </httpEndpoint>
        <httpSession cloneId="Server1CloneID"/>
        <!-- Configuration for XS Server -->
        <xsServer isCatalog="true" serverName="XS_Server" listenerPort="2809" catalogClusterEndpoints="XS_Server:9.115.75.85:6600:6601,XS_Server_2:9.111.97.74:6602:6603"/>
        <!-- Configuration for Web Application XS HTTP Session data storage -->
        <xsWebApp catalogHostPort="9.115.75.85:2809,9.111.97.74:2810" objectGridType="REMOTE" replicationInterval="0" reuseSessionId="true" securityEnabled="true" sessionTableSize="0"/>
        <applicationMonitor updateTrigger="mbean"/>
        <application id="test" location="test.war" name="test" type="war"/>
        <httpSession idReuse="true"/>
        </server>

        And the bootstrap.properties:
        com.ibm.ws.xs.server.listenerPort=2809

        Machine B(9.111.97.74)
        Liberty profile server(Test002) with XS and test APP(test)
        Here is the server.xml file for Test002:
        <server description="Server2">
        <!-- Enable features -->
        <featureManager>
        <feature>jsp-2.2</feature>
        <feature>localConnector-1.0</feature>
        <feature>eXtremeScale.web-1.0</feature>
        <feature>eXtremeScale.server-1.0</feature>
        </featureManager>
        <httpEndpoint host="*" httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>
        <xsServer isCatalog="true" serverName="XS_Server_2" listenerPort="2810" catalogClusterEndpoints="XS_Server:9.115.75.85:6600:6601,XS_Server_2:9.111.97.74:6602:6603"/>
        <!-- Configuration for Web Application XS HTTP Session data storage -->
        <xsWebApp catalogHostPort="9.111.97.74:2810,9.115.75.85:2809" objectGridType="REMOTE" replicationInterval="0" reuseSessionId="true" securityEnabled="true" sessionTableSize="0"/>
        <applicationMonitor updateTrigger="mbean"/>
        <httpSession cloneId="Server2CloneID"/>
        <httpSession idReuse="true"/>
        <application id="test" location="test.war" name="test" type="war"/>
        </server>

        And the bootstrap.properties:
        com.ibm.ws.xs.server.listenerPort=2810
      • SystemAdmin
        SystemAdmin
        1485 Posts
        ACCEPTED ANSWER

        Re: WXS - WLP : Http Session Storage

        ‏2012-10-17T10:15:26Z  in response to joshuad
        And if I delete this string "catalogClusterEndpoints="XS_Server:9.115.75.85:6600:6601,XS_Server_2:9.111.97.74:6602:6603"" from the server.xml file. the server can start. but the session can not store in the memory when one of the servers down. I think I need configure the mapping files or something else. But I am not sure how. Could you give me a detailed configuration about the mapping files to make the catalog servers in the same cluster? Thank you in advance!
        • SystemAdmin
          SystemAdmin
          1485 Posts
          ACCEPTED ANSWER

          Re: WXS - WLP : Http Session Storage

          ‏2012-11-09T08:49:25Z  in response to SystemAdmin
          Hi Guys,
          1)
          I try to follow your steps to configure the working HA that consists of 3 servers -
          2 XS containers on LP:
          _wxs__1
          _wxs__2
          and 1 additional LP used as catalog:
          _wxscatalog_2
          I attached my configuration files.

          I run all of the LP's on local ubuntu.
          And the test application is the one with the counter :)

          I tried to test it - opened from one browser 2 servers (ports 9090 and 9091) and refreshed the page with counter several times.
          Both of them are adding the common value - when I increment counter on 9090 to value of 10, and refresh the 9091 page I see the "11". Next I increment on 9091 9-10 times and see on 9090 the "21". So I guess they are using the value stored in shared session memory. Am I right?

          Then I stop _wxs__1 (9090). The counter on _wxs__2 is adding to the last value of counter.
          But After I start _wxs__1 the value of counter is again "1" - the initial value.

          Do you know what is wrong in my configuration? I expected that the _wxs__1 will synchronize with living container in _wxs__2 and the value of the counter will remain the last seen in browser.
          I tried to set up the property of catalogServiceEndPoints to "XS__wxscatalog_2:127.0.0.1:6600:6601:2810" but I got error message that bootstrap cannot be found on 2810.

          2)
          When I tried to use only two servers, _wxs__1 and _wxs__2 and configured them both to run both container and catalog:
          accordingly:
          ...
          <xsServer isCatalog="true" serverName="XS__wxs__1" listenerPort="2810" jMXServicePort="9910" catalogServiceEndPoints="XS__wxs__1:127.0.0.1:6600:6601:2810,XS__wxs__2:127.0.0.1:6602:6603:2811" />
          ...

          ...
          <xsServer isCatalog="true" serverName="XS__wxs__2" listenerPort="2811" jMXServicePort="9911" catalogServiceEndPoints="XS__wxs__1:127.0.0.1:6600:6601:2810,XS__wxs__2:127.0.0.1:6602:6603:2811" />
          ...
          and configuration for both in xsWebApp:
          ...
          catalogHostPort="localhost:2810,localhost:2811"
          ...
          but did not succeed:/
          Did you run such configuration successfully?
          • andymc_
            andymc_
            16 Posts
            ACCEPTED ANSWER

            Re: WXS - WLP : Http Session Storage

            ‏2012-11-09T16:01:53Z  in response to SystemAdmin
            Hi Michal,

            I would not recommend that scenario in a production environment. In this case, you are co-locating your web application with the grid container data. The best practice is to separate these into separate JVM processes. As a result of this environment, I think you getting expected results.

            For example, your deployment.xml sets developmentMode="false" and no synchronous replicas. This means that the grid data will only be placed once per physical host with no replicas - so when you kill one of the servers, it could be the only copy of the session data.

            Here are a few suggestions:
            1) Modify the deployment policy to use developmentMode and configure minSyncReplicas="1" and maxSyncReplicas="1" - this will force the session data to be replicated (even on the same local host) so that the data will be preserved if a grid container server is stopped.
            2) You may want to split the containers into separate processes from the web application servers - for a total of 5 processes: 1 catalog server, 2 web app servers, and 2 container servers. This will give you a more realistic production-like environment, where you can experiment will different failover scenarios - like failing a container server to ensure that data is not lost and failing a web app server to ensure that sessions in one web app server can be successfully looked up from the other web app server.

            Hope this helps,
            Andy
  • SystemAdmin
    SystemAdmin
    1485 Posts
    ACCEPTED ANSWER

    Re: WXS - WLP : Http Session Storage

    ‏2012-11-12T22:45:36Z  in response to SystemAdmin
    Andy,
    thank you very much, I followed your tips and the configuration 2x Web server + 2x Catalog service + 2x Container servers, all of them on WLP works fine. I terminated one of each servers and the counter still increments the shared value.

    Interesting thing that I observed - when I suspended all of catalog servers - there were no failure from the web server perspective.
    The value is still correctly incremented, although there are FFDC files in Container logs saying Connection refused (to the Catalog Service).
    Do you know what is the mechanism of such behavior? AS far as I know the Catalog Service is responsible for finding the right primary replica for searched portion of data.

    Anyway, thanks!
    • jhanders
      jhanders
      234 Posts
      ACCEPTED ANSWER

      Re: WXS - WLP : Http Session Storage

      ‏2012-11-12T22:50:39Z  in response to SystemAdmin
      The catalog server has the authoritative view of the route table (primaries and replicas). The client downloads it and uses it. Once the client has the route table it is cached and only will need to be updated if something changes. If you suspend the catalog servers for a period of time the client will continue to work until there is a change in the containers, i.e. container servers are killed.

      I hope that answers your question.

      Jared Anderson
      • SystemAdmin
        SystemAdmin
        1485 Posts
        ACCEPTED ANSWER

        Re: WXS - WLP : Http Session Storage

        ‏2012-11-13T20:54:40Z  in response to jhanders
        Yes, now everything is clear.
        After I killed both Catalog Servers and then one of Containers the behavior was as you described.

        Thanks!