You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@syncope.apache.org by Jordi Clement <jc...@dds.nl> on 2014/03/20 22:55:04 UTC

Question wrt syncope active / active HA setup

Hi, 

I've setup a MySQL database cluster with master master replication. I've deployed syncope in Tomcat 7 on 2 nodes. Each node points to the locally installed database. I've not yet setup Tomcat clustering but instead rely on the database synchronization for failover. I've configured the MySQL driver per suggestion on page [1].

Now I notice the following behavior: 

1. Create a role using the console on node 1
2. The role is removed from the database on both servers
3. The role shows up in the console on node 2 after a page refresh
4. Remove the role from the console on node 2
5. The role is removed from the database on both servers
6. Go to the console on node 1. The role is still there, even after a page reload.
7. Create a new role on node 1. The first role is removed.

I'm sure this has to do with caching. Now my question is: how can I configure syncope to show the correct behavior? Do I need to setup a Tomcat cluster, change the JDBC driver settings or maybe disable or configure caching in some way? I' like to setup loadbalancing and I'm not sure whether I won't run into problems with the setup as is.

kind regards,

J.

[1] https://cwiki.apache.org/confluence/display/SYNCOPE/Run+Syncope+in+real+environments

size of the ACT_GE_BYTEARRAY table

Posted by Rob van de Meulengraaf <ro...@finalist.com>.
Hi,

I have a question about the size of the ACT_GE_BYTEARRAY. This is getting quite large. For about 290k records in table SyncopeUsers there are about 2300k records in ACT_GE_BYTEARRAY with a filesize  of about 10 GB. It seems that is contains serialized data such as: 

| ?? sr %org.apache.syncope.common.mod.UserMod*??@??j\ L membershipsToBeAddedt Ljava/util/Set;L membershipsToBeRemovedq ~ Lpasswordt Ljava/lang/String;L pwdPropRequestt 3Lorg/apache/syncope/common/to/PropagationRequestTO;Lusernameq ~ xr 5org.apache.syncope.common.mod.AbstractAttributableMod,??+?)?^ 	J idL attributesToBeRemovedq ~ L attributesToBeUpdatedq ~ L derivedAttributesToBeAddedq ~ L derivedAttributesToBeRemovedq ~ L resourcesToBeAddedq ~ L resourcesToBeRemovedq ~ L virtualAttributesToBeRemovedq ~ L virtualAttributesToBeUpdatedq ~ xr *org.apache.syncope.common.AbstractBaseBean+J????"?  xp     ?'sr java.util.HashSet?D?????4  xpw

etc.

How can I prevent serialized data to be stored here or minimize it? Can I clean up data from this table?

Regards,
Rob


Finalist -  open IT oplossingen
Eindhoven - Maarssen - Rotterdam
www.finalist.nl


Re: Question wrt syncope active / active HA setup

Posted by Jordi Clement <jc...@dds.nl>.
Hi everyone, 

I've just configured Tomcat 7 clustering as well. I added the <distributable/> tag to the web.xml of both syncope and syncope-console and included <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> with the extended configuration as detailed under point 6. of the "impatient section" of [1] in the server.xml.

So both MySQL replication and Tomcat 7 clustering are active (which is probably conflicting?). The cluster is started but now numerous stacktraces like the one below show up in my catalina.out. I must be making a rookie mistake. What am I  missing?

kind regards.

J.

Mar 24, 2014 8:04:56 AM org.apache.catalina.ha.session.DeltaManager requestCompleted
SEVERE: Unable to serialize delta request for sessionid [D0F4730FAB4437A679D59A7C2371B3CE]
java.io.NotSerializableException: org.springframework.web.client.RestTemplate
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
	at org.apache.catalina.ha.session.DeltaRequest$AttributeInfo.writeExternal(DeltaRequest.java:392)
	at org.apache.catalina.ha.session.DeltaRequest.writeExternal(DeltaRequest.java:285)
	at org.apache.catalina.ha.session.DeltaRequest.serialize(DeltaRequest.java:299)
	at org.apache.catalina.ha.session.DeltaManager.serializeDeltaRequest(DeltaManager.java:621)
	at org.apache.catalina.ha.session.DeltaManager.requestCompleted(DeltaManager.java:1053)
	at org.apache.catalina.ha.session.DeltaManager.requestCompleted(DeltaManager.java:1018)
	at org.apache.catalina.ha.tcp.ReplicationValve.send(ReplicationValve.java:537)
	at org.apache.catalina.ha.tcp.ReplicationValve.sendMessage(ReplicationValve.java:524)
	at org.apache.catalina.ha.tcp.ReplicationValve.sendSessionReplicationMessage(ReplicationValve.java:506)
	at org.apache.catalina.ha.tcp.ReplicationValve.sendReplicationMessage(ReplicationValve.java:419)
	at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:343)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2441)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2430)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
	at java.lang.Thread.run(Thread.java:662)


