MySQL is one of the most popular open-source relational databases, used by lots of projects around the world including incredibly large-scale ones like Facebook, Twitter, YouTube, etc. Obviously, such projects need a truly reliable and highly-available data storing system to ensure the appropriate level of a service quality. And the very first and the main way to get the most efficiency from your data storage is setting up database clustering so that it could process a big number of requests simultaneously and remain workable in conditions of increased load. However, configuring such solution from the scratch can appear to be a rather complicated task.

Thus, the Jelastic team has prepared a one-click installation package for you – a Scalable MySQL Cluster with out-of-box master-slave replication, even request distribution and node auto discovery. It is intended to instantly deploy a pair of interconnected MySQL containers, which handle asynchronous data replication and are automatically reconfigured upon cluster scaling (i.e. changing the number of nodes). In addition, this solution is supplied with a ProxySQL load balancer in front of the database nodes set and embedded Orchestrator for its convenient management via GUI.

So, to start with, let’s review some details on the Scalable MySQL Cluster solution implementation to get deeper insights on how it actually works. And after that we’ll proceed with instruction on its deployment, review possibilities of the built-in management panel and explore the implemented database failover mechanism with a simulated node failure.

Scalable MySQL Cluster Package Specifics

So, upon the Scalable MySQL Cluster with Load Balancing package installation, you’ll get a Docker-based environment with the following implementation specifics:

  • the default topology includes 1 ProxySQL load balancer node (based on jelastic/proxysql image) and a pair of asynchronously replicated MySQL DB server instances (built over the jelastic/mysql:5.7-latest template)
  • the very initially created MySQL container is assigned a master role, whilst the second one (and all the further manually added nodes) will serve as slaves
  • by default, each container is assigned 8-cloudlet resources limit (which equals to 1 GiB of RAM and 3.2 GHz of CPU) for automatic vertical scaling

Being delivered with a set of special preconfigurations, the current Scalable MySQL Cluster can be distinguished with the following possibilities and benefits:

  • efficient load balancing – ProxySQL uses the hostgroups concept to separate DB master (with a read-write possibility) and slaves (with the read-only permissions); herewith, due to the special query rules, all select requests are redirected only to slave servers and distributed between them with the round-robin algorithm to ensure even load
  • scalability and autodiscovery – new MySQL nodes, added during the manual DB server horizontal scaling, are included into a cluster as slaves with all the required adjustments being applied automatically
  • re-configuration with no downtime – a cluster is designed to run continuously and can be adjusted on a fly without the necessity to restart the running services
  • automated failover – slave DB nodes with high latency or the ones that can not be reached are temporarily excluded from a cluster and re-added once the connection is restored
  • comfortable GUI – the solution includes pre-installed Orchestrator tool to simplify cluster management (e.g. to refactor replication paths, recover topology failures, etc)

Before proceeding to the package installation, consider, that the appropriate Platform should run Jelastic 5.0.5 version or higher. Now, let’s see how to instantly get such clustered MySQL solution, run within Docker containers inside the Cloud, just in a few simple clicks.

How to Install Scalable MySQL Cluster into Jelastic Cloud

Deployment of the Scalable MySQL Cluster with Load Balancing is completely automated by Jelastic, allowing to get a fully configured and ready-to-go database cluster in a matter of minutes.

1. Log into your Jelastic account and import the appropriate manifest.jps file via URL:

https://github.com/jelastic-jps/mysql-cluster/blob/master/mysql-cluster-orchestrator/manifest.jps

Tip: Alternatively, you can find this solution within the Clusters section of Jelastic Marketplace alongside with a number of similar one-click installation packages for other clustered databases, application servers and particular applications.

2. Within the opened installation frame, provide details on the desired environment.Here:

  • Environment – type any prefered name
  • Display Name – optionally, provide an environment alias
  • Region – select region (if several ones are available)

Click Install to proceed.

3. Wait a minute while Jelastic configures everything for you.After the successful installation, you’ll receive the following email notifications with important administrating information on your MySQL cluster:

  • Scalable Database Cluster – provides data to access the PHPMyAdmin panel for database managing
  • Database Auto Replication – displays cluster connection information to bind it to your application
  • Orchestrator Configuration – gives credentials to access the Orchestrator panel, intended for convenient cluster management

Now, you are ready to start utilizing your DB cluster.

Cluster Instances Monitoring and Auto Discovery by Orchestrator

To get the basis of the provided built-in management possibilities, let’s refer to the embedded Orchestrator panel and check the cluster operability.

