Quantcast
Channel: VMware Communities : All Content - vFabric GemFire [ARCHIVED]
Viewing all articles
Browse latest Browse all 990

GemFire Http Session Module using Client/Server mode

$
0
0

Hi,

 

I have a standalone 2 GemFire servers and 1 GemFire locator running separately in ports: Locator: 13489, GF-Server1: 13490 and GF-Server2:13491

and the below cache.xml in GemFire Server which also has the session region configured

 

<?xml version="1.0"?><!DOCTYPE cache PUBLIC      -//GemStone Systems, Inc.//GemFire Declarative Caching 7.0//EN     http://www.gemstone.com/dtd/cache7_0.dtd><cache lock-lease="120" lock-timeout="60" search-timeout="300" is-server="true" copy-on-read="false">     <cache-server bind-address="${address}" port="${port}"></cache-server>     <disk-store name="insuranceOFDS" allow-force-compaction="true" auto-compact="true"                     compaction-threshold="40" max-oplog-size="2048" queue-size="1000" time-interval="1000" write-buffer-size="65536">          <disk-dirs>               <disk-dir dir-size="3072">${GF_SERVER_DS_FOLDER}\insurance_ds</disk-dir>          </disk-dirs>     </disk-store>     <disk-store name="httpSessionDS" allow-force-compaction="true" auto-compact="true"                     compaction-threshold="40" max-oplog-size="2048" queue-size="1000" time-interval="1000" write-buffer-size="65536">          <disk-dirs>               <disk-dir dir-size="3072">${GF_SERVER_DS_FOLDER}\httpSession_ds</disk-dir>          </disk-dirs>     </disk-store>     <region-attributes id="defaultRegionAttr" refid="PARTITION_REDUNDANT_OVERFLOW" data-policy="partition" statistics-enabled="true" multicast-enabled="false" disk-store-name="insuranceOFDS" disk-synchronous="false">          <entry-time-to-live>               <expiration-attributes timeout="900" action="destroy"/>          </entry-time-to-live>          <partition-attributes redundant-copies="1" recovery-delay="10000" startup-recovery-delay="5000" total-num-buckets="113"></partition-attributes>          <subscription-attributes interest-policy="cache-content"/>          <eviction-attributes>               <lru-memory-size maximum="100" action="overflow-to-disk"/>          </eviction-attributes>     </region-attributes>      <region-attributes id="sessionAttr" refid="PARTITION_REDUNDANT_OVERFLOW" data-policy="partition" statistics-enabled="true"           multicast-enabled="false" disk-store-name="httpSessionDS" disk-synchronous="false">          <entry-time-to-live>               <expiration-attributes timeout="1800" action="destroy">                    <custom-expiry>                         <class-name>com.gemstone.gemfire.modules.util.SessionCustomExpiry</class-name>                    </custom-expiry>               </expiration-attributes>          </entry-time-to-live>          <partition-attributes redundant-copies="1" recovery-delay="10000" startup-recovery-delay="5000" total-num-buckets="113"></partition-attributes>          <subscription-attributes interest-policy="cache-content"/>          <eviction-attributes>               <lru-memory-size maximum="100" action="overflow-to-disk"/>          </eviction-attributes>     </region-attributes>     <!-- Customer region -->     <region name="customers" refid="defaultRegionAttr"/>             <!-- Policy region  -->     <region name="policies" refid="defaultRegionAttr"/>             <!-- Claims region  -->     <region name="claims" refid="defaultRegionAttr"/>             <!-- Payment region  -->     <region name="payments" refid="defaultRegionAttr"/>             <!-- http session object distributed region -->     <region name="gemfire_modules_sessions" refid="sessionAttr"/>     <resource-manager critical-heap-percentage="90" eviction-heap-percentage="80"/></cache>     

and I have created a tcServer instance with gemfire-cs module:

 

tcruntime-instance.bat create Server4 --version 6.0.35.A.RELEASE --layout separate 
--property base.shutdown.port=-1 --property base.jmx.port=6972 --property bio.http.port=8087 --property bio.https.port=8446 
--template base --template gemfire-cs --interactive 
Catalina.properties, I have disabled local cache
------------------------------------------------
gemfire-cs.enable.debug.listener=false
gemfire-cs.enable.gateway.replication=false
gemfire-cs.enable.local.cache=false
gemfire-cs.region.attributes.id=sessionAttr
gemfire-cs.region.name=gemfire_modules_sessions
gemfire-cs.cache.configuration.file=cache-client.xml
gemfire-cs.critical.heap.percentage=0.0
gemfire-cs.eviction.heap.percentage=80.0
gemfire-cs.log.file=gemfire_modules.log
gemfire-cs.statistic.archive.file=gemfire_modules.gfs
gemfire-cs.statistic.sampling.enabled=false

 

and in CONF\client-cache.xml inside CATALINA_BASE, i have below syntax which is pointing to standalone locator

 

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE client-cache PUBLIC-//GemStone Systems, Inc.//GemFire Declarative Caching 7.0//ENhttp://www.gemstone.com/dtd/cache7_0.dtd><client-cache>     <pool name="sessions" subscription-enabled="true">          <locator host="localhost" port="13489"/>     </pool></client-cache>

I have started both locator and gemfire server and when I start tcServer, tcServer throws an error that "gemfire_modules_sessions" region cannot be found.

 

I was of the opinion that tcServer will connect to standalone GemFire locator and look for the session region in server. Is my understanding correct if not, can any one explain how gemfire-cs module works, any code samples if one can post will also be helpful for everyone.

 

 



Viewing all articles
Browse latest Browse all 990

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>