cookbook

package
v1.73.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2023 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

DBDeployer - The MySQL Sandbox Copyright © 2006-2019 Giuseppe Maxia

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	CookbookInclude       = "cookbook_include.sh"
	CookbookPrerequisites = "prerequisites.sh"
)

Variables

View Source
var (
	AuxiliaryRecipes        = []string{"prerequisites", "include"}
	PrerequisitesShown bool = false
)
View Source
var RecipesList = RecipesCollection{
	"include": RecipeTemplate{
		ScriptName:  CookbookInclude,
		Description: "common code for all recipes",
		Contents:    recipeInclude,
	},
	"single": RecipeTemplate{
		Description:  "Creation of a single sandbox",
		ScriptName:   "single-deployment.sh",
		Contents:     singleTemplate,
		IsExecutable: true,
	},
	"skip-start-single": RecipeTemplate{
		Description:  "Single sandbox deployed without starting the server",
		ScriptName:   "skip-start-single.sh",
		Contents:     singleSkipStartTemplate,
		IsExecutable: true,
	},
	"skip-start-replication": RecipeTemplate{
		Description:  "Replication sandbox deployed without starting the servers",
		ScriptName:   "skip-start-replication.sh",
		Contents:     replicationSkipStartTemplate,
		IsExecutable: true,
	},
	"custom-named-replication": RecipeTemplate{
		Description:  "Replication sandbox with custom names for directories and scripts",
		ScriptName:   "custom-named-replication.sh",
		Contents:     customReplicationDeployment,
		IsExecutable: true,
	},
	"custom-users": RecipeTemplate{
		Description:    "Single sandbox with custom users",
		ScriptName:     "single-custom-users.sh",
		Contents:       singleCustomUsersTemplate,
		RequiredFlavor: common.MySQLFlavor,
		IsExecutable:   true,
	},
	"admin": RecipeTemplate{
		Description:    "Single sandbox with admin address enabled",
		ScriptName:     "admin-single.sh",
		Contents:       adminPortTemplate,
		RequiredFlavor: common.MySQLFlavor,
		IsExecutable:   true,
	},
	"single-reinstall": RecipeTemplate{
		Description:  "Re-installs a single sandbox",
		ScriptName:   "single-reinstall.sh",
		Contents:     singleReinstallTemplate,
		IsExecutable: true,
	},
	"show": RecipeTemplate{
		Description:  "Show deployed sandboxes",
		ScriptName:   "show-sandboxes.sh",
		Contents:     showSandboxes,
		IsExecutable: true,
	},
	"delete": RecipeTemplate{
		Description:  "Delete all deployed sandboxes",
		ScriptName:   "delete-sandboxes.sh",
		Contents:     deleteAll,
		IsExecutable: true,
	},
	"master-slave": RecipeTemplate{
		Description:  "Creation of a master/slave replication sandbox",
		ScriptName:   "master-slave-deployment.sh",
		Contents:     masterSlaveDeployment,
		IsExecutable: true,
	},
	"fan-in": RecipeTemplate{
		Description:    "Creation of a fan-in (many masters, one slave) replication sandbox",
		ScriptName:     "fan-in-deployment.sh",
		Contents:       fanInDeployment,
		RequiredFlavor: common.MySQLFlavor,
		IsExecutable:   true,
	},
	"all-masters": RecipeTemplate{
		Description:    "Creation of an all-masters replication sandbox",
		ScriptName:     "all-masters-deployment.sh",
		Contents:       allMastersDeployment,
		RequiredFlavor: common.MySQLFlavor,
		IsExecutable:   true,
	},
	"group-multi": RecipeTemplate{
		Description:    "Creation of a multi-primary group replication sandbox",
		ScriptName:     "group-multi-primary-deployment.sh",
		Contents:       groupMultiPrimaryDeployment,
		RequiredFlavor: common.MySQLFlavor,
		IsExecutable:   true,
	},
	"group-single": RecipeTemplate{
		Description:    "Creation of a single-primary group replication sandbox",
		ScriptName:     "group-single-primary-deployment.sh",
		Contents:       groupSinglePrimaryDeployment,
		RequiredFlavor: common.MySQLFlavor,
		IsExecutable:   true,
	},
	"replication-restart": RecipeTemplate{
		Description:  "Show how to restart sandboxes with custom options",
		ScriptName:   "repl-operations-restart.sh",
		Contents:     replicationRestart,
		IsExecutable: true,
	},
	"replication-operations": RecipeTemplate{
		Description:  "Show how to run operations in a replication sandbox",
		ScriptName:   "repl-operations.sh",
		Contents:     replicationOperations,
		IsExecutable: true,
	},
	"upgrade": RecipeTemplate{
		Description:    "Shows a complete upgrade example from 5.5 to 8.0",
		ScriptName:     "upgrade.sh",
		Contents:       upgradeTemplate,
		RequiredFlavor: common.MySQLFlavor,
		IsExecutable:   true,
	},
	"tidb": RecipeTemplate{
		Description:    "Shows deployment and some operations with TiDB",
		ScriptName:     "tidb-deployment.sh",
		Contents:       tidbDeployment,
		RequiredFlavor: common.TiDbFlavor,
		IsExecutable:   true,
	},
	"ndb": RecipeTemplate{
		Description:    "Shows deployment with ndb",
		ScriptName:     "ndb-deployment.sh",
		Contents:       ndbDeployment,
		RequiredFlavor: common.NdbFlavor,
		IsExecutable:   true,
	},
	"pxc": RecipeTemplate{
		Description:    "Shows deployment with pxc",
		ScriptName:     "pxc-deployment.sh",
		Contents:       pxcDeployment,
		RequiredFlavor: common.PxcFlavor,
		IsExecutable:   true,
	},
	"remote": RecipeTemplate{
		Description:  "Shows how to get a remote MySQL tarball",
		ScriptName:   "remote.sh",
		Contents:     remoteOperations,
		IsExecutable: true,
	},
	"prerequisites": RecipeTemplate{
		Description:  "Shows dbdeployer prerequisites and how to make them",
		ScriptName:   CookbookPrerequisites,
		Contents:     prerequisites,
		IsExecutable: true,
	},
	"replication_between_groups": RecipeTemplate{
		Description:    "Shows how to run replication between two group replications",
		ScriptName:     "replication-between-groups.sh",
		Contents:       replicationBetweenGroups,
		RequiredFlavor: common.MySQLFlavor,
		IsExecutable:   true,
	},
	"replication_between_master_slave": RecipeTemplate{
		Description:  "Shows how to run replication between two master/slave replications",
		ScriptName:   "replication-between-master-slave.sh",
		Contents:     replicationBetweenMasterSlave,
		IsExecutable: true,
	},
	"replication_between_ndb": RecipeTemplate{
		Description:    "Shows how to run replication between two NDB clusters",
		ScriptName:     "replication-between-ndb.sh",
		Contents:       replicationBetweenNdb,
		RequiredFlavor: common.NdbFlavor,
		IsExecutable:   true,
	},
	"replication_multi_versions": RecipeTemplate{
		Description:  "Shows how to run replication between different MySQL versions",
		ScriptName:   "replication-multi-versions.sh",
		Contents:     replicationBetweenDiffVersions,
		IsExecutable: true,
	},
	"replication_group_single": RecipeTemplate{
		Description:    "Shows how to run replication between a group replication and a single sandbox",
		ScriptName:     "replication-group-single.sh",
		Contents:       replicationGroupSingle,
		RequiredFlavor: common.MySQLFlavor,
		IsExecutable:   true,
	},
	"replication_single_group": RecipeTemplate{
		Description:    "Shows how to run replication between a single sandbox an group replication",
		ScriptName:     "replication-single-group.sh",
		Contents:       replicationSingleGroup,
		RequiredFlavor: common.MySQLFlavor,
		IsExecutable:   true,
	},
	"replication_between_single": RecipeTemplate{
		Description:  "Shows how to run replication between two single sandboxes",
		ScriptName:   "replication-between-single.sh",
		Contents:     replicationBetweenSingle,
		IsExecutable: true,
	},
	"circular_replication": RecipeTemplate{
		Description:  "Shows how to run replication between nodes of a multiple deployment",
		ScriptName:   "circular-replication.sh",
		Contents:     circularReplication,
		IsExecutable: true,
	},
	"replication_group_master_slave": RecipeTemplate{
		Description:    "Shows how to run replication between a group replication and master/slave replication",
		ScriptName:     "replication-group-master-slave.sh",
		Contents:       replicationGroupMasterSlave,
		RequiredFlavor: common.MySQLFlavor,
		IsExecutable:   true,
	},
	"replication_master_slave_group": RecipeTemplate{
		Description:    "Shows how to run replication between master/slave replication and group replication",
		ScriptName:     "replication-master-slave-group.sh",
		Contents:       replicationMasterSlaveGroup,
		RequiredFlavor: common.MySQLFlavor,
		IsExecutable:   true,
	},
}

