dbdeployer MySQL沙盒部署详解

本文详细介绍了如何使用dbdeployer工具安装和管理MySQL沙盒环境,包括工具的下载、安装、基本使用方法、实例组操作以及常用管理命令,旨在帮助用户便捷地部署不同架构和版本的数据库环境。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、工具介绍

  • 前几日用mysql-sandbox来搭建MySQL8.0新版本时发现用不了,提示需要使用dbdeployer才行,瞬间觉得mysql-sandbox不香了,只好咬咬牙来熟悉dbdeployer了。
  • dbdeployer是使用go语言重构的sandbox,和sandbox同一个作者。
  • 当然,dbdeployer延续了sandbox所有功能。可实现一键部署不同架构、不同版本的数据库环境。如,MySQL 主从复制、GTID 模式复制、MySQL 组复制(单主模式、多主模式等)
  • 完整的数据库类型支持及版本,可在安装完 dbdeployer 后使用dbdeployer admin capabilities命令进行查看,以下是当前已支持数据库及组件类型
  1. – pxc (Percona XtraDB Cluster)
  2. – mysql-shell
  3. – mysql (MySQL server)
  4. – percona (Percona Server)
  5. – mariadb
  6. – tidb (TiDB isolated server)
  7. – ndb (MySQL NDB Cluster)

二、工具安装

  • OS:centos8
  • dbdeployer:1.54.0
  • mysql:8.0.20
2.1 dbdeployer工具下载

直接到github下载release包即可:

https://github.com/datacharmer/dbdeployer/releases

2.2 解压

软件解压后实际只有一个单独的编译好的可执行文件

tar -zxvf dbdeployer-1.54.0.linux.tar.gz
2.3 赋予可执行权限
chmod +x dbdeployer-1.54.0.linux
2.4 移动到系统可执行目录下方便使用
mv dbdeployer-1.54.0.linux /usr/local/bin/dbdeployer
2.5 验证是否可以使用
[root@db01 tmp]# dbdeployer --version
dbdeployer version 1.54.0
[root@db01 tmp]# 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
  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 "/root/opt/mysql")
      --sandbox-home string     Sandbox deployment directory (default "/root/sandboxes")
      --shell-path string       Which shell to use 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 "dbd
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值