[1] http://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html

On 20 mrt. 2014, at 22:55, Jordi Clement <jc...@dds.nl> wrote:

> Hi, 
> 
> I've setup a MySQL database cluster with master master replication. I've deployed syncope in Tomcat 7 on 2 nodes. Each node points to the locally installed database. I've not yet setup Tomcat clustering but instead rely on the database synchronization for failover. I've configured the MySQL driver per suggestion on page [1].
> 
> Now I notice the following behavior: 
> 
> 1. Create a role using the console on node 1
> 2. The role is removed from the database on both servers
> 3. The role shows up in the console on node 2 after a page refresh
> 4. Remove the role from the console on node 2
> 5. The role is removed from the database on both servers
> 6. Go to the console on node 1. The role is still there, even after a page reload.
> 7. Create a new role on node 1. The first role is removed.
> 
> I'm sure this has to do with caching. Now my question is: how can I configure syncope to show the correct behavior? Do I need to setup a Tomcat cluster, change the JDBC driver settings or maybe disable or configure caching in some way? I' like to setup loadbalancing and I'm not sure whether I won't run into problems with the setup as is.
> 
> kind regards,
> 
> J.
> 
> [1] https://cwiki.apache.org/confluence/display/SYNCOPE/Run+Syncope+in+real+environments


Re: Question wrt syncope active / active HA setup

Posted by Jordi Clement <jc...@dds.nl>.
Hi Guido,

I've changed the openjpa.RemoteCommitProvider config in the persistenceContextEMFactory.xml. That is all that is needed. Port 5636 (default) needs to be open for incoming requests from the other node(s).

      <entry key="openjpa.RemoteCommitProvider" value="tcp(Addresses=x.x.x.x;x.x.x.x)"/>

With database replication and now OpenJPA sorted, I should be fine. We don't need session replication. I do have an issue with that too by the way. Has to do with serialization. There's another thread for that one.

kind regards,

J.

On 26 mrt. 2014, at 08:38, Guido Wimmel <gu...@gmx.net> wrote:

Hi,

yes, if I understand the OpenJPA documentation correctly, the Remote Commit Provider Configuration is the way to replicate the cache.
I have no experience with such a configuration. It would also be interesting for me to know if such a setup works with Syncope.

However, I'd recommend doing some tests to see what the actual performance effect of the respective cache setup is
and if the performance effect justifies the additional complexity introduced by the cache replication.

Regards,
  Guido


Gesendet: Dienstag, 25. März 2014 um 14:01 Uhr
Von: "Jordi Clement" <jc...@dds.nl>
An: user@syncope.apache.org
Betreff: Re: Question wrt syncope active / active HA setup

Hi!

thanks for the reply. I guess disabling the cache comes with a performance penalty. So that would not necessarily be the way to go. I've found the TCP Remote Commit Provider Configuration in the OpenJPA documentation [1]. Is that the way to go? On that page it says "OpenJPA's data cache, for example, uses remote events to remain synchronized when deployed in multiple JVMs.". Anyone familiar with this solution?

kind regards,

Jordi

[1] http://openjpa.apache.org/builds/2.2.1/apache-openjpa/docs/ref_guide_event.html


On 24 mrt. 2014, at 16:28, Guido Wimmel <gu...@gmx.net> wrote:

Hi Jordi,

Syncope uses OpenJPA and enables OpenJPA Caching by default. Probably this is the reason for the described behaviour.

If so, you'd have to change the configuration in core/src/main/resources/persistenceContextEMFactory.xml by either
disabling caching or possibly replicating the cache (see [1]).

