a) FileSystemHook[Locking]:
Liferay admin guide states that Liferay now defaults to using the FileSystemHook as the default due to performance reasons.
Secondly its states that you can use this safely in a clustered environment because the code will prevent collisions via locking and it uses versioning as well.
Fact: Liferay does not implement any file level locking, so only use the File System Hook or the Advanced File System Hook in a clustered environment if you’re using a SAN that supports file locking (most modern ones do but check your SAN documentation to be sure).
b) Jackrabbit:
You can use Jackrabbit as the storage mechanism instead. However if you use JCR(jackrabbit) in a clustered environment, it does not recommend using the JCR/jackrabbit file system storage mechanism (possible data corruption), but rather store it in a DB.
Que: In a clustered setup, what do most people use? JCR to the database? Or the non-JCR to the filesystem? If your shared setup is over NFS or SAN, Won't 2 threads writing to same file still toss IOException causing one to fail, with no corruption?
Ans: To some degree, it will depend on how you'll be using Liferay. If document storage and retrieval will be a large part of the portal, then you may notice performance issues with JCR to the database and should instead look at Advanced File System Hook with a SAN that supports file locking.
Things to Note:[Jackrabbit with DB]
1> Make sure that the user/password has the correct permissions on the DB (in this case lportal)
2> If you wish to use a separate DB than the one Liferay portal uses, just create it, give user correct permissions and change the url in repository.xml file.
3> Note that there is an LEP on having to rename jackrabbit dir to jackrabbit.bak, then restart, and a new jackrabbit dir will be created - have to then modify that repository.xml file.
4> When pointing Jackrabbit to the database, Liferay will create a file called workspaces.xml, in /home/workspaces/liferay/workspaces.xml. This will contain a portion of the repository.xml file. If you make changes to repository.xml, make sure you also make the changes to this workspaces.xml file.
5> A specific 'Bundle Database PM' like 'org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager' should be faster.
6> If you want to use the same database that liferay is already using, set the driver to "javax.naming.InitialContext" and the url to "java:comp/env/jdbc/LiferayPool"
Thanks for the post, I am techno savvy. I believe you hit the nail right on the head. I am highly impressed with your blog.
ReplyDeleteIt is very nicely explained. Your article adds best knowledge to our Java Online Training from India.
or learn thru Java Online Training from India Students.