Skip to content
This repository was archived by the owner on Oct 29, 2023. It is now read-only.

sandbox macro operations

Giuseppe Maxia edited this page Nov 6, 2020 · 3 revisions

Sandbox macro operations

You can run a command in several sandboxes at once, using the global command, which propagates your command to all the installed sandboxes.

$ dbdeployer global -h 
This command can propagate the given action through all sandboxes.

Usage:
  dbdeployer global [command]

Examples:

	$ dbdeployer global use "select version()"
	$ dbdeployer global status
	$ dbdeployer global stop --version=5.7.27
	$ dbdeployer global stop --short-version=8.0
	$ dbdeployer global stop --short-version='!8.0' # or --short-version=no-8.0
	$ dbdeployer global status --port-range=5000-8099
	$ dbdeployer global start --flavor=percona
	$ dbdeployer global start --flavor='!percona' --type=single
	$ dbdeployer global metadata version --flavor='!percona' --type=single
	

Available Commands:
  metadata         Runs a metadata query in all sandboxes
  restart          Restarts all sandboxes
  start            Starts all sandboxes
  status           Shows the status in all sandboxes
  stop             Stops all sandboxes
  test             Tests all sandboxes
  test-replication Tests replication in all sandboxes
  use              Runs a query in all sandboxes

Flags:
      --dry-run                Show what would be executed, without doing it
      --flavor string          Runs command only in sandboxes of the given flavor
  -h, --help                   help for global
      --name string            Runs command only in sandboxes of the given name
      --port string            Runs commands only in sandboxes containing the given port
      --port-range string      Runs command only in sandboxes containing a port in the given range
      --short-version string   Runs command only in sandboxes of the given short version
      --type string            Runs command only in sandboxes of the given type
      --verbose                Show what is matched when filters are used
      --version string         Runs command only in sandboxes of the given version

Using global, you can see the status, start, stop, restart, test all sandboxes, or run SQL and metadata queries.

The global command accepts filters (as of version 1.44.0) to limit which sandboxes are affected.

$ dbdeployer global -h
This command can propagate the given action through all sandboxes.

Usage:
  dbdeployer global [command]

Examples:

	$ dbdeployer global use "select version()"
	$ dbdeployer global status
	$ dbdeployer global stop --version=5.7.27
	$ dbdeployer global stop --short-version=8.0
	$ dbdeployer global stop --short-version='!8.0' # or --short-version=no-8.0
	$ dbdeployer global status --port-range=5000-8099
	$ dbdeployer global start --flavor=percona
	$ dbdeployer global start --flavor='!percona' --type=single
	$ dbdeployer global metadata version --flavor='!percona' --type=single
	

Available Commands:
  metadata         Runs a metadata query in all sandboxes
  restart          Restarts all sandboxes
  start            Starts all sandboxes
  status           Shows the status in all sandboxes
  stop             Stops all sandboxes
  test             Tests all sandboxes
  test-replication Tests replication in all sandboxes
  use              Runs a query in all sandboxes

Flags:
      --dry-run                Show what would be executed, without doing it
      --flavor string          Runs command only in sandboxes of the given flavor
  -h, --help                   help for global
      --name string            Runs command only in sandboxes of the given name
      --port string            Runs commands only in sandboxes containing the given port
      --port-range string      Runs command only in sandboxes containing a port in the given range
      --short-version string   Runs command only in sandboxes of the given short version
      --type string            Runs command only in sandboxes of the given type
      --verbose                Show what is matched when filters are used
      --version string         Runs command only in sandboxes of the given version

The sandboxes can also be deleted, either one by one or all at once:

$ dbdeployer delete -h 
Halts the sandbox (and its depending sandboxes, if any), and removes it.
Warning: this command is irreversible!

Usage:
  dbdeployer delete sandbox_name (or "ALL") [flags]

Aliases:
  delete, remove, destroy

Examples:

	$ dbdeployer delete msb_8_0_4
	$ dbdeployer delete rsandbox_5_7_21

Flags:
      --concurrent     Runs multiple deletion tasks concurrently.
      --confirm        Requires confirmation.
  -h, --help           help for delete
      --skip-confirm   Skips confirmation with multiple deletions.
      --use-stop       Use 'stop' instead of 'send_kill destroy' to halt the database servers

You can lock one or more sandboxes to prevent deletion. Use this command to make the sandbox non-deletable.

$ dbdeployer admin lock sandbox_name

A locked sandbox will not be deleted, even when running dbdeployer delete ALL.

The lock can also be reverted using

$ dbdeployer admin unlock sandbox_name

Clone this wiki locally