Foros de discusión

How to retain my cache after server restart

thumbnail
Raja Seth, modificado hace 7 años.

How to retain my cache after server restart

Regular Member Mensajes: 233 Fecha de incorporación: 18/08/11 Mensajes recientes
Hi Team,

I have a custom chcache implementation as given below in liferay-multi-vm-clustered.xml :

<cache
eternal="false"
maxElementsInMemory="10000"
name="find.xml.content.training.data"
overflowToDisk="false"
timeToIdleSeconds="86400"
>
<cacheEventListenerFactory
class="com.liferay.portal.cache.ehcache.LiferayCacheEventListenerFactory"
properties="replicatePuts=true,replicateUpdates=true,replicateRemovals=true,replicatePutsViaCopy=true,replicateUpdatesViaCopy=true,replicateAsynchronously=false"
propertySeparator=","
/>
<bootstrapCacheLoaderFactory class="com.liferay.portal.cache.ehcache.LiferayBootstrapCacheLoaderFactory" />
</cache>


Is there any way by which I can retain my cache after server restart?

Please let me know if there is any possiblilty.

Regards,
Raja
thumbnail
Olaf Kock, modificado hace 7 años.

RE: How to retain my cache after server restart

Liferay Legend Mensajes: 6396 Fecha de incorporación: 23/09/08 Mensajes recientes
Raja Seth:
Is there any way by which I can retain my cache after server restart?


restoring a cache from a serialized storage is risky: The underlying data might have changed already, so there's no intrinsic configuration switch that would do the trick.

You can, however, define the object IDs of the entities you'd like to be in cache on startup and just load them with your own cache-warmup-plugin. Just accessing them from your own services should be enough. How you generate this list of objects is up to you: Manually, or by inspecting what you currently have in cache.
thumbnail
Raja Seth, modificado hace 6 años.

RE: How to retain my cache after server restart

Regular Member Mensajes: 233 Fecha de incorporación: 18/08/11 Mensajes recientes
Hi Olaf,

Thanks for your reply. I have created script which run at certain time and creates cache objects. But now I am facing issue on cluster nodes. If I want to restart a single node and my cache is created, liferay doesn't allow me to restart the node. To make single node restart, I need to goto Control Panel > Server Administration and click on "Clear content cached across the cluster". Once cluster cache is cleared, then only it allows me to restart the node. Please let me know if you have any clue what property I am missing.

Regards,
Raja
thumbnail
Olaf Kock, modificado hace 6 años.

RE: How to retain my cache after server restart

Liferay Legend Mensajes: 6396 Fecha de incorporación: 23/09/08 Mensajes recientes
What do you mean by "not allowing to restart a node"? If you shut down your app server, it will go down - there's no "veto" option that Liferay has.