(If I'm right, maybe this could be worth a warning in [2]).

Best regards,
Guido

[1] http://openjpa.apache.org/builds/1.0.3/apache-openjpa-1.0.3/docs/manual/ref_guide_caching.html
[2] https://cwiki.apache.org/confluence/display/SYNCOPE/Setup+a+Syncope+cluster

Gesendet: Donnerstag, 20. März 2014 um 22:55 Uhr
Von: "Jordi Clement" <jc...@dds.nl>
An: user@syncope.apache.org
Betreff: Question wrt syncope active / active HA setup

Hi,

I've setup a MySQL database cluster with master master replication. I've deployed syncope in Tomcat 7 on 2 nodes. Each node points to the locally installed database. I've not yet setup Tomcat clustering but instead rely on the database synchronization for failover. I've configured the MySQL driver per suggestion on page [1].

Now I notice the following behavior:

1. Create a role using the console on node 1
2. The role is removed from the database on both servers
3. The role shows up in the console on node 2 after a page refresh
4. Remove the role from the console on node 2
5. The role is removed from the database on both servers
6. Go to the console on node 1. The role is still there, even after a page reload.
7. Create a new role on node 1. The first role is removed.

I'm sure this has to do with caching. Now my question is: how can I configure syncope to show the correct behavior? Do I need to setup a Tomcat cluster, change the JDBC driver settings or maybe disable or configure caching in some way? I' like to setup loadbalancing and I'm not sure whether I won't run into problems with the setup as is.

kind regards,

J.

[1] https://cwiki.apache.org/confluence/display/SYNCOPE/Run+Syncope+in+real+environments





Re: Question wrt syncope active / active HA setup

Posted by Guido Wimmel <gu...@gmx.net>.
Hi,

yes, if I understand the OpenJPA documentation correctly, the Remote Commit Provider Configuration is the way to replicate the cache.
I have no experience with such a configuration. It would also be interesting for me to know if such a setup works with Syncope.

However, I'd recommend doing some tests to see what the actual performance effect of the respective cache setup is
and if the performance effect justifies the additional complexity introduced by the cache replication.

Regards,
   Guido


> Gesendet: Dienstag, 25. März 2014 um 14:01 Uhr
> Von: "Jordi Clement" <jc...@dds.nl>
> An: user@syncope.apache.org
> Betreff: Re: Question wrt syncope active / active HA setup
>
> Hi!
> 
> thanks for the reply. I guess disabling the cache comes with a performance penalty. So that would not necessarily be the way to go. I've found the TCP Remote Commit Provider Configuration in the OpenJPA documentation [1]. Is that the way to go? On that page it says "OpenJPA's data cache, for example, uses remote events to remain synchronized when deployed in multiple JVMs.". Anyone familiar with this solution?
> 
> kind regards,
> 
> Jordi 
> 
> [1] http://openjpa.apache.org/builds/2.2.1/apache-openjpa/docs/ref_guide_event.html
> 
> 
> On 24 mrt. 2014, at 16:28, Guido Wimmel <gu...@gmx.net> wrote:
> 
> > Hi Jordi,
> > 
> > Syncope uses OpenJPA and enables OpenJPA Caching by default. Probably this is the reason for the described behaviour.
> > 
> > If so, you'd have to change the configuration in core/src/main/resources/persistenceContextEMFactory.xml by either
> > disabling caching or possibly replicating the cache (see [1]).
> > 
> > (If I'm right, maybe this could be worth a warning in [2]).
> > 
> > Best regards,
> >  Guido
> > 
> > [1] http://openjpa.apache.org/builds/1.0.3/apache-openjpa-1.0.3/docs/manual/ref_guide_caching.html
> > [2] https://cwiki.apache.org/confluence/display/SYNCOPE/Setup+a+Syncope+cluster
> > 
> >> Gesendet: Donnerstag, 20. März 2014 um 22:55 Uhr
> >> Von: "Jordi Clement" <jc...@dds.nl>
> >> An: user@syncope.apache.org
> >> Betreff: Question wrt syncope active / active HA setup
> >> 
> >> Hi, 
> >> 
> >> I've setup a MySQL database cluster with master master replication. I've deployed syncope in Tomcat 7 on 2 nodes. Each node points to the locally installed database. I've not yet setup Tomcat clustering but instead rely on the database synchronization for failover. I've configured the MySQL driver per suggestion on page [1].
> >> 
> >> Now I notice the following behavior: 
> >> 
> >> 1. Create a role using the console on node 1
> >> 2. The role is removed from the database on both servers
> >> 3. The role shows up in the console on node 2 after a page refresh
> >> 4. Remove the role from the console on node 2
> >> 5. The role is removed from the database on both servers
> >> 6. Go to the console on node 1. The role is still there, even after a page reload.
> >> 7. Create a new role on node 1. The first role is removed.
> >> 
> >> I'm sure this has to do with caching. Now my question is: how can I configure syncope to show the correct behavior? Do I need to setup a Tomcat cluster, change the JDBC driver settings or maybe disable or configure caching in some way? I' like to setup loadbalancing and I'm not sure whether I won't run into problems with the setup as is.
> >> 
> >> kind regards,
> >> 
> >> J.
> >> 
> >> [1] https://cwiki.apache.org/confluence/display/SYNCOPE/Run+Syncope+in+real+environments
> >> 
> 
>

Re: Question wrt syncope active / active HA setup

Posted by Jordi Clement <jc...@dds.nl>.
Hi!

thanks for the reply. I guess disabling the cache comes with a performance penalty. So that would not necessarily be the way to go. I've found the TCP Remote Commit Provider Configuration in the OpenJPA documentation [1]. Is that the way to go? On that page it says "OpenJPA's data cache, for example, uses remote events to remain synchronized when deployed in multiple JVMs.". Anyone familiar with this solution?

kind regards,

Jordi 

[1] http://openjpa.apache.org/builds/2.2.1/apache-openjpa/docs/ref_guide_event.html


On 24 mrt. 2014, at 16:28, Guido Wimmel <gu...@gmx.net> wrote:

> Hi Jordi,
> 
> Syncope uses OpenJPA and enables OpenJPA Caching by default. Probably this is the reason for the described behaviour.
> 
> If so, you'd have to change the configuration in core/src/main/resources/persistenceContextEMFactory.xml by either
> disabling caching or possibly replicating the cache (see [1]).
> 
> (If I'm right, maybe this could be worth a warning in [2]).
> 
> Best regards,
>  Guido
> 
> [1] http://openjpa.apache.org/builds/1.0.3/apache-openjpa-1.0.3/docs/manual/ref_guide_caching.html
> [2] https://cwiki.apache.org/confluence/display/SYNCOPE/Setup+a+Syncope+cluster
> 
>> Gesendet: Donnerstag, 20. März 2014 um 22:55 Uhr
>> Von: "Jordi Clement" <jc...@dds.nl>
>> An: user@syncope.apache.org
>> Betreff: Question wrt syncope active / active HA setup
>> 
>> Hi, 
>> 
>> I've setup a MySQL database cluster with master master replication. I've deployed syncope in Tomcat 7 on 2 nodes. Each node points to the locally installed database. I've not yet setup Tomcat clustering but instead rely on the database synchronization for failover. I've configured the MySQL driver per suggestion on page [1].
>> 
>> Now I notice the following behavior: 
>> 
>> 1. Create a role using the console on node 1
>> 2. The role is removed from the database on both servers
>> 3. The role shows up in the console on node 2 after a page refresh
>> 4. Remove the role from the console on node 2
>> 5. The role is removed from the database on both servers
>> 6. Go to the console on node 1. The role is still there, even after a page reload.
>> 7. Create a new role on node 1. The first role is removed.
>> 
>> I'm sure this has to do with caching. Now my question is: how can I configure syncope to show the correct behavior? Do I need to setup a Tomcat cluster, change the JDBC driver settings or maybe disable or configure caching in some way? I' like to setup loadbalancing and I'm not sure whether I won't run into problems with the setup as is.
>> 
>> kind regards,
>> 
>> J.
>> 
>> [1] https://cwiki.apache.org/confluence/display/SYNCOPE/Run+Syncope+in+real+environments
>> 


Aw: Question wrt syncope active / active HA setup

Posted by Guido Wimmel <gu...@gmx.net>.
Hi Jordi,

Syncope uses OpenJPA and enables OpenJPA Caching by default. Probably this is the reason for the described behaviour.

If so, you'd have to change the configuration in core/src/main/resources/persistenceContextEMFactory.xml by either
disabling caching or possibly replicating the cache (see [1]).

(If I'm right, maybe this could be worth a warning in [2]).

Best regards,
  Guido

[1] http://openjpa.apache.org/builds/1.0.3/apache-openjpa-1.0.3/docs/manual/ref_guide_caching.html
[2] https://cwiki.apache.org/confluence/display/SYNCOPE/Setup+a+Syncope+cluster

> Gesendet: Donnerstag, 20. März 2014 um 22:55 Uhr
> Von: "Jordi Clement" <jc...@dds.nl>
> An: user@syncope.apache.org
> Betreff: Question wrt syncope active / active HA setup
>
> Hi, 
> 
> I've setup a MySQL database cluster with master master replication. I've deployed syncope in Tomcat 7 on 2 nodes. Each node points to the locally installed database. I've not yet setup Tomcat clustering but instead rely on the database synchronization for failover. I've configured the MySQL driver per suggestion on page [1].
> 
> Now I notice the following behavior: 
> 
> 1. Create a role using the console on node 1
> 2. The role is removed from the database on both servers
> 3. The role shows up in the console on node 2 after a page refresh
> 4. Remove the role from the console on node 2
> 5. The role is removed from the database on both servers
> 6. Go to the console on node 1. The role is still there, even after a page reload.
> 7. Create a new role on node 1. The first role is removed.
> 
> I'm sure this has to do with caching. Now my question is: how can I configure syncope to show the correct behavior? Do I need to setup a Tomcat cluster, change the JDBC driver settings or maybe disable or configure caching in some way? I' like to setup loadbalancing and I'm not sure whether I won't run into problems with the setup as is.
> 
> kind regards,
> 
> J.
> 
> [1] https://cwiki.apache.org/confluence/display/SYNCOPE/Run+Syncope+in+real+environments
>