Giter Club home page Giter Club logo

mysql_sharing_cluster's Introduction

Mysql_Sharing_Cluster

Tham khảo: https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-overview.html


Ý tưởng.

Một ứng dụng có lượng lơn dữ liệu (100GB) dữ liệu, thực hiện nhiều lệnh truy vấn cùng lúc (1 triệu truy vấn / Giây).

Vấn đề.

Một server chạy thông thường sẽ không dủ để đáp ứng được một lượng dữ liệu lớn và nhiều truy vấn như vậy.

Khi server này down thì ứng dụng cũng down ngay lập tức vì không có giải pháp backup.

Giải pháp.

Cần phải chia nhỏ dữ liệu ra nhiều server để quản lý.

Có nhiều Server để nhận truy vấn từ ứng dụng.

Mysql cung cấp giải pháp cluster để đáp ứng nhu cầu trên: InnoDB Cluster và NBD Cluster.

  • InnoDB Cluster thì không có nhiều Node Sql để nhận truy vấn từ ứng dụng, NBD Cluster có thể mở rộng được.

  • NBD Cluster dữ liệu của bảng sẽ được chia ra lưu trữ trên nhiều ndbd được quản lý bởi ndb_mngd.

Thực hiện bằng Docker

Chạy các lệnh trong fle docker-cammand và kiểm tra kết quả

docker run -it --net=cluster mysql/mysql-cluster ndb_mgm
[Entrypoint] MySQL Docker Image 8.0.23-1.1.19-cluster
[Entrypoint] Starting ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> 
ndb_mgm> show
Connected to Management Server at: 192.168.0.2:1186
Cluster Configuration
---------------------
[ndbd(NDB)]	3 node(s)
id=2	@192.168.0.3  (mysql-8.0.23 ndb-8.0.23, Nodegroup: 0, *)
id=3	@192.168.0.4  (mysql-8.0.23 ndb-8.0.23, Nodegroup: 0)
id=5	@192.168.0.5  (mysql-8.0.23 ndb-8.0.23, Nodegroup: 0)

[ndb_mgmd(MGM)]	1 node(s)
id=1	@192.168.0.2  (mysql-8.0.23 ndb-8.0.23)

[mysqld(API)]	2 node(s)
id=4	@192.168.0.10  (mysql-8.0.23 ndb-8.0.23)
id=6	@192.168.0.11  (mysql-8.0.23 ndb-8.0.23)

mysql_sharing_cluster's People

Contributors

longhuu100 avatar

Watchers

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