Git Product home page Git Product logo

docker-mysql-proxysql's Introduction

ProxySQL / Orchestrator / MySQL Docker Testing

This repository contains a docker-compose.yml used to launch a small cluster consisting of 3x MySQL 5.7 containers (1x Master and 2x Slaves), 3x Orchestrator nodes connected via RAFT and a ProxySQL 2.x container all connected via a frontend / backend network. ProxySQL is automatically configured with 2x hostgroups, a writer hostgroup used as the default hostgroup and a reader hostgroup for all SELECT statements.

Once the cluster is initialised, replication is started and a sysbench dataset is prepared. After that a short sysbench test is executed automatically. To launch a new cluster for the FIRST TIME please execute the following command:

# To start with benchmarks:
sudo ./docker-compose-init.bash

# To skip benchmarking:
sudo ./docker-compose-init.bash nobench

Thereafter you can just start and stop the cluster with regular docker-compose commands, for example:

sudo docker-compose stop
sudo docker-compose start

To stop the instances and destroy the containers execute:

sudo ./docker-compose-destroy.bash

The MySQL, Orchestrator and ProxySQL hosts have separate directories with their respective configuration in the conf directory. You can override any of the MySQL 5.7 variables by editing the my.cnf located in the respective subdirectory under conf for each container (i.e. conf/mysql/mysql1/my.cnf, conf/mysql/mysql2/my.cnf or conf/mysql/mysql3/my.cnf). Its also possible to edit the ProxySQL and Orchestrator config files as needed.

Note that you'll want the following pre-requisites installed on your host machine:

  • docker-ce / docker-ee (17.12+ required)
  • docker-compose (1.19+ required)
  • mysql-client (5.7+ required)
  • sysbench (1.0.12+ recommended if benchmarking)
  • orchestrator-client (3.0.8+ recommended if administering Orchestrator via CLI)
  • jq (required for Orchestrator)

In addition if you prefer not to use docker-compose you'll also find some scripts for launching the MySQL and ProxySQL instances without docker-compose in the legacy/ directory:

  • legacy/docker-mysql.bash
  • legacy/docker-proxysql.bash

If you would like to run the benchmark just execute:

bin/docker-benchmark.bash

This script will drop / create the sysbench database, create a test dataset and run the benchmark. You can edit the file and tailor this behaviour as you would like. Please be aware that this is called during the provisioning stage so its best to make a copy of the file with your own benchmarks.

docker-mysql-proxysql's People

Contributors

dtest avatar ggunson avatar pondix avatar renecannao avatar spachev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.