Liferay cluster upload photos on one node another node could not see the solution of the problem

Source: Internet
Author: User

Reproduce the procedure:

The last time they had a cluster problem was to upload a picture from the Control Panel of Node 1, and then close Node 1, which is not visible from Node 2. The process of this problem is as follows:

Following are the steps for the clustering issues

Go to control Panel.
Click on the "Documents and Media" from the left Nav.
Add folder
ADD Basic document. Browse Image
ADD The Web content port let
and configure it to use the above add image.

I later solved the problem after delving into the process:

Workaround 1: Use the database to store media resources in blob form:

Solution:

(1) In each node, add the following lines in ${liferay_home}/portal-ext.properties:

#added by Charles to use the Dbstore instead of default filesystemstore when configuring the document library 
     
Dl.store . Impl=com.liferay.portlet.documentlibrary.store.dbstore 

     
      

#added by Charles to fix the Dbstore problem and use the new Por Tal Hibernate mapping file 
     
  hibernate.configs=\ 
     
        meta-inf/mail-hbm.xml,\ 
     
        meta-inf/portal-hbm-new.xml,\ 
     
        Meta-inf/ext-hbm.xml

In each node, copy the Portal-hbm-new.xml from the attachment to/root/web-inf/classes/meta-inf/folder.

Reason for this solution:

When we add "Basic Document" to created folder in Control Panel, the Liferay system'll do the following tasks:

You can read my article http://supercharles888.blog.51cto.com/609344/921761 for the very detailed analysis process.

A. Add a entry in "dlfileentry" table to stand for the new added document.

B. Add an entry in "dlfileentryversion" table to record the version information of the new added document, it would r Elated to "dlfileentry" table by foreign key "Fileentryid"

C. Update the new posted timestamp in "Dlfolder" table, which means the latest timestamp-this folder has been P osted by some file.

D. Add an entry in "assetentry" table, because the file is also one kind of asset. This table is related to "dlfileentry" table by foreign key "CLASSPK"

E. Upload the "file to" store based on the Liferay server configuration:

In Dlstoreimpl class AddFile method:

public void AddFile ( 
     
                  long CompanyID, long Repositoryid, String FileName, 
     
                  boolean validatefileextension, File File) 
     
            throws Portalexception, SystemException { 
     
      
     
            validate (fileName, validatefileextension, file); 
     
      
     
            if (propsvalues.dl_store_antivirus_enabled) { 
     
                  antivirusscannerutil.scan (file); 
     
            } 
     
      
     
            Store.addfile (CompanyID, Repositoryid, fileName, file); 
     
   

Actually, the Liferay framework has supplied 5 kinds of implementations for Store:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.