Charmed PostgreSQL Tutorial | 2. Deploy PostgreSQL

Charmed PostgreSQL VM Tutorial > 2. Deploy PostgreSQL

Deploy Charmed PostgreSQL VM

In this section, you will deploy Charmed PostgreSQL VM, access a unit, and interact with the PostgreSQL databases that exist inside the application.

Deploy PostgreSQL

To deploy Charmed PostgreSQL, run

juju deploy postgresql

Juju will now fetch Charmed PostgreSQL VM from Charmhub and deploy it to the LXD cloud. This process can take several minutes depending on how provisioned (RAM, CPU, etc) your machine is.

You can track the progress by running:

juju status --watch 1s

This command is useful for checking the real-time information about the state of a charm and the machines hosting it. Check the juju status documentation for more information about its usage.

When the application is ready, juju status will show something similar to the sample output below:

Model     Controller  Cloud/Region         Version  SLA          Timestamp
tutorial  overlord    localhost/localhost  3.1.7    unsupported  09:41:53+01:00

App         Version  Status  Scale  Charm       Channel    Rev  Exposed  Message
postgresql           active      1  postgresql  14/stable  281  no       

Unit           Workload  Agent  Machine  Public address  Ports  Message
postgresql/0*  active    idle   0        10.89.49.129           

Machine  State    Address       Inst id        Series  AZ  Message
0        started  10.89.49.129  juju-a8a31d-0  jammy       Running

You can also watch juju logs with the juju debug-log command. More info on logging in the juju logs documentation.

I just tried deploying from the 14/stable channel and the instance doesn’t seem to have that installed, but does have charmed-postgresql.psql installed per this pastebin.

Dear Tom, thank you for the report! The documentation created before the migration to SNAP, as a result the proper binary now is charmed-postgresql.psql, while I agree it is not very user friendly.

We are going to add SNAP aliases for both postrgresql and mysql charms. Once again, than you for noticing and reporting back!

1 Like

This doesn’t seem to work right now with the 14/stable series charm; I’m having problems with charmed-postgresql.psql not being able to open sockets. I’ve filed a bug: Bug #2031195 “charmed-postgresql.psql not working for login to p...” : Bugs : PostgreSQL Charm

Nevermind - as pointed out by the person who replied on that bug, it does work with the 14/edge charm, plus there is an appropriate alias from psql to charmed-postgresql.psql in that version.

The one other issue I see here is that the “run-action” command is correct for Juju < 3.x, but is now “run” in Juju >= 3.x. As everything seems to be moving away from Juju 2.x, it seems worth calling out.

1 Like