Discussion
Virtusa Corp.
US
Last activity: 16 Aug 2017 22:35 EDT
Pega 7.1.7 PVS database connection details
Hi,
I tried to connect to the PRPC database of Pega 7.1.7 PVS used in the CLSA 7.1 course, using dbVisualizer; I wanted to run some queries and to view some of the tables. I could not find the database user name/password and connection details.
Please kindly give the db connection details for the Pega 7.1.7 pvs and personal editions.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
We are working on a document that will descibe how to use Squirrel as your database client.
Connection information is located in Tomcat’s conf directory’s context.xml file
Information you need is:
- Driver class: org.postgresql.Driver
- JDBC URL: jdbc:postgresql://prpc:5432/pega
- User: prpc
- Pass: password
This will get you started at least. You can download a Postgres v9 driver from: https://jdbc.postgresql.org/
Squirrel can be downloaded from http://www.squirrelsql.org/.
You also need Java installed on your laptop.
This will get you started at least. We will update this post with the rest of the information ASAP.
Pegasystems Inc.
US
An alternative to the above is to leave the Postgres DB security settings as-is and, instead, publish the PVS linux server's pgadmin3 UI to your Windows display.
8>< - - - - - XMing + putty + pgadmin3 - - - - - ><8
- Download XMing from http://sourceforge.net/projects/xming/ and install on your laptop using the defaulted selections.
- When XMing launches using XLaunch.exe you will see an “X” icon within your Windows system tray.
- There are a number of web sites that describe how to use XMing and putty in conjunction. The most import configuration for your putty configuration is to enable X11 forwarding. Specify “:0.0” as the X display location.
- Log in using putty, then enter: pgadmin3
- Click the plug icon in the upper right-hand corner. Enter “prpc” as the user name and “password” as the password.
- Virtually anything you can do with a Windows-installed database client can be done through the pgadmin3 UI without having to modify the database security settings.
Pegasystems Inc.
US
For some reason my post for how to connect using Squirrel did not "take".
That post mentioined that I cannot paste images into this forum -- you have to imagine them below.
Here is the text version again:
8>< - - - - Squirrel - - - - - ><8
Database connection information can be found in Tomcat’s conf directory’s context.xml file.
<!-- PostgreSQL 9.1 -->
<Resource name="jdbc/PegaRULES"
auth="Container"
type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/pega"
username="prpc"
password="password"
maxActive="100"
maxIdle="30"
maxWait="10000"/>
Note above that Tomcat is told that the Postgres database is one the same server, i.e., localhost. To you this is “prpc” as defined in your C:\Windows\System32\drivers\etc\hosts file. Example below.
Proprietary information hidden prpc # 7.1.7
Proprietary information hidden prpc62 # 6.2 PVS
The information needs to connect to any database using a JDBC thin driver is:
For some reason my post for how to connect using Squirrel did not "take".
That post mentioined that I cannot paste images into this forum -- you have to imagine them below.
Here is the text version again:
8>< - - - - Squirrel - - - - - ><8
Database connection information can be found in Tomcat’s conf directory’s context.xml file.
<!-- PostgreSQL 9.1 -->
<Resource name="jdbc/PegaRULES"
auth="Container"
type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/pega"
username="prpc"
password="password"
maxActive="100"
maxIdle="30"
maxWait="10000"/>
Note above that Tomcat is told that the Postgres database is one the same server, i.e., localhost. To you this is “prpc” as defined in your C:\Windows\System32\drivers\etc\hosts file. Example below.
Proprietary information hidden prpc # 7.1.7
Proprietary information hidden prpc62 # 6.2 PVS
The information needs to connect to any database using a JDBC thin driver is:
• Driver class: org.postgresql.Driver
• JDBC URL: jdbc:postgresql://prpc:5432/pega
• User: prpc
• Pass: password
Next you need to locate a jar that contains the Postgres Driver class. Go to https://jdbc.postgresql.org/. Since version 9 of Postgres is used, click on the “JDBC4” link. Example file name downloaded = postgresql-9.4-1201.jdbc4.jar. Place this jar in a well-known location, e.g., C:\717.
Next download the Squirrel Open Source Java application from http://www.squirrelsql.org/. Extract to a directory such as C:\apps\Squirrel.
Be sure you have Java installed on your laptop and have JAVA_HOME defined.
Launch Squirrel, click on Drivers, click on Extra Class Path, navigate to the Postgres Driver jar than you downloaded, click Open, then click OK.
Next click on the Aliases tab, add supply the information below to connect to the 7.1.7 PVS. As shown above, the password is simply “password”.
If you click “Connect” now, however, you will get an error. The reason for this is that Postgres by default does not allow remote connections.
Using putty, log into your PVS, then issue: cd /etc/postgresql/9.1/main
Launch vi using: sudo vi postgresql.conf
As shown below, add: listen_addresses = '*'
Next execute: sudo vi pg_hba.conf
As shown below, add: host all all Proprietary information hidden/0 trust
Finally, restart the Postgres DB.
sudo /etc/init.d/postgresql stop
sudo /etc/init.d/postgresql start
Try your Squirrel connection again. This time it should work.
Virtusa Corp.
US
Thank you very much for the detailed information. I was able to connect using Squirrel, as mentioned in the last post.
Please kindly post the URL of the database connection document, once it is completed.
Pegasystems Inc.
US
The document is the same as above but with screenshots which you did not need apparently.
Cognizant
GB
Pegasystems Inc.
US
For a Personal Edition you would use "localhost" in place of "prpc". You also need to use the same PostgreSQL port number used when you did the install. 5432 is the default.
Bernving Associated
NL
There are a few conditions you have to look at:
1. Ensure the database listens for connections from the outside world. That is done in the file postgresql.conf. Add listen_addresses = '*' to the end of this file if this text does not exist in the file.
You might need to search for that file in Linux (find / -mount -name postgresql.conf)
2. Ensure postgres allows logins from external computers. This is done in the file pg_hba.conf. Add "host all all Proprietary information hidden/0 trust" to the end of the file and replace all occurence of "peer" with "md5" in the same file. You might need to search for that file in Linux (find / -mount -name ph_hba.conf)
3. Ensure SQuirreL can find the postgres jdbc driver. My postgres jdbc driver file is postgresql-9.2-1002.jdbc4.jar, but can be another version depending on what you did download. This is done onder the Drivers tab in Squirrel --> Extra Class Path.
PostGresql must now be restarted. Can be done in many ways, but a reboot of the virtual machine might be the easiest.
4. Make a connection configuration in SQuirreL to your database.
Enter jdbc:postgresql://<your hostname or IP>:5432/<your database name>
In my system this is jdbc:postgresql://prpc.:5432/pega but yours is probably different.
There are a few conditions you have to look at:
1. Ensure the database listens for connections from the outside world. That is done in the file postgresql.conf. Add listen_addresses = '*' to the end of this file if this text does not exist in the file.
You might need to search for that file in Linux (find / -mount -name postgresql.conf)
2. Ensure postgres allows logins from external computers. This is done in the file pg_hba.conf. Add "host all all Proprietary information hidden/0 trust" to the end of the file and replace all occurence of "peer" with "md5" in the same file. You might need to search for that file in Linux (find / -mount -name ph_hba.conf)
3. Ensure SQuirreL can find the postgres jdbc driver. My postgres jdbc driver file is postgresql-9.2-1002.jdbc4.jar, but can be another version depending on what you did download. This is done onder the Drivers tab in Squirrel --> Extra Class Path.
PostGresql must now be restarted. Can be done in many ways, but a reboot of the virtual machine might be the easiest.
4. Make a connection configuration in SQuirreL to your database.
Enter jdbc:postgresql://<your hostname or IP>:5432/<your database name>
In my system this is jdbc:postgresql://prpc.:5432/pega but yours is probably different.
This is quite the same as Lee written above. If you still have problems you can reach out to me and I can try to help you remotely. ([email protected])
Cognizant
GB
Thanks Lee and Hans for a quick response.
While connecting Squirrel to pgsql, I replaced "prpc" with "localhost" in the JDBC URL as Lee suggested and it works like a charm :)
Thanks a lot for your help guys..
Cheers
Subhenjit
Updated: 4 Feb 2016 10:22 EST
Pegasystems Inc.
JP
I am not able to connect postgresql in PVS from my host machine (windows 7), after following the instructions given by Lee.
Is anyone able to connect postresql in PVS via VirtualBox "host-only network" adapter?
I found that with VirtualBox "host-only network" adapter, changing postgresql.conf setting to listen_addresses='*' alone (pg_hba.conf is not touched) will cause PRPC cat not start up properly.
The PVS that I am using is downloaded from cLSA7.1 online course and the installation guide suggests using VirtualBox instead of VMPlayer.
Updated: 6 Feb 2016 9:43 EST
Pegasystems Inc.
US
Just connected myself for the first time to the 7.1.7 VirtualBox 's postgres DB.
I used pgAdmin3.exe from my laptop's Personal Edition. host = prpc, user = prpc, password = password.
You can run the script below after which I recommend doing "Machine -> Reset" to 100% guarantee the database is restarted.
Use WinSCP.exe to copy the script to the PVS, naming it "pgEnable,sh", then make it executable using: chmod +x pgEnable,sh
After that execute the script using "sudo", for example, sudo ./pgEnable.sh
Just connected myself for the first time to the 7.1.7 VirtualBox 's postgres DB.
I used pgAdmin3.exe from my laptop's Personal Edition. host = prpc, user = prpc, password = password.
You can run the script below after which I recommend doing "Machine -> Reset" to 100% guarantee the database is restarted.
Use WinSCP.exe to copy the script to the PVS, naming it "pgEnable,sh", then make it executable using: chmod +x pgEnable,sh
After that execute the script using "sudo", for example, sudo ./pgEnable.sh
#! /bin/bash #SuperUser=YES echo echo Fix RDBMS settings in your virtual machine echo pg=`find / -mount -name postgresql.conf 2> /dev/null` if [ -n "$pg" ] then echo echo Changing listening address for postgresql grep "^listen_addresses = '\*'" $pg > /dev/null 2>&1 || echo "listen_addresses = '*'" >> $pg else echo Postgres.conf file not found fi pg=`find / -mount -name pg_hba.conf 2> /dev/null` if [ -n "$pg" ] then echo Changing host allowance for postgresql grep "^host.*0\.0\.0\.0/0" $pg > /dev/null 2>&1 || echo "host all all Proprietary information hidden/0 trust" >> $pg echo applying md5 to peer authentication sed -i "/^local.*all.*all.*peer$/s/peer/md5/g" $pg echo postgres restart in 5 minutes. We wait 5 min so we not interfere with prpc startup. echo service postgresql restart \> restart.res 2\>\&1 | at now + 5 min else echo Postgres pg_hba.conf file not found fi |
Pegasystems Inc.
JP
Hi Lee, It worked !
Thank you so much.
BPM Solutions B.V.
NL
Hi,
I try to connect with SQuirreL to Pega 7.2 directly installed on laptop. Have added Postgres DB driver. When I try to connect I get following error:
java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.postgresql.util.PSQLException: FATAL: role "prpc" does not exist
Anyone any idea?
Cheers,
Mohammad
Pegasystems Inc.
GB
User is Pega not PRPC
Virtusa Corp.
US
Hi,
Please kindly give us the db connection details for the new Pega 7.1.9 PVS.
Ai4Process
GB
hi,
did you try postgres/postgres or look at the configuration files as explain above.
Damien
Pega Academy Support Team
Ai4Process
GB
Hi,
You need to tell the DB to listen to your address and grant access.
login as root/install
vi /var/lib/pgsql/9.3/data/postgresql.conf
Change the line from listen_addresses=’localhost’ to listen_addresses=’*’ (uncomment as well)
vi /var/lib/pgsql/9.3/data/pg_hba.conf
add a line under: local all postgres peer
host all all Proprietary information hidden/0 trust
/etc/init.d/postgresql restart
Damien
Pegasystems Inc.
US
Hi Damien,
When I am trying to restart using /etc/init.d/posstgresql-9.3 restart , it is givign [OK] for stopping, but it is failing to restart. Could you please let me know why the postgres is failing to restart. The PVS is 7.1.9 and OS is windows 10
Thank you, Rao
Pegasystems Inc.
US
When I veirified the logs under pg_logs it seems it is not accepting the ipaddress, so, gave the format in subnet mask format like 192.xx.yy.0/13 and it took it and restarted the database server. I got this issue in windows side, but in mac it just accepted without subnet mask format....like 192.xx.yy.13.
Pegasystems Inc.
US
With any Personal Edition or PVS that runs Tomcat, locate its "conf" directory. You can do this using: ps -ef | grep java
For the new 7.1.9 PVS you will see that Tomcat's install directory is /opt/tomcat
Within the /opt/tomcat/conf directory is a file named "context.xml".
Within the context.xml file you will see the database connection information used by the "prweb" web-app.
For the new 7.1.9 PVS, the user/pass is: pega/pega
Cognizant Technology Solutions
US
Step 1. Open WinSCP.exe
Step 2. Enter User/Password as root/install
Step 3. Change Directory >> cd /
Step 4. Create file pgEnable.sh in root directory and Copy Below Script
#! /bin/bash
#SuperUser=YES
echo
echo Fix RDBMS settings in your virtual machine
echo
pg=`find / -mount -name postgresql.conf 2> /dev/null`
if [ -n "$pg" ]
then
echo
echo Changing listening address for postgresql
grep "^listen_addresses = '\*'" $pg > /dev/null 2>&1 || echo "listen_addresses = '*'" >> $pg
else
echo Postgres.conf file not found
fi
pg=`find / -mount -name pg_hba.conf 2> /dev/null`
if [ -n "$pg" ]
then
echo Changing host allowance for postgresql
grep "^host.*0\.0\.0\.0/0" $pg > /dev/null 2>&1 || echo "host all all Proprietary information hidden/0 trust" >> $pg
echo applying md5 to peer authentication
sed -i "/^local.*all.*all.*peer$/s/peer/md5/g" $pg
echo postgres restart in 5 minutes. We wait 5 min so we not interfere with prpc startup.
echo service /postgresql-9.3 restart \> restart.res 2\>\&1 | at now + 5 min
else
echo Postgres pg_hba.conf file not found
fi
Step 1. Open WinSCP.exe
Step 2. Enter User/Password as root/install
Step 3. Change Directory >> cd /
Step 4. Create file pgEnable.sh in root directory and Copy Below Script
#! /bin/bash
#SuperUser=YES
echo
echo Fix RDBMS settings in your virtual machine
echo
pg=`find / -mount -name postgresql.conf 2> /dev/null`
if [ -n "$pg" ]
then
echo
echo Changing listening address for postgresql
grep "^listen_addresses = '\*'" $pg > /dev/null 2>&1 || echo "listen_addresses = '*'" >> $pg
else
echo Postgres.conf file not found
fi
pg=`find / -mount -name pg_hba.conf 2> /dev/null`
if [ -n "$pg" ]
then
echo Changing host allowance for postgresql
grep "^host.*0\.0\.0\.0/0" $pg > /dev/null 2>&1 || echo "host all all Proprietary information hidden/0 trust" >> $pg
echo applying md5 to peer authentication
sed -i "/^local.*all.*all.*peer$/s/peer/md5/g" $pg
echo postgres restart in 5 minutes. We wait 5 min so we not interfere with prpc startup.
echo service /postgresql-9.3 restart \> restart.res 2\>\&1 | at now + 5 min
else
echo Postgres pg_hba.conf file not found
fi
Step 5. Copy Change the Mode >> chmod +x pgEnable.sh
Step 6. Execute the script >> sudo ./pgEnable.sh
Step 7. Verification
After execution of the script check if following files are updated properly as below:
postgresql.conf - > listen_addresses=’*’ (updated)
pg_hba.conf - > host all all Proprietary information hidden/0 trust (Added)
Step 8. Restart Postgres
cd /etc/init.d
sudo ./postgresql-9.3 restart
Step 9. Connect to Postgres
Host Name: <ip address>
Post: 5432
User Name: postgres
Password: postgres
Cognizant
US
Exactly followed and worked !!!!
Thanks
Cox Automotive
US
I see all these discussions, queries, solutions on top of solutions, etc., are in forum and thats too happenining since early 2015. It would be great if Pega Academy put some formal documentation around PVS to Postgres database connectivity.
Cognizant
IN
Team Any document ready yet?
Pegasystems Inc.
US
Not at this point.
Thanks,
Bill
-
Sathishkumar Senthilkumar