Mysql cluster structures (multiple instances, from the master)

A, Mysql multi-instance

1. What is multi-instance of mysql

MySQL is multi-instance on a single machine MySQL service to open multiple different service ports (such as: 3306,3307,3308), run multiple MySQL service process, through different socket listening different service ports to provide their services.

2, mysql multiple instances advantage

  • 1, the effective use of server resources
    • When excess single server resources, can take advantage of the remaining resources to provide more services
  • 2, saving server resources
    • When the company money is tight, but the database each time they need to provide services, and want to use master-slave synchronization between databases and other technologies, this time with multiple instances, all the better
  • 3, to facilitate post schema extensions
    • When the company started a project before the early start does not necessarily have a great amount of users, so you can start with a set of physical database servers, deploy multiple instances above, easy to follow the schema extension, migration

Shortcoming

  • Pre-emption question each other, when a service instance or service concurrent high turn slow query will consume more memory, CPU, disk IO resources, causing other instances on the server to provide the quality of service decline;

3, the deployment of three ways to implement multiple instances myslq

 

3.1, based on multiple configuration files

 

To activate different processes through the use of multiple configuration files, in order to achieve multi-instance.

 

Advantages : simple logic, simple configuration

 

Drawback : it is not convenient management

 

3.2, based on mysqld_multi

 

Through the official's own mysqld_multi tool, use separate configuration files to implement multi-instance

 

Advantages:  easy centralized Management

 

Disadvantages:  inconvenient to customize configurations for each instance

 

3.3, based on IM

 

Use MySQL Instance Manager (MYSQLMANAGER), this method seems to be better, but also a bit complicated

 

Advantages : facilitating centralized management

 

Disadvantages : high coupling. A hanging IM, lorry example

 

Inconvenient to be customized for each instance configuration

 

4, install multiple Notes databases under the same development environment

  • Installation configuration file path can not be the same
  • Database directory can not be the same
  • Scripts can not start with the same name
  • Port can not be the same
  • Can not generate the same socket path

 

Two, mysql multi-instance

 

Guess you like

Origin www.cnblogs.com/liangyuntao-ts/p/11113947.html