dbdeployer 快速部署mysql

$ curl -s https://raw.githubusercontent.com/datacharmer/dbdeployer/master/scripts/dbdeployer-install.sh | bash

$ yun install  base_completion

$ dbdeployer init

SANDBOX_BINARY /root/opt/mysql
SANDBOX_HOME   /root/sandboxes

--------------------------------------------------------------------------------
Directory /root/opt/mysql ($SANDBOX_BINARY) already exists
This directory is the destination for expanded tarballs

--------------------------------------------------------------------------------
Directory /root/sandboxes ($SANDBOX_HOME) already exists 
This directory is the destination for deployed sandboxes

--------------------------------------------------------------------------------
# dbdeployer defaults enable-bash-completion --run-it --remote
Error: none of bash completion scripts found ([/etc/bash_completion /usr/local/etc/bash_completion /etc/profile.d/bash_completion.sh])
Usage:
  dbdeployer init [flags]

Flags:
      --dry-run                 Show operations but don't run them
  -h, --help                    help for init
      --skip-all-downloads      Do not download any file (skip both MySQL tarball and shell completion file)
      --skip-shell-completion   Do not download shell completion file
      --skip-tarball-download   Do not download MySQL tarball

Global Flags:
      --config string           configuration file (default "/root/.dbdeployer/config.json")
      --sandbox-binary string   Binary repository (default "/root/opt/mysql")
      --sandbox-home string     Sandbox deployment directory (default "/root/sandboxes")
      --shell-path string       Path to Bash, used for generated scripts (default "/usr/bin/bash")
      --skip-library-check      Skip check for needed libraries (may cause nasty errors)

none of bash completion scripts found ([/etc/bash_completion /usr/local/etc/bash_completion /etc/profile.d/bash_completion.sh])

---更改默认的路径配置  

$ dbdeployer defaults update sandbox-binary /home/opt/mysql

$ dbdeployer defaults update sandbox-home /home/sandbox

---更改配置

$vi /root/.dbdeployer/config.json

"sandbox-home": "/home/sandboxes",
"sandbox-binary": "/home/opt/mysql",

$ dbdeployer defaults store  
  # Default values exported to /root/.dbdeployer/config.json

 

---快速部署

$ dbdeployer deploy single 8.0.27   --port=8027

Database installed in /home/sandboxes/msb_8_0_27
run 'dbdeployer usage single' for basic instructions'
.. sandbox server started

# cd /home/sandboxes/msb_8_0_27/
# ./use
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.27 MySQL Community Server - GPL

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql [localhost:8027] {msandbox} ((none)) >

 

 ---帮助信息

# dbdeployer --help
dbdeployer makes MySQL server installation an easy task.
Runs single, multiple, and replicated sandboxes.

Usage:
  dbdeployer [command]

Available Commands:
  admin           sandbox management tasks
  cookbook        Shows dbdeployer samples
  data-load       tasks related to dbdeployer data loading
  defaults        tasks related to dbdeployer defaults
  delete          delete an installed sandbox
  delete-binaries delete an expanded tarball
  deploy          deploy sandboxes
  downloads       Manages remote tarballs
  export          Exports the command structure in JSON format
  global          Runs a given command in every sandbox
  help            Help about any command
  import          imports one or more MySQL servers into a sandbox
  info            Shows information about dbdeployer environment samples
  init            initializes dbdeployer environment
  sandboxes       List installed sandboxes
  unpack          unpack a tarball into the binary directory
  update          Gets dbdeployer newest version
  usage           Shows usage of installed sandboxes
  use             uses a sandbox
  versions        List available versions

Flags:
      --config string           configuration file (default "/root/.dbdeployer/config.json")
  -h, --help                    help for dbdeployer
      --sandbox-binary string   Binary repository (default "/home/sandboxes/msb_8_0_27/opt/mysql")
      --sandbox-home string     Sandbox deployment directory (default "/home/sandboxes/msb_8_0_27/sandboxes")
      --shell-path string       Path to Bash, used for generated scripts (default "/usr/bin/bash")
      --skip-library-check      Skip check for needed libraries (may cause nasty errors)
  -v, --version                 version for dbdeployer

Use "dbdeployer [command] --help" for more information about a command.

 ---该版本可支持下载的mysql版本

# dbdeployer downloads list
Available tarballs  ()
                              name                                 OS     version     flavor        size   minimal 
