From 678cdfa97009b8eb47a13b3379ef792615c23711 Mon Sep 17 00:00:00 2001 From: kathap <30441792+kathap@users.noreply.github.com> Date: Mon, 14 Nov 2022 14:26:14 +0100 Subject: [PATCH] Add how to connect to PostgreSQL ccdb To connect from the jumpbox to postgres ccdb the steps are a not 100% the same as for MySQL. --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 22946f980..31a0a2459 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,17 @@ bosh -d cf scp database:/usr/local/bin/mysql . ``` From the mysql command prompt, you can e.g. use `source db.sql` to read and execute statements from a file. +### Connect to the CCDB: PostgreSQL +If you have deployed a test environment with PostgreSQL as the Cloud Controller's database, you can open a tunnel to the jumpbox and then connect from there. Initialise `bbl` as explained above and then run: +```bash +ssh -4 -N -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" -o "ServerAliveInterval=30" -o "ServerAliveCountMax=10" -o "IPQoS=throughput" \ + -i "$JUMPBOX_PRIVATE_KEY" -L "5524:10.0.16.5:5524" jumpbox@ & +apt-get update +apt-get install postgresql +psql --host=127.0.0.1 --port=5524 --user=cloud_controller cloud_controller +# enter password for +``` + ## Troubleshooting The tests are fully automated, but some of the following techniques might help if you need to debug a failure: