Hi All,
I am getting connection error during connecting to PostgreSQL db from my vRO "add databse" work flow (located under library\SQL).
But I can connect to that PostgreSQL db from vRA appliance through SSH connection. There I am using the database 'vcac' and the user 'postgres'.
Please see below output when connecting via SSH to that vRA apliance.
Below is the connection parameter passing to the WF input.
below is the error log I am getting in wf console:
Is there more configuration/settings are required to connect the vRA appliance PostgreSQL DB ? please let me know.
Thnx,
You can add the vcac database by following these steps
1. | Getting the vRO DB password: |
o | go to Appliance Management Console, "Admin" tab and check: "SSH service enabled" and "Administrator SSH login enabled" |
o | log into vRO with "root" |
o | execute: xpath /etc/vcac/server.xml "//@password" 2>&1 | grep password | cut -d'"' -f2 |
or
(tr '\n' ' ' < /etc/vcac/server.xml | grep -Eo "<\s*Resource.*name\s*=\s*(\"|')jdbc/cafe(\"|')[^<]*/?\s*>" | sed -nr 's:^.*\s+password\s*=\s*:fakecolumn :p' | sed -nr 's:/?\s*>::p' | cut -d' ' -f2 | cut -d'"' -f2 | cut -d"'" -f2
o | execute: /usr/sbin/vcac-config prop-util -d --p "${VCAC_DB_ENCRYPTED_PASSWORD}" |
change ${VCAC_DB_ENCRYPTED_PASSWORD} with the output of the first command
o | copy the password |
2. | Enable none-SSL DB logging |
o | log into vRO as root |
o | go to /storage/db/pgdata |
o | edit pg_hba.conf by un-commenting line: host all all 127.0.0.1/32 md5 (note, if you're using clustered vRO you will need to add all nodes (e.g., vracafe01/32)) |
o | restart PostgreSQL service |
3. | Run the workflow "Add a database" |
o | Database type is: PostgreSQL |
o | Connection URL is : jdbc:postgresql://127.0.0.1:5433/vcac |
o | Session mode: Shared Session |
o | User name: vcac |
o | Password: use the one from point 1 |
You can add the vcac database by following these steps
1. | Getting the vRO DB password: |
o | go to Appliance Management Console, "Admin" tab and check: "SSH service enabled" and "Administrator SSH login enabled" |
o | log into vRO with "root" |
o | execute: xpath /etc/vcac/server.xml "//@password" 2>&1 | grep password | cut -d'"' -f2 |
or
(tr '\n' ' ' < /etc/vcac/server.xml | grep -Eo "<\s*Resource.*name\s*=\s*(\"|')jdbc/cafe(\"|')[^<]*/?\s*>" | sed -nr 's:^.*\s+password\s*=\s*:fakecolumn :p' | sed -nr 's:/?\s*>::p' | cut -d' ' -f2 | cut -d'"' -f2 | cut -d"'" -f2
o | execute: /usr/sbin/vcac-config prop-util -d --p "${VCAC_DB_ENCRYPTED_PASSWORD}" |
change ${VCAC_DB_ENCRYPTED_PASSWORD} with the output of the first command
o | copy the password |
2. | Enable none-SSL DB logging |
o | log into vRO as root |
o | go to /storage/db/pgdata |
o | edit pg_hba.conf by un-commenting line: host all all 127.0.0.1/32 md5 (note, if you're using clustered vRO you will need to add all nodes (e.g., vracafe01/32)) |
o | restart PostgreSQL service |
3. | Run the workflow "Add a database" |
o | Database type is: PostgreSQL |
o | Connection URL is : jdbc:postgresql://127.0.0.1:5433/vcac |
o | Session mode: Shared Session |
o | User name: vcac |
o | Password: use the one from point 1 |
Thanks for your reply !!!. it should be working fine.
Thanks,
KM