Friday, July 20, 2012

Automatic index recovery in alfresco after fix time and set cluster environment

1:- Create file scheduled-jobs-context.xml in tomcat/shared/classes/alfresco/extension/ with following content.
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
   <!-- enable DEBUG for 'org.alfresco.repo.cache.EhCacheTracerJob' and enable scheduler property to activate -->
   <bean id="ehCacheTracerJob" class="org.alfresco.util.TriggerBean">
<property name="jobDetail">
   <bean id="ehCacheTracerJobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
       <property name="jobClass">
           <value>org.alfresco.repo.cache.EhCacheTracerJob</value>
       </property>
   </bean>
</property>
<!-- enable this to activate bean-->
<!--sourabh-->
<property name="scheduler">
   <ref bean="schedulerFactory" />
</property>
<!--sourabh-->
<!-- start after an hour and repeat hourly -->
<property name="startDelayMinutes">
   <value>60</value>
</property>
<property name="repeatIntervalMinutes">
   <value>60</value>
</property>
<!--setting the statistic property be true-->
<!--<property name="statistics">
   <value>true</value>
</property>-->
   </bean>
</beans>
2:- In alfresco-global.properties file add following content.
####Alfresco repository extension for ####
index.tracking.cronExpression=0/5 * * * * ?
index.recovery.mode=AUTO
index.tracking.reindexLagMs=10000
index.tracking.maxTxnDurationMinutes=10
index.tracking.maxTransactionsPerLuceneCommit=100
index.recovery.maximumPoolSize=5
3:- Restart the alfresco server.
4:- Check whether solr indexes are updated or not.
5:- Its all the magic of alfresco index recovery services that recover indexes from database.
6:- Before doing it ehcache must be synchronized.

No comments:

Post a Comment