Powered By Blogger

Tuesday, March 5, 2013

Important files of Alfresco

Alfresco server

1. alfresco-global.properties
    alf_data location,mail related ,cluster info

2. server.xml
    ports,ssl settings
3. tomcat-users.xml
    users required for authentication
4. keystore location to configure in server.xml
5. ehcache-custom.xml
         For enabling jgroups
6.catalina.properties
         To load the shared.loader preoperty

7. alf_data tp store the contents




Share- Server

1. share-config-custom.xml
     To configure endpoint

2. catalina.properties
     To load the shared/web-extension folder

Solr server

1. solr.xml
    To provide the info on solr.war
2. solrcore.properties in each of the core
        To specify where to store the indexes.
3. keystore
        This folder will have the contents used in solr
4. tomcat-users.xml
        To support ssl
5. server.xml
        To support ssl

AlfrescoCluster


Setup For the cluster With Alfresco 4.1.2 in local machine.
Servers setup. Alfresco cluster is done in “D:\alfrescoCluster-4.1.2”.  In clustering we will use UDP since we have servers in LAN. If the servers are present in WAN then we should think of using TCP mode to replicate the cache between the nodes. In the configuration if any of the port is mentioned as “0” then free available port will be used by the system.
alf_data is been shared with both the alfresco instances as content store. It will have keystore folder, these contents will be used by node1 and node2’s server.xml.
node1 – It will have alfresco and share installed running on port 5050.
node2- It will have alfresco and share installed running on port 8080.
solrnode1 – It will be used by alfresco node2(As per config in alfresco-global.properties of node2) to store the indexes. Search from both the nodes of alfresco will access data from this node. It will have its own keystore used by server.xml of solr server.
Alfresco node1 –running on port 5050. Files to be changed are
We  can install alfresco using the installer. After the installation copy mydql-connector.jar to lib folder of alfresco. After installation delete the solr.xml from catalina.localhost folder.
Files to be Observed :
1.       alfresco-global.properties
dir.root=D:/alfrescoCluster-4.1.2/alf_data
alfresco.context=alfresco
alfresco.host=127.0.0.1
alfresco.port=5050
alfresco.protocol=http
share.context=share
share.host=127.0.0.1
share.port=5050
share.protocol=http

### database connection properties ###
#db.driver=org.postgresql.Driver
db.username=root
db.password=root
db.name=alfrescocluster
#db.url=jdbc:postgresql://localhost/alfresco
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://localhost/alfrescocluster?useUnicode=yes&characterEncoding=UTF-8


###############Cluster properties###########
alfresco.cluster.name=alfresco-irm-preprod
#alfresco.ehcache.rmi.hostname=al1102.patil.com
alfresco.ehcache.rmi.hostname=localhost
alfresco.ehcache.rmi.port=40001
alfresco.ehcache.rmi.remoteObjectPort=45001

######Jgroups Configuration#########

#alfresco.jgroups.bind_address=al1102.patil.com
alfresco.jgroups.bind_address=localhost
alfresco.jgroups.bind_interface=eth0

######Content store replication#########
dir.contentstore=${dir.root}/contentstore
dir.contentstore.deleted=${dir.root}/contentstore.deleted
# The location of cached content
dir.cachedcontent=${dir.root}/cachedcontent
dir.auditcontentstore=${dir.root}/audit.contentstore

2.       catalina.properties
shared.loader=${catalina.base}/shared/classes

3.       tomcat-users.xml
This will have the user details to be connected with solr
 
 

4.       server.xml
This will have the details related to ssl connection


   
               maxThreads="150" scheme="https" keystoreFile="D:\alfrescoCluster-4.1.2/alf_data/keystore/ssl.keystore" keystorePass="kT9X6oe68t" keystoreType="JCEKS"
 secure="true" connectionTimeout="240000" truststoreFile="D:\alfrescoCluster-4.1.2/alf_data/keystore/ssl.truststore" truststorePass="kT9X6oe68t" truststoreType="JCEKS"
               clientAuth="false" sslProtocol="TLS" allowUnsafeLegacyRenegotiation="true" maxSavePostSize="-1" /> 

5.       ehcache-custom.xml

   
      path="java.io.tmpdir"/>

   
   
        class="org.alfresco.repo.cache.AlfrescoCacheManagerPeerProviderFactory"
        properties="heartbeatInterval=5000,
                    peerDiscovery=automatic,
                    multicastGroupAddress=230.0.0.1,
                    multicastGroupPort=4446"
    />

  
   
  
   
        class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
        properties="hostName=${alfresco.ehcache.rmi.hostname},
                    port=${alfresco.ehcache.rmi.port},
                    remoteObjectPort=${alfresco.ehcache.rmi.remoteObjectPort},
                    socketTimeoutMillis=${alfresco.ehcache.rmi.socketTimeoutMillis}"
    />
   

   
        maxElementsInMemory="5000"
        eternal="true"
        timeToIdleSeconds="0"
        timeToLiveSeconds="0"
        overflowToDisk="false"
        statistics="false"
        >

               


Alfresco node2 – running on port 8080

Solr node1- running on port 7070/7443, connecting to node2 of alfresco to keep track of the indexes.

Alf_data stored outside both the alfresco nodes will be used by both the alfresco instances to store the contents. For testing I have deployed share in the same nodes of alfresco(We can deploy share in different server, share config-custom.xml needs to be updated). For share only change required is at the end point url to connect to alfresco.



Installation of Alfresco in Different servers
We can do alfresco installation with ssl and non ssl. SSL requires keystores configuration and the tomcat-users.xml configuration. Non ssl does not require these changes.
Install alfresco using installer.  We can configure to the desired database by changing alfresco-global.properties and by moving the connector jar.

Remove share.war and share dir
Remove solr.xml config file.
Remove solr and solr.backup dir from alf_data
mv alf_data to Vormetrics mount
Create symbolic link to alf_data
We have to make sure to have keystore in alf_data as it is configured in server.xml

In the alfresco-global.properties we need to update the below properties
index.subsystem.name=solr
dir.keystore=${dir.root}/keystore
solr.port.ssl=7443


Configuring solr

We can configure solr with or without ssl settings, When we are using ssl setting then we need to configure separate keystore. In the default installation it uses server.xml
These files been checked in the svn


Clustering
We will be using jgroups to sync the caches. We will be using UDP protocol as we are having LAN connection. If the clustering is internet then we should go for TCP. We will use shared content store between the nodes.
Below files are affected.
Ehcache-custom.xml
Alfresco-global.properties
Configuring shared content store.

  1. Locate the ehcache-custom.xml.sample.cluster file.
  2. Copy the file to /alfresco/extension/ehcache-custom.xml.
  3. Remove the following default definition of cacheManagerPeerListenerFactory:
4.   
5.              class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
6.              properties="socketTimeoutMillis=10000"
            />
  1. Uncomment the extended definition by removing the comment lines <!-- and --!> before and after the following section:
8. 
9.              class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
10.            properties="hostName=${alfresco.ehcache.rmi.hostname},
11.            port=${alfresco.ehcache.rmi.port},
12.           
13.          remoteObjectPort=${alfresco.ehcache.rmi.remoteObjectPort},
          socketTimeoutMillis=${alfresco.ehcache.rmi.socketTimeoutMillis}" />
  1. Save the ehcache-custom.xml file.
  2. Set the following properties in the alfresco-global.properties file:
alfresco.cluster.name=alfresco-irm-preprod
alfresco.ehcache.rmi.hostname=al1102.nus.ironmountain.com
alfresco.ehcache.rmi.port=40001
alfresco.ehcache.rmi.remoteObjectPort=45001

######Jgroups Configuration#########

alfresco.jgroups.bind_address=al1102.nus.ironmountain.com
alfresco.jgroups.bind_interface=eth0

######Content store replication#########
dir.root=./alf_data
dir.contentstore=${dir.root}/contentstore
dir.contentstore.deleted=${dir.root}/contentstore.deleted
# The location of cached content
dir.cachedcontent=${dir.root}/cachedcontent
dir.auditcontentstore=${dir.root}/audit.contentstore