cancel
Showing results for 
Search instead for 
Did you mean: 

Clustering with Alfresco Community 5.0.d

prachi379
Champ on-the-rise
Champ on-the-rise
Since clustering is not supported for alfresco community, we have tried to implement our own clustering solution. We have 2 alfresco servers, both have community 5.0.a installed and a load balancer distributes the traffic between these two servers. Both the servers speak to the same database and share a single contentshare/contentshare.deleted repository and this system has been in use for over a year. Now I am trying to replicate the cache on the cluster and I have read that alfresco uses ehcache. So I have created /opt/alfresco-5.0.d/tomcat/shared/classes/alfresco/extension/ehcache-custom.xml and followed steps from this page - http://docs.alfresco.com/4.0/tasks/jgroups-repo.html

My alfresco-global.properties on 'server1' has the below lines -
# Ehcache Settings
alfresco.cluster.name=cluster1
index.recovery.mode = AUTO
alfresco.ehcache.rmi.hostname=server2@domain
alfresco.rmi.services.external.host=server2@domain
alfresco.ehcache.rmi.port=40001
alfresco.ehcache.rmi.remoteObjectPort=45001

and on 'server2' -
# Ehcache Settings
alfresco.cluster.name=cluster1
index.recovery.mode = AUTO
alfresco.ehcache.rmi.hostname=server1@domain
alfresco.rmi.services.external.host=server1@domain
alfresco.ehcache.rmi.port=40001
alfresco.ehcache.rmi.remoteObjectPort=45001

I have also changed the cacheManagerPeerProviderFactory definition to below -

   <cacheManagerPeerProviderFactory
            class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
            properties="peerDiscovery=automatic,
                        multicastGroupAddress=230.0.0.1,
                        multicastGroupPort=4447"/>


but this is not working. Is it possible to get the ehcache replication working out of the box and if yes, how can I achieve this? If this cannot work without JGroups, is it possible to do it some other way?
10 REPLIES 10

mrogers
Star Contributor
Star Contributor
It's going to be **possible** to use jgroups and ehcache.   After all Alfresco Enterprise once used to use those technologies.

However it was never very easy and that's one of the reasons alfresco replaced the clustering code.    You can't just add the obsolete configuration to Alfresco Community and expect it to work.

sergiovallarta
Champ in-the-making
Champ in-the-making
Hello.

One question, how configuring the content repository in the two alfresco ??

I have two alfresco community connect to one database, one alfresco startup is no have problem, but, in the second alfresco, the log say "ONTENT INTEGRITY ERROR: System content not found in content store.
16:46:44,866 ERROR [org.alfresco.repo.admin.ConfigurationChecker] [localhost-startStop-1] Ensure that the 'dir.root' property is pointing to the correct data location.
16:46:44,882 ERROR [org.springframework.web.context.ContextLoader] [localhost-startStop-1] Context initialization failed
org.alfresco.error.AlfrescoRuntimeException: 01110001 Ensure that the 'dir.root' property is pointing to the correct data location."


Im add index.mode.recovery=FULL, and try AUTO but not function, Alfresco Share Startup but not logging, send autentication error, how if problem whit database.


After this problem, im started whith the jgruops, anything know, I say to you
Thanks !!

mrogers
Star Contributor
Star Contributor
You also need to share the content store as well as the database.

Hello.

What the correct format for share repository ?? My alresco.global.properties configuration is :

dir.root=//192.168.1.188/C:/Alfresco/alf_data
dir.contentstore=//192.168.1.188/C:/Alfresco/alf_data/contentstore
dir.contentstore.deleted=//192.168.1.188/C:/Alfresco/alf_data/contentstore.deleted

some triying

dir.root=\\192.168.1.188\C:\Alfresco\alf_data
dir.contentstore=\\192.168.1.188\C:\Alfresco\alf_data\contentstore
dir.contentstore.deleted=\\192.168.1.188\C:\Alfresco\alf_data\contentstore.deleted

but not function,

other configuration for the cluster add in my alfresco.global.properties

index.recovery.mode=FULL
alfresco.cluster.enabled=true
alfresco.cluster.name=mycluster
alfresco.hazelcast.password=alfrescocluster
alfresco.hazelcast.tcp.config=192.168.1.120,192.168.1.188;
alfresco.hazelcast.specify.interface=true
alfresco.hazelcast.bind.interface=192.168.1.120
alfresco.ehcache.rmi.hostname=192.168.1.120

mrogers
Star Contributor
Star Contributor
dir.root=C:/Alfresco/alf_data

The dir.root is a path not a UNC.

On windows you would map the drive prior to starting alfresco.

I read and documenting that this configuration is modified on the file repository.properties but im not find this file in the Community version, understand whait parameters modified is in alfresco.global.properties


I understand the function of the parameters that you mention but not find the correct parameters for the mapping (or if is requered other configuration for the Windows, outside the shared folder)

You know what parameters do mapping or have any link in where explain this configuration,this outside the alfresco wiki and docs thiw where im read actually

Saludos

mrogers
Star Contributor
Star Contributor
You have the correct file in your posting above.  put your configuration in use alfresco-global.properties

My alfresco.global.properties is :


###############################
## Common Alfresco Properties #
###############################

dir.root=C:/Alfresco/alf_data

alfresco.context=alfresco
alfresco.host=127.0.0.1
alfresco.port=8080
alfresco.protocol=http

share.context=share
share.host=127.0.0.1
share.port=8080
share.protocol=http

### database connection properties ###
#db.driver=org.postgresql.Driver
#db.username=alfresco
#db.password=*****
#db.name=alfresco
#db.url=jdbcSmiley Tongueostgresql://localhost:5432/${db.name}