---------------------------------------------------------------- ------- --------- ------------- -------- ---------
 Percona-Server-8.0.20-11-Linux.x86_64.glibc2.12-minimal.tar.gz   Linux    8.0.20   percona       103 MB   Y       
 Percona-Server-8.0.21-12-Linux.x86_64.glibc2.12-minimal.tar.gz   Linux    8.0.21   percona       104 MB   Y       
 Percona-Server-8.0.22-13-Linux.x86_64.glibc2.17-minimal.tar.gz   linux    8.0.22   percona       107 MB   Y       
 Percona-Server-8.0.23-14-Linux.x86_64.glibc2.17-minimal.tar.gz   Linux    8.0.23   percona       108 MB   Y       
 Percona-Server-8.0.26-16-Linux.x86_64.glibc2.12-minimal.tar.gz   linux    8.0.26   percona       104 MB   Y       
 mysql-4.1.22.tar.xz                                              Linux    4.1.22   mysql         4.6 MB   Y       
 mysql-5.0.96-linux-x86_64-glibc23.tar.gz                         Linux    5.0.96   mysql         127 MB           
 mysql-5.0.96.tar.xz                                              Linux    5.0.96   mysql         5.5 MB   Y       
 mysql-5.1.72.tar.xz                                              Linux    5.1.72   mysql          10 MB   Y       
 mysql-5.1.73-linux-x86_64-glibc23.tar.gz                         Linux    5.1.73   mysql         134 MB           
 mysql-5.5.61-linux-glibc2.12-x86_64.tar.gz                       Linux    5.5.61   mysql         199 MB           
 mysql-5.5.61.tar.xz                                              Linux    5.5.61   mysql         6.6 MB   Y       
 mysql-5.5.62-linux-glibc2.12-x86_64.tar.gz                       Linux    5.5.62   mysql         199 MB           
 mysql-5.5.62.tar.xz                                              Linux    5.5.62   mysql         6.6 MB   Y       
 mysql-5.6.43-linux-glibc2.12-x86_64.tar.gz                       Linux    5.6.43   mysql         329 MB           
 mysql-5.6.43.tar.xz                                              Linux    5.6.43   mysql         9.0 MB   Y       
 mysql-5.6.44-linux-glibc2.12-x86_64.tar.gz                       Linux    5.6.44   mysql         329 MB           
 mysql-5.6.44.tar.xz                                              Linux    5.6.44   mysql         9.1 MB   Y       
 mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz                       Linux    5.7.25   mysql         645 MB           
 mysql-5.7.25.tar.xz                                              Linux    5.7.25   mysql          23 MB   Y       
 mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz                       Linux    5.7.26   mysql         645 MB           
 mysql-5.7.26.tar.xz                                              Linux    5.7.26   mysql          23 MB   Y       
 mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz                       Linux    5.7.27   mysql         645 MB           
 mysql-5.7.28-linux-glibc2.12-x86_64.tar.gz                       Linux    5.7.28   mysql         725 MB           
 mysql-5.7.29-linux-glibc2.12-x86_64.tar.gz                       Linux    5.7.29   mysql         665 MB           
 mysql-5.7.30-linux-glibc2.12-x86_64.tar.gz                       Linux    5.7.30   mysql         660 MB           
 mysql-5.7.31-linux-glibc2.12-x86_64.tar.gz                       Linux    5.7.31   mysql         376 MB           
 mysql-5.7.34-linux-glibc2.12-x86_64.tar.gz                       Linux    5.7.34   mysql         665 MB           
 mysql-8.0.13-linux-glibc2.12-x86_64.tar.xz                       Linux    8.0.13   mysql         394 MB           
 mysql-8.0.15-linux-glibc2.12-x86_64.tar.xz                       Linux    8.0.15   mysql         376 MB           
 mysql-8.0.16-linux-glibc2.12-x86_64.tar.xz                       Linux    8.0.16   mysql         461 MB           
 mysql-8.0.16-linux-x86_64-minimal.tar.xz                         Linux    8.0.16   mysql          44 MB   Y       
 mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz                       Linux    8.0.17   mysql         480 MB           
 mysql-8.0.17-linux-x86_64-minimal.tar.xz                         Linux    8.0.17   mysql          45 MB   Y       
 mysql-8.0.18-linux-glibc2.12-x86_64.tar.xz                       Linux    8.0.18   mysql         504 MB           
 mysql-8.0.18-linux-x86_64-minimal.tar.xz                         Linux    8.0.18   mysql          48 MB   Y       
 mysql-8.0.19-linux-x86_64-minimal.tar.xz                         Linux    8.0.19   mysql          45 MB           
 mysql-8.0.20-linux-x86_64-minimal.tar.xz                         Linux    8.0.20   mysql          44 MB   Y       
 mysql-8.0.21-linux-glibc2.17-x86_64-minimal.tar.xz               Linux    8.0.21   mysql          48 MB   Y       
 mysql-8.0.22-linux-glibc2.17-x86_64-minimal.tar.xz               Linux    8.0.22   mysql          51 MB   Y       
 mysql-8.0.23-linux-glibc2.17-x86_64-minimal.tar.xz               Linux    8.0.23   mysql          52 MB   Y       
 mysql-8.0.24-linux-glibc2.17-x86_64-minimal.tar.xz               Linux    8.0.24   mysql          51 MB   Y       
 mysql-8.0.25-linux-glibc2.12-x86_64.tar.xz                       Linux    8.0.25   mysql         896 MB           
 mysql-8.0.25-linux-glibc2.17-x86_64-minimal.tar.xz               Linux    8.0.25   mysql          51 MB   Y       
 mysql-8.0.26-linux-glibc2.12-x86_64.tar.xz                       Linux    8.0.26   mysql         915 MB           
 mysql-8.0.26-linux-glibc2.17-x86_64-minimal-rebuild.tar.xz       Linux    8.0.26   mysql          52 MB   Y       
 mysql-8.0.27-linux-glibc2.12-x86_64.tar.xz                       Linux    8.0.27   mysql         1.2 GB           
 mysql-8.0.27-linux-glibc2.17-x86_64-minimal.tar.xz               Linux    8.0.27   mysql          52 MB   Y       
 mysql-cluster-8.0.16-dmr-linux-glibc2.12-x86_64.tar.gz           Linux    8.0.16   ndb           1.1 GB           
 mysql-cluster-8.0.17-rc-linux-glibc2.12-x86_64.tar.gz            Linux    8.0.17   ndb           1.1 GB           
 mysql-cluster-8.0.19-linux-glibc2.12-x86_64.tar.gz               Linux    8.0.19   ndb           1.2 GB           
 mysql-cluster-8.0.20-linux-glibc2.12-x86_64.tar.gz               Linux    8.0.20   ndb           1.2 GB           
 mysql-cluster-8.0.22-linux-glibc2.12-x86_64.tar.gz               Linux    8.0.22   ndb           1.3 GB           
 mysql-cluster-8.0.23-linux-glibc2.12-x86_64.tar.gz               Linux    8.0.23   ndb           1.3 GB           
 mysql-cluster-8.0.24-linux-glibc2.12-x86_64.tar.gz               Linux    8.0.24   ndb           1.4 GB           
 mysql-cluster-8.0.25-linux-glibc2.12-x86_64.tar.gz               Linux    8.0.25   ndb           1.4 GB           
 mysql-cluster-8.0.26-linux-glibc2.12-x86_64.tar.gz               Linux    8.0.26   ndb           1.4 GB           
 mysql-cluster-8.0.27-linux-glibc2.12-x86_64.tar.gz               Linux    8.0.27   ndb           1.9 GB           
 mysql-cluster-gpl-7.6.10-linux-glibc2.12-x86_64.tar.gz           Linux    7.6.10   ndb           916 MB           
 mysql-cluster-gpl-7.6.11-linux-glibc2.12-x86_64.tar.gz           Linux    7.6.11   ndb           916 MB           
 mysql-shell-8.0.17-linux-glibc2.12-x86-64bit.tar.gz              Linux    8.0.17   mysql-shell    30 MB           
 mysql-shell-8.0.21-linux-glibc2.12-x86-64bit.tar.gz              Linux    8.0.21   shell          43 MB           
 mysql-shell-8.0.22-linux-glibc2.12-x86-64bit.tar.gz              Linux    8.0.22   shell          42 MB           
 mysql-shell-8.0.23-linux-glibc2.12-x86-64bit.tar.gz              Linux    8.0.23   shell          44 MB           
 mysql-shell-8.0.24-linux-glibc2.12-x86-64bit.tar.gz              Linux    8.0.24   shell          42 MB           
 mysql-shell-8.0.25-linux-glibc2.12-x86-64bit.tar.gz              Linux    8.0.25   shell          42 MB           
 mysql-shell-8.0.26-linux-glibc2.12-x86-64bit.tar.gz              Linux    8.0.26   shell          46 MB           
 mysql-shell-8.0.27-linux-glibc2.12-x86-64bit.tar.gz              Linux    8.0.27   shell          44 MB           
 tidb-master-linux-amd64.tar.gz                                   Linux     3.0.0   tidb           26 MB           
