广告
返回顶部
首页 > 资讯 > 数据库 >MySQL/MariaDB读写分离配置
  • 573
分享到

MySQL/MariaDB读写分离配置

MySQL/MariaDB读写分离配置 2021-01-12 05:01:04 573人浏览 无得
摘要

实现数据库读写分离技术是有很多方法的,在这里我就用一个比较简单的Mysql-proxy这个中间件来实现数据库的读写分离; 使用mysql-proxy实现mysql的读写分离,mysql-proxy实际上是作为后端mysql主从服务器的代理

MySQL/MariaDB读写分离配置

实现数据库读写分离技术是有很多方法的,在这里我就用一个比较简单的Mysql-proxy这个中间件来实现数据库的读写分离;

使用mysql-proxy实现mysql的读写分离,mysql-proxy实际上是作为后端mysql主从服务器的代理,它直接接受客户端的请求,对SQL语句进行分析,判断出是读操作还是写操作,然后分发至对应的mysql服务器上。

数据库读写分离比较实用的还有Amoeba等相关程序。

 

基本环境

 

此环境需要三台主机(可以是虚拟主机)
linux 操作系统 版本: Centos8.0
软件版本:
数据库: mariadb
lua lua.X86_64
mysql-proxy: mysql-proxy-0.8.5

 

这里因为需要用三台主机,电脑配置有点上愁,所以我这里就使用容器Docker)代替三台虚拟主机了

root@uduntu:~# docker ps -a
    CONTaiNER ID        IMAGE               COMMAND                                 CREATED             STATUS              PORTS                   NAMES
    8aea2ebdf1a5        centos              "/sbin/init"        12 minutes aGo      Up 11 minutes                           mysql-proxy
    9a24bbeec012        centos              "/sbin/init"        13 minutes ago      Up 12 minutes                           DB2
    5495e5cf36c3        centos              "/sbin/init"        37 minutes ago      Up 37 minutes                           DB1
root@uduntu:~#

 

这三个容器,IP地址分别是:

①DB1: 172.18.0.2

②DB2: 172.18.0.3

③mysql-proxy: 172.18.0.4

好了基础环境已经介绍完成了,接下来开始真正的部署操作吧!

 

数据库部署

 

MariaDB描述:

MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可 MariaDB的目的是完全兼容MySQL,包括api和命令行,使之能轻松成为MySQL的代替品。

MariaDB基于事务的Maria存储引擎,替换了MySQL的MyISAM存储引擎,它使用了Percona的 XtraDB,InnoDB的变体,分支的开发者希望提供访问即将到来的MySQL 5.4 InnoDB性能。

这个版本还包括了 PrimeBase XT (PBXT) 和 FederatedX存储引擎。

 

安装

 

[root@DB1 /]#    apt -y install mariadb-server
    Setting up mariadb-client-10.3 (1:10.3.17-1) ...
    Setting up libdbd-mysql-perl:amd64 (4.050-2build1) ...
    Setting up libhtml-parser-perl (3.72-3build2) ...
    Setting up mariadb-server-10.3 (1:10.3.17-1) ...
    Created symlink /etc/systemd/system/mysql.service → /lib/systemd/system/mariadb.service.
    Created symlink /etc/systemd/system/mysqld.service → /lib/systemd/system/mariadb.service.
    Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /lib/systemd/system/mariadb.service.
    Setting up libHttp-message-perl (6.18-1) ...
    Setting up libcgi-pm-perl (4.44-1) ...
    Setting up libhtml-template-perl (2.97-1) ...
    Setting up mariadb-server (1:10.3.17-1) ...
    Setting up libcgi-fast-perl (1:2.15-1) ...
    Processing triggers for systemd (242-7ubuntu3) ...
    Processing triggers for man-db (2.8.7-3) ...
    Processing triggers for libc-bin (2.30-0ubuntu2) ...
jia@uduntu:~$            \出现上面代码表示安装成功

 

启动

[root@DB1 /]#  systemctl start mariadb
    ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
    Authentication is required to start "mariadb.service".
    Authenticating as: jia
    PassWord:         \此处输入密码
    ==== AUTHENTICATION COMPLETE ===
 [root@DB1 /]#

 

查看是否启动成功:

[root@DB1 /]#    mysql_secure_installation 
     \下面是初始化过程
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we"ll need the current
password for the root user.  If you"ve just installed MariaDB, and
you haven"t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

NORMally, root should only be allowed to connect from "localhost".  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named "test" that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you"ve completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[root@DB1 /]#

 

初始化完成后,可直接使用自带的mysql客户端进行连接

