pegasystems / docker-pega-web-ready

Docker project for generating a tomcat docker image for Pega
Apache License 2.0
56 stars 101 forks source link

Whats the correct way of setting the volumes in the container #27

Closed yokodev closed 5 years ago

yokodev commented 5 years ago

What directories are important or necessaries for the container to persist data using volumes? Currently I have these:

Any Suggestion?

dcasavant commented 5 years ago

@yokodev What data are you looking to persist? Is this for web/batch or stream nodes?

I'd also suggest looking at the Helm charts repo here: https://github.com/pegasystems/pega-helm-charts. That provides a codified example of a Kubernetes deployment - including volume claims as needed.

yokodev commented 5 years ago

@dcasavant Well, you got me there...
How do you know if a tomcat is web/batch or stream? my guess is that this is web

I have some 7.4 and 8.2 images based on this article How to run Pega 7.4 in Docker
and came to the configuration above by guessing what my team may need... but was wondering what would be the official way of doing things.

I will also look at the repo you mention... Thanks

cdancy commented 5 years ago

@yokodev I assume this is a pure docker deployment and not trying to do things through kubernetes?

yokodev commented 5 years ago

@cdancy Yes, only docker at this time.

I sometimes have issues with the performance of the instances and don't know how to solve it but to add the search indexes and increase the -Xms8192m -Xmx13016m in JAVA_OPTS...
Is this regular Pega behavior, or is it something wrong with the docker images?

cdancy commented 5 years ago

or is it something wrong with the docker images

So that depends on which docker image you're referring to. Is that this image from this repo or something you built on your own given the article above?

Generally you can create a volume at the /opt/pega directory using whatever means you want to do so. A popular thing to do in the pure docker world is to use a data-container which defines this volume and then wire that up to this container.

yokodev commented 5 years ago

Yes, I built it based on the article...
Regarding the volumes I currently have this mapped to the host

node Name does not persist

cdancy commented 5 years ago

@yokodev what is this UI/program you're using to do things? I'm generally familiar with docker command line.

With that said your logic sounds fine enough. As far as setting the node-type permanently you can do that with this image though with the one you built I suspect you'd have to wire things up in your own way to do that. You can use the below query to see how we wire-up setting the NODE_TYPE for this image and perhaps apply that logic however you can to your context.

https://github.com/pegasystems/docker-pega-web-ready/search?q=NODE_TYPE&unscoped_q=NODE_TYPE

yokodev commented 5 years ago

@cdancy That is Pega :)
So every time I restart the host it gets terribly slow and so, one of the things that help alleviate this is to set the Host node ID on the Search Index host node setting (shown above) but it gets wiped out on every restart, so I was wondering if its a volume issue or how do you make it persistent across restarts.

cdancy commented 5 years ago

That is Pega :)

hahaha ... I'm in a different context and assumed you were posting a screenshot of some program to start docker containers. Indeed it is Pega :) So that's just basic docker at this point. I would personally recommend using a data-container as I noted above to make this stupid-simple. Check out the below article to see how to wire things up.

https://boxboat.com/2016/06/18/docker-data-containers-and-named-volumes/

yokodev commented 5 years ago

@cdancy Sorry about that probably I wasn't expressing my ideas in the clearest of ways...
So my doubt primarily geared towards best practices, and now that someone with knowledge was answering take advantage and throw in, some other issues that I was having... So, I'm able to persist everything, I just don't know how to persist this setting across reboots( node setting for the search indexes).

dcasavant commented 5 years ago

@yokodev What are you using to orchestrate your restarts? How is the configuration managed?

yokodev commented 5 years ago

@dcasavant well its GCP scheduler, and was just trying to figure out a way of persisting this option across reboots. So I thought it may be related to my volume configuration being wrong or something.

dcasavant commented 5 years ago

@yokodev I haven't tried the GCP scheduler so I can't advise on that. I'd suggest moving to GKE (GCP Kubernetes) as that is a supported tool and can be deployed using the Helm charts linked above.

yokodev commented 5 years ago

@dcasavant Yes, I know... So because of our requirements within the company sometimes we just need to spawn a single container for a couple of days and not have a full-fledged installation.
That said, do you guys have plans to provide such docker image so that one is able to just test out something in a single node and then get rid of it?

Any other recommendation is well welcome.

Thanks

dcasavant commented 5 years ago

@yokodev With some basic automation of the commands, you can spin up and tear down deployments using GKE as well (and it is the more appropriate tool to solve this problem). That is how I would suggest running a deployment regardless of the duration.

Depending on your exact use cases, you can also automate the restoration of a DB from backup or full installation on a run-by-run basis.