This tool can be accessed by clicking the Open in browser button next to the Proxysql layer of the created environment.1. The Orchestrator dashboard will be opened in a separate browser tab, providing you with a number of options & menus at the top.And in a big working area below, you can see that your database cluster has been already detected and is currently tracked.

2. Click on the appropriate plank to review the full cluster topology (i.e. all DB instances it consists of). According to the default package settings, we’ve got a pair of interconnected MySQL nodes, one per master and slave roles.Here, each instance plank displays some details on the corresponding database server, like its domain, run stack version, assigned role in confines of a cluster, etc.

3. If expecting a high load, it could make sense to extend your clustered storage with a couple of additional slaves to make it more durable.

For that, return to the Jelastic dashboard and scale out the number of containers in your MySQL cluster – for example, we’ll append two more nodes.4. When the instances are successfully added (track this operation state within the Tasks panel at the dashboard bottom), switch to the Orchestrator browser tab and verify their presence within the shown cluster topology.

Tip: The Orchestrator dashboard is automatically refreshed once per minute during your inactivity (i.e. when you don’t interact with the appropriate browser tab) to display the most up-to-date data for the moment you return to managing your cluster.The remaining time till the next information update is displayed at the top pane with a dedicated timer. Clicking on it will stop the counting so the continuous refresh will be disabled until you click it again.

As a result of our cluster extension, you should see three slave nodes being connected to the main MySQL master one.

Checking MySQL Cluster Failover with Simulated Slave Failure

Now, let’s halt replication at one of the slave DB server to simulate its failure and examine how the Orchestrator detects and handles such issues.

1. So, connect to any of your MySQL slave containers via SSH and access database shell with the following command:

mysql -u {user} -pObviously, the {user} placeholder should be replaced with MySQL admin username (and confirmed with the appropriate password) to authenticate the established connection – the corresponding credentials can be found in the cluster info email you’ve got after its creation.

2. At the first, let’s check the actual status of the current DB server by entering the next string:

show slave status\GAs you can see, the slave node is up and working.

3. Now, let’s break the main replication process at the chosen database server and check the result – run the following two commands in one string to accomplish this simultaneously:

stop slave; show slave status\G4. Return to the Orchestrator dashboard to check whether our simulated server unavailability has been detected by the system – the appropriate node should be highlighted with red.Also, you can note a red warning icon being appeared in the top right corner of your working area – here, all cluster problems are gathered within a single list for the convenient view.

5. To reveal the root of the failure issue, click on the gear icon at the appropriate problematic node plank. In the opened frame, you’ll be provided with some additional DB instance information to analyze (like its replication status & delay, server ID, read/write permissions, uptime duration, etc) and options to perform some main management actions.

In our case, you can see that replication is not running. Thus, to restore the full operability of the cluster, click the appropriate Start slavebutton for the master node data to be replicated to all slaves once again.After this process completion, the warning node plank highlight will disappear, as well as the list of problems to the right – this means all of the nodes work as intended.

At this point, you can proceed exploring the Scalable MySQL Cluster with Load Balancing solution by Jelastic on your own. Do not hesitate to create the exact data storage you need – the package is already available for all users within the Clusters section of Jelastic Marketplace. Haven’t tried Jelastic yet? Not a problem, just register at any of our Cloud Platforms and test drive its possibilities completely for free during a two-week trial period.

 
 
 
 