[root@DB1 /]#    mysql -u root -p
    Enter password: 
    Welcome to the MariaDB monitor.  Commands end with ; or g.
    Your MariaDB connection id is 56
    Server version: 10.3.17-MariaDB-1 Ubuntu 19.10

    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

    Type "help;" or "h" for help. Type "c" to clear the current input statement.

    MariaDB [(none)]> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | ifnormation_schema |
    | mysql              |
    | performance_schema |
    +--------------------+
rows in set (0.000 sec)

     MariaDB [(none)]>

DB2数据库同DB1数据库一样,同样方法安装mariadb数据库就可以哦!我这里就省略不写了

 

MySQL-Proxy部署

 

MySQL-Proxy软件需要部署到单独的mysql-proxy服务器上的。

 

安装依赖软件

 

MySQL-Proxy中含有一个读写分离的lua文件,这也是我们使用mysql-proxy实现读写分离必用的文件,它需要lua解析器进行解析。

因此我们需要安装一个lua解析器。

[root@mysql-proxy /]# yum -y install lua*
  mdadm-4.1-4.el8.x86_64                                                                                                                         
  mozjs52-52.9.0-1.el8.x86_64                                                                                                                    
  mtools-4.0.18-14.el8.x86_64                                                                                                                    
  nfs-utils-1:2.3.3-14.el8_0.2.x86_64                                                                                                            
  nuMactl-libs-2.0.12-2.el8.x86_64                                                                                                               
  numad-0.5-26.20150602git.el8.x86_64                                                                                                            
  parted-3.2-36.el8.x86_64                                                                                                                       
  pciutils-3.5.6-4.el8.x86_64                                                                                                                    
  pciutils-libs-3.5.6-4.el8.x86_64                                                                                                               
  policycoreutils-2.8-16.1.el8.x86_64                                                                                                            
  polkit-0.115-6.el8.x86_64                                                                                                                      
  polkit-libs-0.115-6.el8.x86_64                                                                                                                 
  polkit-pkla-compat-0.1-12.el8.x86_64                                                                                                           
  psmisc-23.1-3.el8.x86_64                                                                                                                       
  python3-dateutil-1:2.6.1-6.el8.noarch                                                                                                          
  python3-dnf-plugins-core-4.0.2.2-3.el8.noarch                                                                                                  
  quota-1:4.04-10.el8.x86_64                                                                                                                     
  quota-nls-1:4.04-10.el8.noarch                                                                                                                 
  rdma-core-22-2.el8.x86_64                                                                                                                      
  rpcbind-1.2.5-3.el8.x86_64                                                                                                                     
  syslinux-6.04-1.el8.x86_64                                                                                                                     
  syslinux-extlinux-6.04-1.el8.x86_64                                                                                                            
  syslinux-extlinux-nonlinux-6.04-1.el8.noarch                                                                                                   
  syslinux-nonlinux-6.04-1.el8.noarch                                                                                                            
  systemd-container-239-13.el8.x86_64                                                                                                            
  userspace-rcu-0.10.1-2.el8.x86_64                                                                                                              
  xml-common-0.6.3-50.el8.noarch                                                                                                                 

Complete!
[root@mysql-proxy /]#             \出现以上输出表示安装成功

 

安装Mysql-Proxy

 

在安装完成lua之后,我们就可以安装今天的主角软件了

[root@mysql-proxy opt]# ls
    mysql-proxy-0.8.5-linux-rhel5-x86-64bit.tar.gz
[root@mysql-proxy opt]#         //上面软件就是我们的主角软件

安装软件包

#安装软件包
#将安装包解压
[root@mysql-proxy opt]# tar zxf mysql-proxy-0.8.5-linux-rhel5-x86-64bit.tar.gz  
#解压后的目录
[root@mysql-proxy mysql-proxy-0.8.5-linux-rhel5-x86-64bit]# ls
    bin  include  lib  libexec  licenses  share
# 更改名称,方便之后对其进行操作
[root@mysql-proxy opt]# mv mysql-proxy-0.8.5-linux-rhel5-x86-64bit mysql-proxy
#将mysql-proxy中lua配置文件cp到软件根目录
[root@mysql-proxy mysql-proxy]# cp share/doc/mysql-proxy/rw-splitting.lua .
#再次查看目录结构
[root@mysql-proxy mysql-proxy]# ls
    bin  include  lib  libexec  licenses  rw-splitting.lua    share
#修改lua配置文件,只需要修改下面代码就可以
if not proxy.global.config.rwsplit then
        proxy.global.config.rwsplit = {
                min_idle_connections = 4,    //此处值改为1
                max_idle_connections = 8,    //此处值改为1

                is_debug = false
        }
