6 Replies Latest reply: Aug 1, 2009 9:54 AM by 619507 RSS

    Minimum configuration for localstorage=false nodes

    709368
      We have a grid that provides data for multiple clients. Considering that the client is started with localstorage=false, and all requests are passed to the data nodes, what is the minimum cache-configuration that is required by the clients to participate in the cluster.

      Edited by: tfanshteyn on Jul 31, 2009 6:54 AM
        • 1. Re: Minimum configuration for localstorage=false nodes
          619507
          Hi Timur,

          Typically you will use the same configuration file for both storage-enabled and storage-disabled nodes in the cluster. That ensures that the cache mappings are identical, and allows you to avoid maintaining two separate files.

          - Aleks
          • 2. Re: Minimum configuration for localstorage=false nodes
            709368
            I have a grid that provides 20 caches to 3 different clients. Each client uses only a subset of the caches. Each client is also developed and maintained by a different development group. If we need to keep the cache-config files in sync, we will, but it is becoming problematic , even during development stages.
            • 3. Re: Minimum configuration for localstorage=false nodes
              asrivast
              Hi Timur,
              Its not the cache name itself but the cache service which is important. If you have 20 caches and they are independent of each other based on their application then the respective client configuration can only have those cache services defined that processes that application specific caches. so storage-enabled will look like:

              <cache-name>Application1</cache-name>
              <scheme-name>app1-scheme</scheme-name>

              <cache-name>Application2</cache-name>
              <scheme-name>app2-scheme</scheme-name>
              ...

              <distributed-scheme>
              <scheme-name>app1-scheme</scheme-name>
              <service-name>App1</service-name>
              </distributed-scheme>

              <distributed-scheme>
              <scheme-name>app2-scheme</scheme-name>
              <service-name>App2</service-name>
              </distributed-scheme>
              ...


              And the localstorage=false for App1 can be like:

              <cache-name>App1</cache-name>
              <scheme-name>app1-scheme</scheme-name>
              ...
              <distributed-scheme>
              <scheme-name>app1-scheme</scheme-name>
              <service-name>App1</service-name>
              </distributed-scheme>

              As names of the service is extremely important make sure they are same.

              -Ashish
              • 4. Re: Minimum configuration for localstorage=false nodes
                709368
                My cache definition is a bit more complicated then this. It has definition of the backing map and store. it also defines the number of threads for the cache service. For some caches a cache scheme defines a local cache with a distributed cache as a backing map. Is all this supposed to exist on the client machine?

                Timur
                • 5. Re: Minimum configuration for localstorage=false nodes
                  asrivast
                  It is alright to have the following scheme defined in storage-enabled member:
                  <distributed-scheme>
                  <scheme-name>app-scheme-1</scheme-name>
                  <service-name>DistributedScheme1</service-name>
                  <backup-count>1</backup-count>
                  <backing-map-scheme>
                  <read-write-backing-map-scheme>
                  <internal-cache-scheme>
                  <local-scheme>
                  </local-scheme>
                  </internal-cache-scheme>
                  <cachestore-scheme>
                  <scheme-name>jdbc</scheme-name>
                  <class-scheme>
                  <class-name>misc.MyCacheStore</class-name>
                  </class-scheme>
                  </cachestore-scheme>
                  <write-delay-seconds>{delay 5}</write-delay-seconds>
                  </read-write-backing-map-scheme>
                  </backing-map-scheme>
                  <autostart>true</autostart>
                  </distributed-scheme>

                  and client (storage-disabled) with:

                  <distributed-scheme>
                  <scheme-name>app-scheme-1</scheme-name>
                  <service-name>DistributedScheme1</service-name>
                  <autostart>true</autostart>
                  </distributed-scheme>

                  But as Aleks has mentioned in the previous reply it is much easier to manage and distribute single cache configuration even though there a quite a few configs that can be different. Any "data" specific settings like CacheStore will only trigger where that Entry is, so on a localstorage=false nodes these settings are not required. But keep in mind as the applications grow managing multiple cache configurations can become quite problematic.
                  • 6. Re: Minimum configuration for localstorage=false nodes
                    619507
                    Hi Timur,

                    First off, unless you are using Extend there is no such thing as "clients" and "servers" in the cluster. All the nodes are equal peers, it's just that some also store partitioned data, and some don't (all nodes will store replicated data -- the "localstorage" option only applies to partitioned caches).

                    My personal preference is to maintain as few configuration files as possible. While what Ashish mentioned above will work, it just increases the number of files you have to keep in sync (as he pointed out as well). You will still have to maintain configuration file with all (and complete) cache definitions for your storage-enabled nodes, so I see no reason why you wouldn't use the same file for storage-disabled nodes as well.

                    Regards,
                    Aleks