Need information for performing housekeeping tasks on mariadb from a remote machine

Mark Shuttleworth mark at ubuntu.com
Wed Jun 15 04:04:06 UTC 2016


On 14/06/16 20:49, Daniel Bartholomew wrote:
> I use the juju ssh command to ssh into my deployed MariaDB units. For example:
>
> juju ssh mariadb/0

That would work.
> There might be a better way to set it up, but I'm not enough of a juju
> expert to know.

Another way is to make a script that does this operation, and include it
in the charm as an "action".

An action is a hook that can be invoked by the operator. It can take
parameters as a YAML structure. So in this case you could create an
action "clear-db" which does this. You submit that to the mariadb charm.

Then the operator can just do:

  juju run-action mariadb/1 clear-db

An action can produce output which can be fetched later, and it can
provide a status so the operator will know when it is done.

Any common operation, like "backup the database" or "checkpoint the SAN
filesystems" would be welcome as an action.

Mark




More information about the Juju mailing list