#修改完成后保存退出,启动mysql-proxy
[root@mysql-proxy mysql-proxy]# cd bin/      //切换目录
[root@mysql-proxy bin]#  ./mysql-proxy --proxy-read-only-backend-addresses=172.18.0.3:3306 --proxy-backend-addresses=172.18.0.2:3306 --proxy-lua-script=/opt/mysql-proxy/rw-splitting.lua &
[1] 5680
[root@mysql-proxy bin]# 2019-11-20 09:26:54: (critical) plugin proxy 0.8.5 started

[root@mysql-proxy bin]# 
#启动成功

 

注意:

–proxy-read-only-backend-addresses //指定执行读取操作的数据库IP地址以及端口
–proxy-backend-addresses //指定执行写入操作的数据库IP地址以及端口
–proxy-lua-script //指定mysql-proxy软件中lua配置文件路径

#查看是否启动成功
[root@mysql-proxy bin]# ps aux | grep mysql-proxy
root       5680  0.0  0.5  38428  3696 pts/1    S    09:26   0:00 /opt/mysql-proxy/libexec/mysql-proxy --proxy-read-only-backend-addresses=172.18.0.3:3306 --proxy-backend-addresses=172.18.0.2:3306 --proxy-lua-script=/opt/mysql-proxy/rw-splitting.lua        
        #出现第一行表示启动成功

 

接下来需要为mysql-proxy程序创建可以读取和写入数据库的用户

[root@DB2 /]# 
[root@DB2 /]# mysql -u root -p            //登陆数据库
Enter password:                         //输入数据库密码
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 16
Server version: 10.3.11-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type "help;" or "h" for help. Type "c" to clear the current input statement.

MariaDB [(none)]> grant all on *.* to "proxy"@"%" identified by "redhat";        //创建用户并设置权限
Query OK, 0 rows affected (0.105 sec)

MariaDB [(none)]> flush privileges;                //更新权限列表            
Query OK, 0 rows affected (0.090 sec)

MariaDB [(none)]>

注意:用户需要在两个数据库上创建,名称密码要一致;

 

继续看 :测试

 

好了到这里,数据库的部署,以及使用代理对数据库的读写进行限制已经做好了其实也并没有复杂,接下来让我们测试一下。

#找一个客户端,宿主机也可以,安装一个数据库客户端或则数据库的连接工具进行连接,我这里就使用mysql客户端进行测试了
root@uduntu:~# mysql -uproxy -predhat -h 172.18.0.4 -P4040
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 21
Server version: 10.3.11-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type "help;" or "h" for help. Type "c" to clear the current input statement.

MariaDB [(none)]> 
#查看到登陆数据库表示连接成功

 

注意:

①mysql -uproxy -predhat -h 172.18.0.4 -P4040

②其中-u指的是数据库的用户名;

③-p指的是密码;

④-h指定mysql-proxy的服务器地址;

⑤-P表示mysql-proxy的端口

 

接下来我们试着创建一个数据库看下效果:


DB1数据库默认所拥有的数据库

[root@DB1 /]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 22
Server version: 10.3.11-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type "help;" or "h" for help. Type "c" to clear the current input statement.

MariaDB [(none)]> show databases ;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
rows in set (0.197 sec)

MariaDB [(none)]>

 

DB2数据库默认所拥有的数据库:

[root@DB2 /]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 17
Server version: 10.3.11-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type "help;" or "h" for help. Type "c" to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
rows in set (0.275 sec)

MariaDB [(none)]>

 

使用代理mysql-proxy创建新数据库:

root@uduntu:~# 
root@uduntu:~# mysql -uproxy -predhat -h 172.18.0.4 -P4040
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 21
Server version: 10.3.11-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type "help;" or "h" for help. Type "c" to clear the current input statement.

MariaDB [(none)]> create database test;            //创建test数据库
Query OK, 1 row affected (0.056 sec)

MariaDB [(none)]>

 

查看DB1数据库:发现多了test数据库

MariaDB [(none)]> show databases ;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
rows in set (0.001 sec)

MariaDB [(none)]>

 

查看DB2数据库:发现没有新的数据库;

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
rows in set (0.000 sec)

MariaDB [(none)]>

OK搞定,说明数据库只是往DB1里面写数据库并不往DB2中写入数据

 

优化MySQL-Proxy

 

你会发现在启动mysql-proxy时需要写那么多东西,需要指定两个参数,每次启动都要写太麻烦了,为了解决这个问题, 在这里写了一个启动脚本,希望可以帮到大家。

