Enabling access to vPostgres Database:

First, log into the vRA appliance or SSH to it using root account.

Next edit pg_hba.conf file

Check for the presence of the line

What this enables, is using the local machine you can use vcac user to login to the database. Since I wanted to access it remotely, I added the following line:

The above line allows any user from the machine 10.110.23.148 to connect to the database.

In the next step, edit the postgresql.conf file.

In that file add the following line

What I am doing here, is listening to everything.

The above steps will let me connect to the database from my machine at 10.110.23.148.

Get the vcac user password:

In the next stage, we need to get the password for the vcac user. Detailed steps for doing so is provided in this VMware KB article.

Run the following command

You get an output similar to:

<Resource abandonWhenPercentageFull=”0″ auth=”Container” driverClassName=”org.postgresql.Driver”     factory=”com.vmware.vcac.tools.tomcat.db.CafeEncryptedDataSourceFactory” fairQueue=”false” initialSize=”10″     jdbcInterceptors=”ResetAbandonedTimer” jmxEnabled=”true” logAbandoned=”true” logValidationErrors=”true” maxActive=”100″     maxIdle=”20″ maxWait=”120000″ minEvictableIdleTimeMillis=”60000″ minIdle=”10″ name=”jdbc/cafe”     password=”s2enc~646fCCJWPaSYJe91XKBpkrc1E+3N83n7ZIF3a+PGEaI=” removeAbandoned=”true” removeAbandonedOnBorrow=”true”     removeAbandonedOnMaintenance=”true” removeAbandonedTimeout=”240″ suspectTimeout=”60″ testOnBorrow=”true”     testOnReturn=”false” testWhileIdle=”true” timeBetweenEvictionRunsMillis=”30000″ type=”javax.sql.DataSource”     url=”jdbc:postgresql://127.0.0.1:5433/vcac” username=”vcac” validationInterval=”30000″ validationQuery=”select 1″     validationQueryTimeout=”2″/>

Note the encrypted value after the password field. In this case the value is “s2enc~646fCCJWPaSYJe91XKBpkrc1E+3N83n7ZIF3a+PGEaI=”. In the next step we will find the actual password.

This will give you the password.

Connecting to vPostgres using pgAdmin:

Now all that is left is to connect to the database using the user id and password. Create a new connection to the vPostgres database and connect to it. Post connection it looks like the following:

         

hferch has written 76 articles

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">