Functions

func CreateRecipe

func CreateRecipe(recipeName, flavor string)

func GetRecipe

func GetRecipe(recipeName, flavor string) (string, int, error)

func ListRecipes

func ListRecipes(flavor, sortBy string)

func ShowRecipe

func ShowRecipe(recipeName string, flavor string, raw bool)

Types

type ByFlavorAndName added in v1.28.0

type ByFlavorAndName []TemplateSort

func (ByFlavorAndName) Len added in v1.28.0

func (a ByFlavorAndName) Len() int

func (ByFlavorAndName) Less added in v1.28.0

func (a ByFlavorAndName) Less(i, j int) bool

func (ByFlavorAndName) Swap added in v1.28.0

func (a ByFlavorAndName) Swap(i, j int)

type ByName added in v1.28.0

type ByName []TemplateSort

func (ByName) Len added in v1.28.0

func (a ByName) Len() int

func (ByName) Less added in v1.28.0

func (a ByName) Less(i, j int) bool

func (ByName) Swap added in v1.28.0

func (a ByName) Swap(i, j int)

type ByScriptName added in v1.26.0

type ByScriptName []TemplateSort

func (ByScriptName) Len added in v1.26.0

func (a ByScriptName) Len() int

func (ByScriptName) Less added in v1.26.0

func (a ByScriptName) Less(i, j int) bool

func (ByScriptName) Swap added in v1.26.0

func (a ByScriptName) Swap(i, j int)

type RecipeTemplate

type RecipeTemplate struct {
	Description    string
	ScriptName     string
	Notes          string
	Contents       string
	RequiredFlavor string
	IsExecutable   bool
}

type RecipesCollection

type RecipesCollection map[string]RecipeTemplate

type TemplateSort added in v1.26.0

type TemplateSort struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL