Two machines:
Server A: 172.16.48.26: Used for the alfresco server (cluster node 1)
Used for database servers, file servers (Sharing ),
Server B: 172.16.48.27: Used for the alfresco server (cluster node 2)
Server Load balancer
Step 1: create a shared database
Install MySQL on server a: 172.16.48.26 and create a database named alfresco;
# Create database alfresco
# Grant all privileges on alfresco. * to root @ '%' identified by 'alfresco'
Step 2: create a shared directory
Create a writable shared directory/alfresco on server a: 172.16.48.26;
Create the directory alfresco under/
# Mkdir/alfresco
Step 3: Set the shared directory
Install Samba on server a: 172.16.48.26, modify/etc/samba/smb. conf, and add the following content:
Security = user
[Alfresco]
Comment = alfresco Data & log
Path =/alfresco
Public = Yes
Writable = Yes
Write list = @ Root
Step 4: Create a samba user
Create the samba User Root on machine A: 172.16.48.26
# Smbpasswd-a root
Step 5: Create a share
Create the/alfresco directory on machine B: 172.16.48.27 and mount the shared directory of machine a // 172.16.48.26/alfresco
# Mount-T smbfs-O username = root, password = alfresco // 172.16.48.26/alfresco
Step 6: install Tomcat and modify the configuration
Machine A: install Tomcat on 172.16.48.26 and modify CONF/server. xml.
<Connection Port = "8080"
Maxthreads = "20000"
Emptysessionpath = "true"
Protocol = "org. Apache. Coyote. http11.http11nioprotocol"
Enablelookups = "false"
Redirectport = "8443"
Connectiontimeout = "20000"
Disableuploadtimeout = "true"/>
<Engine name = "Catalina" defaulthost = "localhost" jvmroute = "tomcat1">
Install Tomcat on machine B: 172.16.48.27, modify CONF/server. XML, and change jvmroute to Tomcat 2;
Step 7: deploy alfersco
Copy alfresco. War to the webapps directory of server a: 172.16.48.26 and server B: 172.16.48.27, and decompress it to the alfresco directory.
# Jar-XF alfresco. War
Step 8: Modify alfresco configurations
Modify the alfresco configurations of the two machines respectively.
1. Modify the WEB-INF/classes/alfresco/Repository. properties File
Dir. Root =./alfresco_data
DB. Name = alfresco
DB. url = JDBC: mysql: // 172.16.48.26: 3306/$ {dB. name}
DB. Username = root
DB. Password = alfresco
2. Copy the content under the extension directory (in the config of the repository project) to the WEB-INF/classes/alfresco/extension directory of 172.16.48.26 and 172.16.48.27, respectively,
Including:
Custom-hibernate-dialect.properties
Custom-repository-context.xml
Custom-repository.properties
Ehcache-custom.xml
Replicating-content-services-context.xml
And custom content Configuration
3. Modify the custom-hibernate-dialect.properties File
Hibernate. dialect = org. hibernate. dialect. mysqlinnodbdialect
4. Modify the custom-repository.properties File
Dir. Root =./alfresco_data
Index. Recovery. mode = auto
Index. Tracking. cronexpression = 0/5 ****?
Index. Tracking. reindexlagms = 10000
DB. Driver = org. gjt. Mm. MySQL. Driver
DB. Name = alfresco
DB. url = JDBC: mysql: // 172.16.48.26: 3306/$ {dB. name}
DB. Username = root
DB. Password = alfresco
5. Modify the ehcache-custom.xml File
<Cachemanagerpeerlistenerfactory class = "net. SF. ehcache. Distribution. rmicachemanagerpeerlistenerfactory"
Properties = "Port = 40001, sockettimeoutmillis = 300000"/>
6. Modify the replicating-content-services-context.xml File
<Bean id = "localdrivecontentstore" class = "org. Alfresco. Repo. content. filestore. filecontentstore">
<Constructor-Arg>
<Value>./alfresco_data/contentstore </value>
</Constructor-Arg>
</Bean>
<Bean id = "networkcontentstore" class = "org. Alfresco. Repo. content. filestore. filecontentstore">
<Constructor-Arg>
<Value>/alfresco/contentstore </value>
</Constructor-Arg>
</Bean>
Step 9: start Tomcat
Modify the bin/Catalina. Sh file of 172.16.48.26 and start Tomcat.
Export java_opts = '-xms512m-xmx2048m-XX: maxpermsize = 512 M-Server'
#./Bin/startup. Sh
Modify the bin/Catalina. Sh file of 172.16.48.27 with the same content as above. start Tomcat;
Step 10: Install the File Server
Install Apache httpd server on 172.16.48.26 to the/usr/local/Apache directory,
Copy mod_jk.so found on the Apache website to the modules directory.
Modify CONF/httpd. conf
Loadmodule jk_module modules/mod_jk.so
Jkworkersfile CONF/workers. Properties
Jklogfile logs/mod_jk.log
Jkloglevel info
Jkmount/* loadbalancer
Jkmount/jkstatus status
Include CONF/extra/httpd-mpm.conf
Include CONF/extra/httpd-default.conf
Add file CONF/workers. Properties
Worker. List = worker at1, tomcat2, loadbalancer, status
Worker. tomcat1.port = 8009
Worker. tomcat1.host = 172.16.48.26
Worker. tomcat1.type = ajp13
Worker. tomcat2.port = 8009
Worker. tomcat2.host = 172.16.48.27
Worker. tomcat2.type = ajp13
Worker. loadbalancer. type = LB
Worker. loadbalancer. balance_workers = worker at1, tomcat2
Worker. loadbalancer. sticky_session = true
Worker. loadbalancer. sticky_session_force = false
Worker. Status. type = Status
Modify CONF/extra/httpd-default.conf files
Timeout 300
Keepalive on
Maxkeepaliverequests 0
Keepalivetimeout 300
Modify CONF/extra/httpd-mpm.conf files
<Ifmodule mpm_prefork_module>
Startservers 5
Minspareservers 5
Maxspareservers 10
Serverlimit 4096
Maxclients 2048
Maxrequestsperchild 0
</Ifmodule>
<Ifmodule mpm_winnt_module>
Threadsperchild 1024
Maxrequestsperchild 0
</Ifmodule>
Start Apache httpd server
Step 2: Test
Create user test on machine
Use the test user to create the file file1.txt
Search for file1 using the test user in machine B;
Create a file file2.txt using the test user on the machine B.
Search for file2 using the test user on machine;