Accessing the GridGuard internal PostgreSQL DB
Provides instructions on how to access the GridGuard internal database
Firewall Configuration
To access the GridGuard DB, the firewall on the server has to be reconfigured to open up the necessary ports.
- Connect to the GridGuard server via SSH. Login as gridadmin
- Run command sytem-config-security-level
- Choose option Customize
- Under Allow Incoming, add entry tcp:5432
- Select OK
- Select OK
- Run command service iptables restart
Download and install the PostgreSQL Admin Tool
Download pgAdmin III from the following URL and install the tool.
http://www.pgadmin.org/download/ and install
If you need to connect to the database using an alternate tool, you can download the database drivers from the following URL:
http://ftp.postgresql.org/pub/odbc/versions/msi/
GridGuard currently runs version PostgreSQL 9.0.
Identify username & password to be used to connect to the GridGuard Database
To configure the pgAdmin tool, first determine the connection settings (username & password). To do this
- Connect to the GridGuard server via SSH. Login as gridadmin
- Run command grep "postgresql" /etc/syferlock/gridserver/server.xml
- This will give you a single line formatted as given below. Note down the value of the username and password attributes
<Resource auth="Container" driverClassName="org.postgresql.Driver" name="jdbc/Store" type="javax.sql.DataSource" url="jdbc:postgresql://localhost/grid" username="<username>" password="<password>" maxActive="20" maxIdle="0" maxWait="60" removeAbandoned="true" removeAbandonedTimeout="12600"/>
Configure pgAdmin III
- Select menu option File > Add Server
- Set name to any name you will like to assign to connection
- Set host to ip address / hostname of the GridGuard server
- Set username to the username determined in the previous step
- Set password to the password determined in the previous step
- Click OK
Browser connection to view GridGuard tables
The GridGuard database objects will be displayed under the node Databases > Schemas > grid