Coder Social home page Coder Social logo

tidb-ansible's Introduction

Ansible Playbook for TiDB

TIDB IS NOT RECOMMENDED TO RUN AS ROOT

Tutorial

简体中文

Requirements

To use this guide you’ll need a working installation of Ansible version 2.2 or later and pip install Jinja2==2.7.2 MarkupSafe==0.11. (installation reference)

After the installation is complete, you can run the following command to check ansible version:

$ ansible --version
ansible 2.2.2.0

Deploy information

  1. modify inventory.ini

    • if deploying via normal user:
      • change variable ansible_user to your deploy account (access sudo command).
    • if deploying via root:
      • uncomment variable ansible_user/ansible_become_user
      • comment variable ansible_become
  2. local prepare: if the Internet is accessbile, ansible will download the latest tidb.

    ansible-playbook local_prepare.yml
    
  3. modify kernel parameters

    ansible-playbook bootstrap.yml
    
  4. deploy

    If deploying via root, uncomment variable ansible_become in inventory.ini file.

    ansible-playbook deploy.yml
    
  5. start cluster

    ansible-playbook start.yml
    
  6. test

    use mysql client

    mysql -u root -h tidb_servers_ip -P 4000
    
  7. grafana monitoring platform:

    http://grafana_servers_ip:3000

    login(admin/admin)

Where to get binary

Above binaries will be automatically downloaded by:

ansible-playbook local_prepare.yml

Common Tasks

ansible all -m user -a 'name=tidb shell=/bin/bash groups=wheel append=yes'

ansible-playbook deploy.yml --list-hosts

ansible-playbook deploy.yml -k -K

ansible-playbook rolling_update.yml

Special Tasks

Rolling update TiKV only:

ansible-playbook rolling_update.yml --tags tikv

tidb-ansible's People

Contributors

andelf avatar linuxgit avatar liubo0127 avatar jomenxiao avatar tennix avatar huachaohuang avatar buggithubs avatar wph95 avatar cwen0 avatar ianthereal avatar

Watchers

James Cloos avatar  avatar  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.