db.driver=org.postgresql.Driver
db.username=alfresco
db.password=alfresco
db.name=alfresco
db.url=jdbcSmiley Tongueostgresql://192.168.1.232:5432/alfresco




# The server mode. Set value here
# UNKNOWN | TEST | BACKUP | PRODUCTION
system.serverMode=UNKNOWN

### FTP Server Configuration ###
ftp.enabled=true
ftp.port=21

### RMI service ports ###
alfresco.rmi.services.port=50500
avm.rmi.service.port=0
avmsync.rmi.service.port=0
attribute.rmi.service.port=0
authentication.rmi.service.port=0
repo.rmi.service.port=0
action.rmi.service.port=0
deployment.rmi.service.port=0

### External executable locations ###
ooo.exe=C:/Alfresco/libreoffice/App/libreoffice/program/soffice.exe
ooo.enabled=true
ooo.port=8100
img.root=C:\\Alfresco\\imagemagick
img.coders=${img.root}\\modules\\coders
img.config=${img.root}\\config
img.gslib=${img.root}\\lib
img.exe=${img.root}\\convert.exe
swf.exe=C:/Alfresco/swftools/pdf2swf.exe
swf.languagedir=C:/Alfresco/swftools/japanese

jodconverter.enabled=false
jodconverter.officeHome=C:/Alfresco/libreoffice/App/libreoffice
jodconverter.portNumbers=8100

### Initial admin password ###
alfresco_user_store.adminpassword=209c6174da490caeb422f3fa5a7ae634




### E-mail site invitation setting ###
notification.email.siteinvite=false

### License location ###
dir.license.external=C:/Alfresco

### Solr indexing ###
index.subsystem.name=solr
dir.keystore=${dir.root}/keystore
solr.port.ssl=8443

### BPM Engine ###
system.workflow.engine.jbpm.enabled=false

### Allow extended ResultSet processing
security.anyDenyDenies=false



index.recovery.mode=AUTO
alfresco.cluster.name=mycluster
alfresco.hazelcast.password=alfrescocluster
alfresco.hazelcast.tcp.config=192.168.1.188,192.168.1.120;
alfresco.hazelcast.specify.interface=true
alfresco.hazelcast.bind.interface=192.168.1.188
alfresco.ehcache.rmi.hostname=192.168.1.188


Saludos !!

Note. In my log, i can see the conecction database is correct, but,
immediately:

Connected to database PostgreSQL version 9.3.5
13:19:38,151 ERROR [org.springframework.web.context.ContextLoader] [localhost-startStop-1] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorityBridgeTableCache' defined in class path resource [alfresco/cache-context.xml]: Cannot resolve reference to bean 'authorityBridgeDAO' while setting bean property 'authorityBridgeDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorityBridgeDAO' defined in class path resource [alfresco/authority-services-context.xml]: Cannot resolve reference to bean 'nodeDAO' while setting bean property 'nodeDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nodeDAO': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nodeDAO.org.hibernate.dialect.Dialect' defined in class path resource [alfresco/dao/dao-context.xml]: Cannot resolve reference to bean 'contentDataDAO' while setting bean property 'contentDataDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentDataDAO' defined in class path resource [alfresco/dao/dao-context.xml]: Cannot resolve reference to bean 'eagerContentStoreCleaner' while setting bean property 'contentStoreCleaner'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eagerContentStoreCleaner' defined in class path resource [alfresco/content-services-context.xml]: Cannot resolve reference to bean 'deletedContentBackupListeners' while setting bean property 'listeners'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'deletedContentBackupListeners' defined in class path resource [alfresco/content-services-context.xml]: Cannot resolve reference to bean 'deletedContentBackupListener' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'deletedContentBackupListener' defined in class path resource [alfresco/content-services-context.xml]: Cannot resolve reference to bean 'deletedContentStore' while setting bean property 'store'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'deletedContentStore' defined in class path resource [alfresco/content-services-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.alfresco.repo.content.filestore.FileContentStore]: Constructor threw exception; nested exception is org.alfresco.service.cmr.repository.ContentIOException: 01240000 Failed to create store root: \\192.168.1.188\C:\Alfresco\alf_data\contentstore.deleted
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
   at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
   at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
   at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
   at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorityBridgeDAO' defined in class path resource [alfresco/authority-services-context.xml]: Cannot resolve reference to bean 'nodeDAO' while setting bean property 'nodeDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nodeDAO': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nodeDAO.org.hibernate.dialect.Dialect' defined in class path resource [alfresco/dao/dao-context.xml]: Cannot resolve reference to bean 'contentDataDAO' while setting bean property 'contentDataDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentDataDAO' defined in class path resource [alfresco/dao/dao-context.xml]: Cannot resolve reference to bean 'eagerContentStoreCleaner' while setting bean property 'contentStoreCleaner'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eagerContentStoreCleaner' defined in class path resource [alfresco/content-services-context.xml]: Cannot resolve reference to bean 'deletedContentBackupListeners' while setting bean property 'listeners'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'deletedContentBackupListeners' defined in class path resource [alfresco/content-services-context.xml]: Cannot resolve reference to bean 'deletedContentBackupListener' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'deletedContentBackupListener' defined in class path resource [alfresco/content-services-context.xml]: Cannot resolve reference to bean 'deletedContentStore' while setting bean property 'store'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'deletedContentStore' defined in class path resource [alfresco/content-services-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.alfresco.repo.content.filestore.FileContentStore]: Constructor threw exception; nested exception is org.alfresco.service.cmr.repository.ContentIOException: 01240000 Failed to create store root: \\192.168.1.188\C:\Alfresco\alf_data\contentstore.deleted

Saludos !!

mrogers
Star Contributor
Star Contributor
Well, where does \\192.168.1.188\ come from?

I suspect you have changed something you have not described above.