# dbdeployer downloads --help
Manages remote tarballs

Usage:
  dbdeployer downloads [command]

Available Commands:
  add            Adds a tarball to the list
  add-remote     Adds a tarball to the list, by searching MySQL downloads site 
  export         Exports the list of tarballs to a file
  get            Downloads a remote tarball
  get-by-version Downloads a remote tarball
  get-unpack     Downloads and unpacks a remote tarball
  import         Imports the list of tarballs from a file or URL
  list           list remote tarballs
  reset          Reset the custom list of tarballs and resume the defaults
  show           Downloads a remote tarball
  tree           Display a tree by version of remote tarballs

Flags:
  -h, --help   help for downloads

Global Flags:
      --config string           configuration file (default "/root/.dbdeployer/config.json")
      --sandbox-binary string   Binary repository (default "/home/sandboxes/msb_8_0_27/opt/mysql")
      --sandbox-home string     Sandbox deployment directory (default "/home/sandboxes/msb_8_0_27/sandboxes")
      --shell-path string       Path to Bash, used for generated scripts (default "/usr/bin/bash")
      --skip-library-check      Skip check for needed libraries (may cause nasty errors)

Use "dbdeployer downloads [command] --help" for more information about a command.

  

 

https://github.com/datacharmer/dbdeployer/wiki/installation

posted @ 2022-05-08 18:18  Jiangqiang  阅读(75)  评论(0编辑  收藏  举报