Coder Social home page Coder Social logo

mysql-cluster's Introduction

Role Name

=========

MySQL-cluster to deploy MySql cluster on docker.

Requirements


    python >= 2.6
    docker-py >= 1.7.0
    Docker API >= 1.20

Role Variables


docker_network_name: mysql-cluster-net
MyNewPass: TopSecret
DBLIST:
  - name: "MySqlDb1"
  - name: "MySqlDb2"
  - name: "MySqlDb3"

Dependencies


No Galaxy roles required  

Example Playbook

    - hosts: database
      roles:
        - role: MySQL-cluster
          become: yes

Playbook Run


Installation & validation

ansible-playbook -i inventories/mysql-cluster-inventory mysql-cluster.yml -vv

Installation

ansible-playbook -i inventories/mysql-cluster-inventory mysql-cluster.yml --tags=installation -vv

validation

ansible-playbook -i inventories/mysql-cluster-inventory mysql-cluster.yml --tags=validation -vv

Test

obtain password:

docker logs mysql1 2>&1 | grep PASSWORD | awk '{print $5}'

login as root:

docker exec -it mysql1 mysql -uroot -p'********************' 

list Databases:

docker exec -i mysql1 mysql -uroot -p'****************' -e 'show databases;'

connect to Database:

docker exec -it mysql1 mysql -uroot -p'****************' MySqlDb2

create table batch mode:

docker exec -i mysql1 mysql -uroot -p'*****************' MySqlDb2 < create_pet_table.sql

load data to pet table:

copy pet.txt to container
cd MySQL-cluster/tests
docker cp pet.txt mysql1:/tmp/pet.txt
validate file copied to mysql1 containet:
docker exec -i mysql1 cat /tmp/pet.txt
load data to pet table and validate it got populated:
docker exec -i mysql1 mysql -uroot -p'***********' MySqlDb2 < load_data_to_pet_table.sql

License

BSD

Author Information

Eng. Amit Bachar [email protected]

mysql-cluster's People

Contributors

amitbachar 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.