Question


Synechron
US
Last activity: 19 Aug 2019 10:38 EDT
CLSA Build Local Setup
For LSA 7.3 build exam, I decided to setup 2 separate instances of Dev (for developingthe solution)and Test (to test the solution).
I downloaded the .ova file from following location and loaded it onto my VM. First install worked fine and I set it up as my Development instance.
https://pega.app.box.com/v/llvm-lsa731
I then cloned it in order to setup Test instance. It installed everything. But when I run 2 instances at once either machine hangs or one of the instance does not work with url
(http://localhost:9080/prweb/PRServlet)
What are options in case I need to run 2 instances?
- Use one VM instance at a time : This will eat up some time if I want to switch and quickly test my solution
- Do development on Personal edition and Testing on VM : Pega should work uniform no matter where it was developed but VM instance has PostGRE presetup on it. If any of the solution requires access to DB, it might be problematic?
Any ideas?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!


Synechron
US
bump


Pegasystems Inc.
US
Instead of 2 VMs or PE + VM, the best way to have multiple databases is to use docker on the same VM (google using "pega docker").
After getting a Pega Postrgres docker image and two docker containers spun up from it, execute:
cp -r /opt/tomcat /opt/tomcat2
You then have to change tomcat2's port number, plus use the port number you assigned to the second docker container, plus specify a different pega temp directory.
You can also point tomcat2 at the same database as tomcat1 if you want to experiment with a load balancer, such as haproxy, fronting a cluster.
With two databases you can experiment setting up a Deployment Manager pipeline, or multi-team development with two servers, one the SOR. Publish a branch from the non-SOR server to the SOR server.
Or just use the second, (third, forth...) docker container for testing using good old-fashioned RAP importing.


Synechron
US
Thanks. Your high-level steps give some idea. But I haven't used Docker before. Is there more detailed documentation available as to how to run Pega on docker?
I found below article.
https://collaborate.pega.com/community-post-unpublished-or-under-review
But it says we need licensed software for performing the steps listed in the article? So this will not work with Personal edition zip? Or am I reading this wrong?
- If you are licensed to use any Pegasystems software as a Customer or Partner, the Pegasystems’ Sales or Partner Support Team associated with your organization must submit a software request on your behalf.


Pegasystems Inc.
US
Licensed Pega customers or partners can download Pega distributions such as the just released 8.3GA version. The distribution contains a large jar file (1.9GB) containing every serialized rule in Pega, plus a a smaller jar file (1.9MB) containing serialized data.
pega8@Lubuntu1:~/Pega83/rules$ ls -l
total 1895872
-rw-r--r-- 1 pega8 pega8 1953626 Aug 5 20:22 PRPC_Data.jar
-rw-r--r-- 1 pega8 pega8 1939414073 Aug 5 20:23 PRPC_Rules.jar
As the link you provided explains, configure ../scripts/setupDatabase.properties to connect to an empty local Postgres database, prepped for Pega, running in a docker container.
With docker you can map the same internal container port number, say, 5432, to an external port number, say, 32770.
After everything loads, which takes approx 30 mins, create a baseline docker image from that container.
Then use the docker "run" command to create a second docker container from the baseline image you created, this time specifying port number 32772 say.
sudo docker run --name pega83db2 --publish 32772:5432 -P -e POSTGRES_USER=pega -e POSTGRES_PASSWORD=pega -d -v $HOME/docker/volumes/postgres2:/var/lib/postgresql/data pega83db_baseline
NOTE: "2" above means "second container". Do not use the "run" command twice. Instead, use "stop" (or just shutdown the VM and restart it), then use "start" from that point on.
sudo docker start pega83db
Licensed Pega customers or partners can download Pega distributions such as the just released 8.3GA version. The distribution contains a large jar file (1.9GB) containing every serialized rule in Pega, plus a a smaller jar file (1.9MB) containing serialized data.
pega8@Lubuntu1:~/Pega83/rules$ ls -l
total 1895872
-rw-r--r-- 1 pega8 pega8 1953626 Aug 5 20:22 PRPC_Data.jar
-rw-r--r-- 1 pega8 pega8 1939414073 Aug 5 20:23 PRPC_Rules.jar
As the link you provided explains, configure ../scripts/setupDatabase.properties to connect to an empty local Postgres database, prepped for Pega, running in a docker container.
With docker you can map the same internal container port number, say, 5432, to an external port number, say, 32770.
After everything loads, which takes approx 30 mins, create a baseline docker image from that container.
Then use the docker "run" command to create a second docker container from the baseline image you created, this time specifying port number 32772 say.
sudo docker run --name pega83db2 --publish 32772:5432 -P -e POSTGRES_USER=pega -e POSTGRES_PASSWORD=pega -d -v $HOME/docker/volumes/postgres2:/var/lib/postgresql/data pega83db_baseline
NOTE: "2" above means "second container". Do not use the "run" command twice. Instead, use "stop" (or just shutdown the VM and restart it), then use "start" from that point on.
sudo docker start pega83db
To see what containers are active running, use:
sudo docker ps
To see what what docker images are installed, use:
sudo docker images


Synechron
US
Are you confirming that it has to be licensed software and cannot be personal edition to run Pega with docker?
And thanks for detailed steps, I will try and see how that works.


Pegasystems Inc.
US
Docker runs on top of an OS, Windows or Linux.
Personal Edition and Docker are not compatible.
If you want to experiment with Docker + Pega, see: https://hub.docker.com/u/pegasystems
You no longer have to go to the trouble of:
- Installing a postgres docker image
- Populating a directory with a Dockerfile and pega8_postgres_schema.sql file
- Within that directory, executing: sudo docker build -t pega83db .
Instead, skip all that and execute: sudo docker pull pegasystems/pega
But you still need to load the database yourself from a licensed distribution image.
OR... wait until the 8.3 LSA course where one of the VMs will have everything done for you already.
Personal Edition will not be supported for the 8.3 LSA course.


Pegasystems Inc.
US
I misspoke about https://hub.docker.com/u/pegasystems. That is a Pega Infinity node (tomcat + cassandra + kafka). You need to pass docker run four JDBC environment variables to tell it how to connect to a database. Example below:
sudo docker run --name pega83db --publish 32770:5432 -P -e DB_USERNAME=pega -e DB_PASSWORD=pega -e JDBC_URL=jdbc:postgresql://localhost:32770/pega -e JDBC_CLASS=org.postgresql.Driver -d pegasystems/pega:latest
If you want to load a Pega distribution into a Postgres docket container, currently you need to issue:
docker pull pegasystems/postgres-pljava-openjdk:9.4
Look at the tab labeled "Tags". 9.4 is the most recent tag. The pull will not work if you default to "latest" as the tag.


Synechron
US
sudo docker run --name pega83db
Isn't that Pega 8 command as well? Or you just cited it as an example?


Pegasystems Inc.
US
As stated, you only use "sudo docker run" once. Thereafter use "stop" and "start. The value after --name is the name you give to the container. At the end of the command you specify the docker image that the docker container is being spun up from.
For a database container there are other "run" arguments you would want to use:
--publish 32770:5432 (external DB port number to internal DB port number mapping)
-e POSTGRES_USER=pega -e POSTGRES_PASSWORD=pega (required environment variables)
-d (detach)
-v $HOME/docker/volumes/postgres:/var/lib/postgresql/data (external directory to internal volume mapping)
If you were to execute: sudo docker exec -ti pega83db psql -h localhost -U pega -d pega
You would be running psql within the Postgres container. You could place a large CSV file in $HOME/docker/volumes/postgres. In psql you could say COPY <schema.table(columns)> FROM '/var/lib/postgresql/data/<large_file>.csv'. This would cause <large_file>.csv to be read from the VM directory that you mapped.