#!/bin/sh
     # chkconfig: - 98 44
     # processname: mysql-proxy
    # description: mysql-proxy is a proxy daemon to mysql
 . /etc/rc.d/init.d/functions
  PROXY_PATH=/opt/mysql-proxy/bin
  prog="mysql-proxy"
 . /etc/sysconfig/network
 [ ${NETWORKING} = "no" ] && exit 0
  PROXY_OPTIONS="--proxy-read-only-backend-addresses=172.18.0.3:3306 --proxy-backend-addresses=172.18.0.2:3306 --proxy-lua-script=/opt/mysql-proxy/rw-splitting.lua"
  PROXY_PID=/opt/mysql-proxy/run/mysql-proxy.pid
 if [ -f /etc/sysconfig/mysql-proxy ]; then
         . /etc/sysconfig/mysql-proxy
 fi
 
 PATH=$PATH:/usr/bin:/opt/bin:$PROXY_PATH
 RETVAL=0
 case "$1" in
   start)
         echo -n $"Starting $prog: "
         $NICELEVEL $PROXY_PATH/mysql-proxy $PROXY_OPTIONS --daemon --pid-file=$PROXY_PID --user=root --log-level=debug --log-file=/opt/mysql-proxy/log/mysql-proxy.log
         RETVAL=$?
         echo
         if [ $RETVAL = 0 ]; then
                 touch /var/lock/subsys/mysql-proxy]
                 echo "ok"
         fi
        ;;
   stop)
          echo -n $"Stopping $prog: "
         killproc $prog
         RETVAL=$?
         echo
         if [ $RETVAL = 0 ]; then
                 rm -f /var/lock/subsys/mysql-proxy
                 rm -f $PROXY_PID
         fi
        ;;
   restart)
         $0 stop
         sleep 3
         $0 start
        ;;
   condrestart)
        [ -e /var/lock/subsys/mysql-proxy ] && $0 restart
       ;;
   status)
         status mysql-proxy
         RETVAL=$?
        ;;
   *)
         echo "Usage: $0 {start|stop|restart|status|condrestart}"
         RETVAL=1
        ;;
 esac
 exit $RETVAL

将mysql-proxy服务管理脚本放在了/opt/mysql-proxy/init.d/文件夹里

给执行权限,建立相应目录

  [root@mysql-proxy ~]chmod +x /opt/mysql-proxy/init.d/mysql-proxy
  [root@mysql-proxy ~]mkdir /opt/mysql-proxy/run
  [root@mysql-proxy ~]mkdir /opt/mysql-proxy/log
  [root@mysql-proxy ~]cd /opt/mysql-proxy/init.d/
启动mysql-proxy
  [root@mysql-proxy init.d ~]./mysql-proxy start
停止mysql-proxy
  [root@mysql-proxy init.d ~]./mysql-proxy stop
重启mysql-proxy
  [root@mysql-proxy init.d~]./mysql-proxy restart

这样启动停止mysql-proxy就很简单了,在这里提醒大家一下,单独的数据库读写分离是没有任何作用的,只有结合数据主从复制来进行才有意义。

 

您可能感兴趣的文档:

--结束END--

本文标题: MySQL/MariaDB读写分离配置

