Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

persistent volume #28

Open
shd128 opened this issue Jul 6, 2020 · 7 comments
Open

persistent volume #28

shd128 opened this issue Jul 6, 2020 · 7 comments

Comments

@shd128
Copy link

shd128 commented Jul 6, 2020

Hi,

Im having trouble with the persistent volume.
In which path should I mount it?
Everytime I restart my container it gets back to default.
Im using version 7.2.1

Thanks

@mdelapenya
Copy link
Owner

Hi @shd128, could you please post an example of the docker call? Thanks!

@shd128
Copy link
Author

shd128 commented Jul 7, 2020

Manuel, how are you?
Thanks for the reply.I'm using Openshift from the UI, so I don't have the docker call, I'm sorry 
The thing I don't know is in which path should I mount the persistent volume.
Thanks again!

@mdelapenya
Copy link
Owner

mdelapenya commented Jul 8, 2020

Hey @shd128, what are you going to add as a volume? A directory with your JAR/WAR files? configuration files?

I'd like to understand your use case to provide a better answer, identifying a potential issue with the volumes

@shd128
Copy link
Author

shd128 commented Jul 14, 2020

Hey @mdelapenya yes, I need a directory with JAR/WAR files. Where should I mount such volume? Thanks again

@mdelapenya
Copy link
Owner

Hi @shd128, the liferay apps directory is under $LIFERAY_HOME/data/osgi, which uses different specialised directories for each type of application: themes, core apps, etc. I recommend you to SSH into a local docker image (docker run + docker exec) and examine the contents of that $LIFERAY_HOME directory.

If you are mounting the $LIFERAY_HOME/deploy dir, then you'll notice that the files "dissapear", because Liferay's auto-deploy system is moving them from there to the proper osgi folder. That's the reason you would like to map your $LIFERAY_HOME/data/osgi instead.

One main concern here: because you mentioned you are using OpenShift, I could imagine you are in the kubernetes world. Be careful about sharing state between different containers/scaled services, otherwise all of them will share same information and possibly a cluster won't work because of that. I recommend you that have the proper automation in place to deploy your apps to each scaled service's volume, without sharing configuration.

I'd also like to point you to Liferay Learn and the Forums, in the case you need more info. The Liferay folks will be very glad for answering your questions.

@shd128
Copy link
Author

shd128 commented Jul 21, 2020

Thanks for the info @mdelapenya
I tried to mount my persistent volume in /liferay/osgi but as it was empty it give me errors.
Should I copy all the files that the container has to the persistent volume before mounting it?
Thanks again

@mdelapenya
Copy link
Owner

mdelapenya commented Jul 27, 2020

The mount point would be "/liferay/data/osgi", but I'm not sure it's a good idea to override Liferay's default directories.

As Liferay listens to anything OSGi under the $LIFERAY_HOME/data/osgi folder, try using a custom one for your apps: "/liferay/data/osgi/my-apps", then the OSGi container will discover them at startup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants