Configuring Persistent File Storage Volumes¶
Administrators can configure the volumes for their services in Liferay Cloud depending on their deployment type (Deployment
or StatefulSet
). Volumes can be stored either with persistent shared storage (NFS) or with dedicated storage (SSD), depending on the deployment type. This article documents how to configure volumes via a service’s LCP.json
file. See Understanding Deployment Types for more information on deployment types.
Note
The /opt/liferay/data
directory (named data
by default) is reserved for the document library in the liferay
and backup
services. This volume does not need to be configured in LCP.json
files and the path cannot be changed. If this configuration is present, then it can be safely removed without causing issues.
Follow these steps to configure a new volume for a service.
Choose the folders that contain the data to be persisted (for example,
/opt/storage
).Navigate to the
LCP.json
file in the repository for the specific environment (for example,liferay/
).Add the
volumes
configuration to theLCP.json
file. This configuration must contain a key for each volume. For example, the following configuration contains astorage
key for/opt/storage
:
{
"id": "liferay",
"memory": 8192,
"cpu": 8,
"volumes": {
"storage": "/opt/storage"
}
}
Important
For StatefulSet
type services, you must delete and then redeploy the service for changes to the volume configuration to take effect.
Note
If you are using version 3.x.x services, then the LCP.json
file for the liferay
service is instead located in the lcp/liferay/
directory. See Understanding Service Stack Versions for more information on checking the version.
Removing Contents of a Volume¶
Volumes persist in your environment even when the services are deleted. You can change the name of the volume in use for your service (or rename the existing volume) to use a new volume, but the old volume’s contents will still exist (in either NFS or the service’s SSD). You must also remove the contents of any volume yourself if you do not want them to persist.