本文链接: https://www.lsjlt.com/news/5828.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • MySQL/MariaDB读写分离配置
    实现数据库读写分离技术是有很多方法的,在这里我就用一个比较简单的mysql-proxy这个中间件来实现数据库的读写分离; 使用mysql-proxy实现mysql的读写分离,mysql-proxy实际上是作为后端mysql主从服务器的代理...
    99+
    2021-01-12
    MySQL/MariaDB读写分离配置
  • MyCat读写分离配置
        读写分离在我们配置数据库集群时是必然会考虑的一个点,因为这可以有效的降低主库的负载,并且在读多余写的情况下,绝大部分的读请求都可以分发到各个不同的从库上。即使从库负载不够,也可以通过增加从库的方式来...
    99+
    2022-10-18
  • Mysql数据库读写分离简单配置
    环境:Master:192.168.71.128      mysql-sql-node1Slave:192.168.71.140 &n...
    99+
    2022-10-18
  • SQL Server Alwayson读写分离配置
    概述  Alwayson相对于数据库镜像最大的优势就是可读副本,带来可读副本的同时还添加了一个新的功能就是配置只读路由实现读写分离;当然这里的读写分离稍微夸张了一点,只能称之为半读写分离...
    99+
    2022-10-18
  • Mycat读写分离配置实践
       工作这些年来,也去了一些地方,有了一些见闻,隐隐感觉很多文化和猫有着千丝万缕的联系。就拿IT行业来说吧,猫有着很高的曝光率,比如大名鼎鼎的 tomcat,是由SUN的软件构架...
    99+
    2022-10-18
  • Amoeba新版本MYSQL读写分离如何配置
    小编给大家分享一下Amoeba新版本MYSQL读写分离如何配置,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧! 官方简介 Amoeba的中文意思是变型虫 主要解决: &bul...
    99+
    2022-10-19
  • MySQL主从同步和读写分离如何配置
    这篇文章主要为大家展示了“MySQL主从同步和读写分离如何配置”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“MySQL主从同步和读写分离如何配置”这篇文章吧。 ...
    99+
    2022-10-19
  • MySQL-mycat读写分离
    Mycat 需要安装JDK 1.7 或者以上版本第一步:下载jdk-8u131-linux-x64.tar.gz文件 http://haixi.sfkcn.com:8080/201704/tools/jdk-linux-x64.tar.gz...
    99+
    2021-04-03
    MySQL-mycat读写分离 数据库入门 数据库基础教程 数据库 mysql
  • mysql+amoeba读写分离
    mysql+amoeba读写分离一 简介:Amoeba是一个以MySQL为底层数据存储,并对应用提供MySQL协议接口的proxy。它集中地响应应用的请求,依据用户事先设置的规则,将SQL请求发送到特定的数...
    99+
    2022-10-18
  • mysql主从复制读写分离与高可用配置
    一、说明 前面我们说了mysql的安装配置(并提供一键安装脚本),mysql语句使用以及备份恢复mysql数据;本次要介绍的是mysql的主从复制,读写分离;及高可用MHA;环境如下:master:Cent...
    99+
    2022-10-18
  • MySQL Group Replication mgr 单主 proxysql 读写分离配置过程
    1、前期准备,mgr安装见上一篇文章 2、创建用户和导入脚本 GRANT ALL ON *.* TO 'rootuser'@'%' IDENTIFIED BY '123456'; /mgr/mysq...
    99+
    2022-10-18
  • mysql主从配置实现一主一从读写分离
    主从介绍Mysql主从又叫Replication、AB复制。简单讲就是A与B两台机器做主从后,在A上写数据,另外一台B也会跟着写数据,实现数据实时同步 mysql主从是基于binlog,主上需开启binlo...
    99+
    2022-10-18
  • MySQL数据库的主从同步配置与读写分离
    使用mysql主从复制的好处有: 1、采用主从服务器这种架构,稳定性得以提升。如果主服务器发生故障,我们可以使用从服务器来提供服务。 2、在主从服务器上分开处理用户的请求,可以提升数据处理效率。 3、将主服...
    99+
    2022-10-18
  • mysql主从复制读写分离的配置方法详解
    一、说明 前面我们说了mysql的安装配置,mysql语句使用以及备份恢复mysql数据;本次要介绍的是mysql的主从复制,读写分离;及高可用MHA; 环境如下: master:CentOS7_x64...
    99+
    2022-10-18
  • 配置数据库读写分离服务器
    配置一主一从 主从同步结构,并在客户端测试配置master51> grant all on webdb.* to webuser@"%" identified by &...
    99+
    2022-10-18
  • Mysql - 配置Mysql主从复制-keepalived高可用-读写分离集群
    目录 高可用: 为什么需要高可用呢? 高可用的主要作用: keepalived是什么?它用在哪里? 什么是VRRP协议,它的作用是什么? 搭建一个基于keepalived的高可用Mysql主从复制读写分离集群 一、项目中的IP地址配置表:...
    99+
    2023-09-18
    数据库
  • MySQL读写分离amoeba&mysql-proxy
    ----主从同步介绍 refencen    https://www.cnblogs.com/lin3615/p/5684891.html 1. 读写分离方式 ...
    99+
    2022-10-18
  • MySQL 读写分离 (基于Amoeba)
    一.MySQL读写分离    主数据库处理事务性查询,从数据库处理select查询。数据库复制用来把事务性查询导致的变更同步到从数据库中。二.最为常见的读写分离有两种:1.基于...
    99+
    2022-10-18
  • MySQL读写分离架构(KHPM)
    MySQL读写分离架构(KHPM) Keepalived HAProxy ProxySQL MySQL Keepalived+HAProxy 应用程序入口无单点故障ProxySQL Cluster ...
    99+
    2022-10-18
  • mysql+mycat实现读写分离
    centos7 master slave mycat1.6 client 192.168.41.10 192.168.41.11 192.168.41.12 192.168.41.13 ...
    99+
    2022-10-18
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作