One more thing to think about is PDX. If PDX types are in your architecture then there could be some other gotchas with type ids.
PDX type ids are generated on each distinct system. Those type ids are only guaranteed to be unique on for a given distributed system. So with more than one distributed system being accessed from a single client, there is a chance for collision on type ids in this type of architecture. Just one more thing to think about when building a system with 1 client and 2 or more distributed Geode clusters. If you are thinking about doing some kind of DR strategy for Geode only - you might want to think of it at a higher level - thinking global load balancer. Then use Geodes WAN to keep the two data centers in sync. The only hard part is for a given user session you would want to pin them to a datacenter - due to async nature of the WAN. Within a data center, data is replicated synchronously. PDX with WAN is totally safe since PDX was architected to work over WAN. Note: Geode cluster went down there is something really "bad" going on in that data center (bad == network || CPU || memory someone unplugged or didn't plug in a network cable fully || ..). Charlie On Mon, Apr 15, 2019 at 10:33 AM Claudiu Balciza <cbalc...@1wa.org> wrote: > This solves my problem đ > > I can easily work around the âsame region nameâ > > > > Thank you Charlie Black and Michael Stolz > > > > > > *Claudiu BalcĂźza* BSc > > Database Architect > Architecte de base de donnĂ©es > Arhitect Baze de Date > > > > *From:* Charlie Black <cbl...@pivotal.io> > *Sent:* Friday, April 12, 2019 17:07 > *To:* user@geode.apache.org > *Subject:* Re: can't connect to 2 different locators? > > > > The code to do what you are looking for is: > > > > ClientCache clientCache = *new *ClientCacheFactory().create(); > > PoolFactory poolFactory = PoolManager.*createFactory*(); > poolFactory.addLocator(*"systemALocator1"*, 10334); > poolFactory.addLocator(*"systemAlocator2"*, 10334); > poolFactory.create(*"systemA"*); > > poolFactory = PoolManager.*createFactory*(); > poolFactory.addLocator(*"systemBLocator1"*, 10334); > poolFactory.addLocator(*"systemBlocator2"*, 10334); > poolFactory.create(*"systemB"*); > > Region regionA = > clientCache.createClientRegionFactory(ClientRegionShortcut.*PROXY*) > .setPoolName(*"systemA"*) > .create(*"regionA"*); > > Region regionB = > clientCache.createClientRegionFactory(ClientRegionShortcut.*PROXY*) > .setPoolName(*"systemB"*) > > .create(*"regionB"*); > > > > One big gotcha is if systemA and systemB have the same region name the > client can only be using one systems region. If you are just using OQL > you will be fine - just use the pool to query. > > > > > https://geode.apache.org/releases/latest/javadoc/org/apache/geode/cache/client/Pool.html#getQueryService-- > > > > Charlie > > > > > > > > On Fri, Apr 12, 2019 at 4:32 PM Michael Stolz <mst...@pivotal.io> wrote: > > You will need to establish separate pools for the 2 clusters. Each pool > can talk to separate locators. > > > -- > Mike Stolz > Principal Engineer, GemFire Product Lead > Mobile: +1-631-835-4771 > > > > On Fri, Apr 12, 2019, 6:32 PM Jinmei Liao <jil...@pivotal.io> wrote: > > I believe multiple caches in one VM are not supported in Geode currently. > > > > On Fri, Apr 12, 2019, 3:23 PM Claudiu Balciza <cbalc...@1wa.org> wrote: > > I have 2 geode hosts (dev and test) and I was trying to sync 2 regions > > These 2 hosts are not supposed to communicate between them > > > > But when I try > > > > ClientCache cache1 = *new *ClientCacheFactory() > .addPoolLocator(*"host1.local"*, 2001) > .create() > > ClientCache cache2 = *new *ClientCacheFactory() > .addPoolLocator(*"host2.local"*, 2002) > .create() > > > > The first one works just fine, the second one throws: > > Caught: java.lang.IllegalStateException: Existing cache's default pool was > not compatible > > > > I could work around this by having one cache open at a time but Iâd like > to have them both open > > Any ideas? > > > > *Claudiu BalcĂźza* BSc > > Database Architect > Architecte de base de donnĂ©es > Arhitect Baze de Date > > > > > > > -- > > Charlie Black | cbl...@pivotal.io > -- Charlie Black | cbl...@pivotal.io