Reproduce the procedure:
上次他们有一个集群上的问题,就是从节点1的控制面板中,上传一个图片,然后关闭节点1, 从节点2中看不到这个图片。这个问题的流程如下:
Following are the steps for the clustering issues
Go to Control Panel. Click on "Documents and Media" from Left Nav. Add folder Add Basic document . Browse Image Add the Web content port let And configure it to use the above add image.我后来在深入研究这个过程之后,解决了这个问题:
解决方法1: 用数据库存储media资源,以Blob形式:
Solution:
<!(1) In each node ,add the following lines in ${liferay_home}/portal-ext.properties:
<!--[if !supportLists]-->(2) <!--[endif]-->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 will do the following tasks:
You can read my article for very detailed analysis process.
<!--[if !supportLists]-->a. <!--[endif]-->Add an entry in “DLFILEENTRY” table to stand for the new added document.
<!--[if !supportLists]-->b. <!--[endif]-->Add an entry in “DLFILEENTRYVERSION” table to record the version information of the new added document ,it will related to “DLFILEENTRY” table by foreign key “fileEntryId”
<!--[if !supportLists]-->c. <!--[endif]-->Update the new posted timestamp in “DLFOLDER” table ,which means the latest timestamp that this folder has been posted by some file.
<!--[if !supportLists]-->d. <!--[endif]-->Add an entry in “ASSETENTRY” table ,because file is also one kind of asset. This table will be related to “DLFILEENTRY” table by foreign key “classpk”
<!--[if !supportLists]-->e. <!--[endif]-->Upload the file to the store based on the liferay server configuration:
In DLStoreImpl class addFile method:
Actually ,the Liferay framework has supplied 5 kinds of implementations for Store :