Scalable MySQL Cluster with Master-Slave Replication, ProxySQL Load Balancing and Orchestrator的更多相关文章

  1. mysql 主从配置(master/slave)

    1.  在每台服务器上创建复制账号(也可以只在master上创建用户,这里配置两个是为了方便以后切换) 备库运行的I/O县城需要建立一个到主库的TCP/IP连接,所以必须在主库创建一个用户,并赋予合适 ...

  2. mongodb - Master Slave Replication

    master-slave复制模式大多场景下都被replicat sets代替.官方也建议使用replicat sets. master-slave复制不支持自动failover. master-sla ...

  3. Mysql主从数据库(master/slave),实现读写分离

    在之前的一篇文章中,阐述了如何在高并发高负载的场景下使用nginx做后台服务的负载均衡:在阿里云Centos上配置nginx+uwsgi+负载均衡配置,但是不要以为这样做了就是一劳永逸的,到了数据业务 ...

  4. 在阿里云Centos7.6上面配置Mysql主从数据库(master/slave),实现读写分离

    原文转载自「刘悦的技术博客」https://v3u.cn/a_id_85 在之前的一篇文章中,阐述了如何在高并发高负载的场景下使用nginx做后台服务的负载均衡:在阿里云Centos上配置nginx+ ...

  5. MySQL下做Master/Slave同步,延迟太大怎么办?

    slave的延迟是比较常见的,如果短暂的延迟后还能追上,一般就能接受了.   用innodb不是坏事,会减少一些slave中止的情况.如果是myisam的表,insert update delete操 ...

  6. 【推荐】MySQL Cluster报错及解决方法(不断更新中)

    排查问题技巧: MySQL Cluster 自带了一个错误代码的查看的小程序.通过这个小东西我们可以方便的定位问题的原因. 这个程序就是 perror 在MYSQL安装目录的bin下面. 如报错:ER ...

  7. 【架构】How To Use HAProxy to Set Up MySQL Load Balancing

    How To Use HAProxy to Set Up MySQL Load Balancing Dec  2, 2013 MySQL, Scaling, Server Optimization U ...

  8. mysql (master/slave)复制原理及配置

    1 复制概述 Mysql内建的复制功能是构建大型,高性能应用程序的基础.将Mysql的数据分布到多个系统上去,这种分布的机制,是通过将Mysql的某一台主机的数据复制到其它主机(slaves)上,并重 ...

  9. MySQL master/slave 模式

    1 .复制 Mysql内建的复制功能是构建大型,高性能应用程序的基础.将Mysql的数据分布到多个系统上去,这种分布的机制,是通过将Mysql的某一台主机的 数据复制到其它主机(slaves)上,并重 ...

随机推荐

  1. 四:FAQ附录(容器交互,镜像交互,镜像导出)

    1.交互式运行容器的方法: 1>-it进入到操作系统中: 2>另开一个cmd验证: 3>这是在image之上多了一个可写的从:可以运行centos的命令做一些事(touch .yum ...

  2. tomcat设置默认启动项

     Tomcat设置默认启动项目 Tomcat设置默认启动项目,顾名思义,就是让可以在浏览器的地址栏中输入ip:8080,就能访问到我们的项目.具体操作如下:     1.打开tomcat的安装根目 ...

  3. 使用AWR报告诊断Oracle性能问题

    在做单交易负载测试时,有的交易响应时间超出了指标值,在排除完测试环境等可能造成交易超时的原因后,去分析数据库问题.数据库用的是Oracle,对于Oracle数据库整体的性能问题, awr的报告是一个非 ...

  4. SharePoint Framework 构建你的第一个web部件(二)

    博客地址:http://blog.csdn.net/FoxDave 本篇接上一讲,介绍一下web部件项目中的代码. 下面首先列举一下项目中的一些关键文件. Web部件类 HelloWorldWebPa ...

  5. 8.Python爬虫实战一之爬取糗事百科段子

    大家好,前面入门已经说了那么多基础知识了,下面我们做几个实战项目来挑战一下吧.那么这次为大家带来,Python爬取糗事百科的小段子的例子. 首先,糗事百科大家都听说过吧?糗友们发的搞笑的段子一抓一大把 ...

  6. 四、使用汇编编写LED裸机驱动

    1. 确定硬件连接 打开OK6410底板电路图,找到LED,可以发现NLEDx为0时LED点亮. 找到LED的控制引脚,发现LED控制引脚通过连接器连到了核心板: 打开核心板电路图,找到对应的连接器中 ...

  7. Flask源码阅读-第二篇(flask\__init__.py)

    源码: # -*- coding: utf-8 -*-""" flask ~~~~~ A microframework based on Werkzeug. It's e ...

  8. SpringSecurity自定义登陆页面和跳转页面

    如果我们不用form-login说明登陆界面,springsecurity框架将自动为我们生成登陆界面 现在我们不想用自动生成的登陆界面了,而想使用自定义的漂亮的登陆界面 则需要使用<secur ...

  9. 团队-爬取豆瓣电影TOP250-需求分析

    需求: 1.搜集相关电影网址 2.实现相关逻辑的代码 项目步骤: 1.通过豆瓣网搜索关键字,获取相关地址 2.根据第三方包实现相关逻辑  

  10. JAVA测试编程

    本周我们上JAVA课的时候进行了一次测试,本次测试以模拟中国工商银行自助机ATM的功能为大致要求,要求我们进行编写调试,以求达到试题要求. 测试要求我们能模拟ATM的功能设计,当用户插卡后显示,输入密 ...