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

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
datacharmer committed Mar 5, 2019
1 parent 60529bc commit 405c325
Show file tree
Hide file tree
Showing 5 changed files with 898 additions and 18 deletions.
43 changes: 37 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[DBdeployer](https://github.com/datacharmer/dbdeployer) is a tool that deploys MySQL database servers easily.
This is a port of [MySQL-Sandbox](https://github.com/datacharmer/mysql-sandbox), originally written in Perl, and re-designed from the ground up in [Go](https://golang.org). See the [features comparison](https://github.com/datacharmer/dbdeployer/blob/master/docs/features.md) for more detail.

Documentation updated for version 1.21.0 (05-Mar-2019 19:10 UTC)
Documentation updated for version 1.21.0 (05-Mar-2019 20:29 UTC)

[![Build Status](https://travis-ci.org/datacharmer/dbdeployer.svg "Travis CI status")](https://travis-ci.org/datacharmer/dbdeployer)

Expand Down Expand Up @@ -240,6 +240,7 @@ The ``deploy replication`` command will install a master and two or more slaves,
The replication command allows you to deploy several nodes in replication.
Allowed topologies are "master-slave" for all versions, and "group", "all-masters", "fan-in"
for 5.7.17+.
Topology "pcx" is available for binaries of type Percona Xtradb Cluster.
For this command to work, there must be a directory $HOME/opt/mysql/5.7.21, containing
the binary files from mysql-5.7.21-$YOUR_OS-x86_64.tar.gz
Use the "unpack" command to get the tarball into the right directory.
Expand All @@ -261,6 +262,7 @@ The ``deploy replication`` command will install a master and two or more slaves,
$ dbdeployer deploy --topology=group replication 8.0 --single-primary
$ dbdeployer deploy --topology=all-masters replication 5.7
$ dbdeployer deploy --topology=fan-in replication 5.7
$ dbdeployer deploy --topology=pxc replication pxc5.7.25

Flags:
Expand All @@ -278,6 +280,35 @@ The ``deploy replication`` command will install a master and two or more slaves,



As of version 1.21.0, you can use Percona Xtradb Cluster tarballs to deploy replication of type *pxc*. This deployment only works on Linux.

## Database server flavors

Before version 1.19.0, dbdeployer assumed that it was dealing to some version of MySQL, using the version to decide which features it would support. In version 1.19.0 dbdeployer started using the concept of **capabilities**, which is a combination of server **flavor** + a version. Some flavors currently supported are

* `mysql` : the classic MySQL server
* `percona` : Percona Server, any version. For the purposes of deployment, it has the same capabilities as MySQL
* `mariadb`: MariaDB server. Mostly the same as MySQL, but with differences in deployment methods.
* `pxc`: Percona Xtradb Cluster
* `tidb`: A stand-alone TiDB server.

To see what every flavor can do, you can use the command `dbdeployer admin capabilities`.

To see the features of a given flavor: `dbdeployer admin capabilities FLAVOR`.

And to see what a given version of a flavor can do, you can use `dbdeployer admin capabilities FLAVOR VERSION`.

For example

```shell
$ dbdeployer admin capabilities

$ dbdeployer admin capabilities percona

$ dbdeployer admin capabilities mysql 5.7.11
$ dbdeployer admin capabilities mysql 5.7.13
```

## Getting remote tarballs

As of version 1.16.0, dbdeployer can download remote MySQL tarballs from a Github repository. The tarball are reduced ones, created inside [Mysql-Docker-Minimal](https://github.com/datacharmer/mysql-docker-minimal).
Expand Down Expand Up @@ -427,11 +458,11 @@ You can deploy a single sandbox for a Percona server version 5.7.22 using any of
dbdeployer deploy single $HOME/opt/percona/5.7.22

#3
dbdeployer defaults update sandbox-binary $HOME/opt/percona
dbdeployer defaults update sandbox-binary $HOME/opt/percona
dbdeployer deploy single 5.7.22

#4
export SANDBOX_BINARY=$HOME/opt/percona
export SANDBOX_BINARY=$HOME/opt/percona
dbdeployer deploy single 5.7.22

Methods #1 and #2 are equivalent. They set the sandbox binary directory temporarily to a new one, and use it for the current deployement
Expand Down Expand Up @@ -587,15 +618,15 @@ For replication, you also have ``show_binlog`` and ``show_relaylog`` in every sa

In addition to enabling database logs, you can also have logs of the operations performed by dbdeployer when building and activating sandboxes.
The logs are disabled by default. You can enable them for a given operation using ``--log-sb-operations``. When the logs are enabled, dbdeployer will create one or more log files in a directory under ``$HOME/sandboxes/logs``.
For a single sandbox, the log directory will be named ``single_v_v_vv-xxxx``, where ``v_v_vv`` is the version number and ``xxxx`` is dbdeployer Process ID. Inside the directory, there will be a file names ``single.log``.
For a single sandbox, the log directory will be named ``single_v_v_vv-xxxx``, where ``v_v_vv`` is the version number and ``xxxx`` is dbdeployer Process ID. Inside the directory, there will be a file names ``single.log``.

For a replication sandbox, the directory will be named ``replication_v_v_vv-xxxx`` and it will contain at least 3 files: ``master-slave-replication.log`` with replication operations, and two single sandbox (one for master and one for a slave) logs named ``replication-node-x.log``. If there is more than one slave, each one will have its own log.

dbdeployer logs will record which function ran which operation, with the data used for single and compound sandboxes.

The name of the log is available inside the file ``sbdescription.json`` in each sandbox. If logging is disabled, the log field is not listed.

The logs are preserved until the corresponding sandbox is deleted.
The logs are preserved until the corresponding sandbox is deleted.

Logging can be enabled permanently using the defaults: ``dbdeployer defaults update log-sb-operations true``. Similarly, you can change the log-directory either for a single operation (``--log-directory=...``) or permanently (``dbdeployer defaults update log-directory /my/path/to/logs``)

Expand Down Expand Up @@ -981,7 +1012,7 @@ Should you need additional formats, though, dbdeployer is able to generate them

The executables containing ``-docs`` in their name have the same capabilities of the regular ones, but in addition they can run the *hidden* command ``tree``, with alias ``docs``.

This is the command used to help generating the API documentation.
This is the command used to help generating the API documentation.

$ dbdeployer-docs tree -h
This command is only used to create API documentation.
Expand Down
8 changes: 1 addition & 7 deletions cmd/replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,13 @@ func replicationSandbox(cmd *cobra.Command, args []string) {
}
}

// replicationCmd represents the replication command
var replicationCmd = &cobra.Command{
Use: "replication MySQL-Version",
//Args: cobra.ExactArgs(1),
Short: "create replication sandbox",
Long: `The replication command allows you to deploy several nodes in replication.
Allowed topologies are "master-slave" for all versions, and "group", "all-masters", "fan-in"
for 5.7.17+.
for 5.7.17+.
Topology "pcx" is available for binaries of type Percona Xtradb Cluster.
For this command to work, there must be a directory $HOME/opt/mysql/5.7.21, containing
the binary files from mysql-5.7.21-$YOUR_OS-x86_64.tar.gz
Expand All @@ -112,12 +111,7 @@ Use the "unpack" command to get the tarball into the right directory.
}

func init() {
// rootCmd.AddCommand(replicationCmd)
deployCmd.AddCommand(replicationCmd)
//replicationCmd.PersistentFlags().StringSliceP("master-options", "", "", "Extra options for the master")
//replicationCmd.PersistentFlags().StringSliceP("slave-options", "", "", "Extra options for the slaves")
//replicationCmd.PersistentFlags().StringSliceP("node-options", "", "", "Extra options for all nodes")
//replicationCmd.PersistentFlags().StringSliceP("one-node-options", "", "", "Extra options for one node (format #:option)")
replicationCmd.PersistentFlags().StringP(globals.MasterListLabel, "", globals.MasterListValue, "Which nodes are masters in a multi-source deployment")
replicationCmd.PersistentFlags().StringP(globals.SlaveListLabel, "", globals.SlaveListValue, "Which nodes are slaves in a multi-source deployment")
replicationCmd.PersistentFlags().StringP(globals.MasterIpLabel, "", globals.MasterIpValue, "Which IP the slaves will connect to")
Expand Down
Loading

0 comments on commit 405c325

Please sign in to comment.