Mysql router 主要用途是读写分离,主主故障自动切换,负载均衡,连接池等。安装如下

下载地址:https://dev.mysql.com/downloads/router/

tar -zxvf mysql-router-2.1.4-el7-x86-64bit.tar.gz
mv mysql-router-2.1.4-el7-x86-64bit /usr/local/mysql-router

配置文件
mkdir /etc/mysql-route/
mkdir -p /data0/log/mysqlrouter
mkdir -p /usr/local/mysql-router/data/keyring-data
chown mysql:mysql /usr/local/mysql-router
chown mysql:mysql /data0/log/mysqlrouter

cp /usr/local/mysql-router/share/doc/mysqlrouter/sample_mysqlrouter.conf /etc/mysql-route/mysqlrouter.conf

vim /etc/mysql-route/mysqlrouter.conf
[DEFAULT]
logging_folder = /data0/log/mysqlrouter
plugin_folder = /usr/local/mysql-router/lib/mysqlrouter
config_folder = /etc/mysql-route/
runtime_folder = /usr/local/mysql-router/run
data_folder = /usr/local/mysql-router/data
keyring_path = /usr/local/mysql-router/data/keyring-data
master_key_path = /usr/local/mysql-router/data/keyring-key

[logger]
level = INFO

[routing:basic_failover]
bind_address=192.168.56.118
bind_port = 7001
mode = read-write
max_connections =256
max_connect_errors =1000
client_connect_timeout =20
destinations = myma1:3306,myma2:3306

[routing:balancing]
bind_address=192.168.56.118
bind_port = 7002
connect_timeout = 20
max_connections = 1024
destinations = myma1:3306,myma2:3306
mode = read-only

# If no plugin is configured which starts a service, keepalive
# will make sure MySQL Router will not immediately exit. It is
# safe to remove once Router is configured.
[keepalive]
interval = 60

启动配置方式
mysqlrouter --config /etc/mysql-route/mysqlrouter.conf &

vim /etc/profile
PATH=/usr/local/mysql-router/bin:$PATH
mkdir /usr/local/mysql-router/scripts/

vim /usr/local/mysql-router/scripts/start_mysqlrouter.sh
#!/bin/bash
/usr/local/mysql-router/bin/mysqlrouter --config /etc/mysql-route/mysqlrouter.conf &
chmod +x start_mysqlrouter.sh

netstat -tunlp

写节点
mysql -h192.168.56.118 -uroot -P7001 -p
读节点
mysql -h192.168.56.118 -uroot -P7002 -p

my01_Mysql router 安装的更多相关文章

  1. MYSQL router 自动均衡负载

    配制文件: /etc/mysqlrouter/mysqlrouter.ini [DEFAULT] logging_folder = /var/log/mysql-router plugin_folde ...

  2. [转] React Router 使用教程

    PS:react-route就是一个决定生成什么父子关系的组件,一般和layout结合起来,保证layout不行,内部的子html进行跳转 你会发现,它不是一个库,也不是一个框架,而是一个庞大的体系. ...

  3. React Router 使用教程

    一.基本用法 React Router 安装命令如下. $ npm install -S react-router 使用时,路由器Router就是React的一个组件. import { Router ...

  4. OpenShift实战(一):OpenShift高级安装

    1.1 服务器基本信息 本次安装采用一个master.5个node.3个etcd,node节点两块硬盘,60G磁盘用于docker storage,xxx改为自己的域名或主机名. 节点 功能 IP 内 ...

  5. Vue.js 2.x笔记:路由Vue Router(6)

    1. Vue Router简介与安装 1.1 Vue Router简介 Vue Router 是 Vue.js 官方的路由管理器.它和 Vue.js 的核心深度集成,构建单页面应用. Vue Rout ...

  6. Vue之单文件组件的数据传递,axios请求数据及路由router

    1.传递数据 例如,我们希望把父组件的数据传递给子组件. 可以通过props属性来进行传递. 传递数据三个步骤: 步骤1:在父组件中,调用子组件的组名处,使用属性值的方式往下传递数据 <Menu ...

  7. React:快速上手(6)——掌握React Router

    React:快速上手(6)——掌握React Router 引入Router 安装 npm install react-router-dom 基础组件 React Router中有三种类型的组件:路由 ...

  8. MySQL router

    MySQL Router is a building block for high availability (HA) solutions. It simplifies application dev ...

  9. Vue技术点整理-Vue CLI安装详解

     一,脚手架安装 Node 版本要求 Vue CLI 需要 Node.js +).你可以使用 nvm 或 nvm-windows 在同一台电脑中管理多个 Node 版本. 1,全局安装Vue CLI ...

随机推荐

  1. 解决校园Dr客户端端口占用问题(2)

    win + R -> 输入cmd回车 -> 输入netsh winsock reset重启 -> 好了享受上网的快乐吧骚年

  2. R: plot 绘图各种参数,以及 legend。。

    ################################################### 问题:基础绘图plot   18.4.30 plot函数,基础绘图的各个参数? 解决方案: ca ...

  3. spark sql建表的异常

    在使用spark sql创建表的时候提示如下错误: missing EOF at 'from' near ')' 可以看下你的建表语句中是不是create external table ....   ...

  4. str() 和repr()的区别

    >>> a='bbc' >>> a'bbc'>>> print abbc str()一般是将数值转成字符串:repr()是将一个对象转成字符串显示 ...

  5. c语言中的const的作用及解析

    有时候我们希望定义这样一种变量,它的值不能被改变,在整个作用域中都保持固定.例如,用一个变量来表示班级的最大人数,或者表示缓冲区的大小.为了满足这一要求,可以使用const关键字对变量加以限定: co ...

  6. Windows 安装 mysql-5.7.12-winx64(CommunityServer) 备忘

    下载后文件名 mysql-5.7.12-winx64.msi 以为还是会和以往一样,一路next傻瓜式安装并完成设置,然后启动运行,但实际情况不是,感觉就是一解压过程,然后点击The MySQL Co ...

  7. JavaScript 测试和捕捉(try与catch)

    JavaScript 测试和捕捉 try 语句允许我们定义在执行时进行错误测试的代码块. catch 语句允许我们定义当 try 代码块发生错误时,所执行的代码块. JavaScript 语句 try ...

  8. JAVA学习第三篇Boolean

    Boolean是布尔值. 布尔值只有两个值:真和假.写作:true false. 那么如何使用呢? 最简单的用法: public class demo{ public static void main ...

  9. Notification通知代码简洁使用

    1.自定义发送 Notification 的使用 1.1 通知(消息)的创建 ---------------详细介绍篇 // 不带消息内容 NSNotification *notification1 ...

  10. 解决VMware Workstation 不可恢复错误: (vcpu-0)

    转载:http://tieba.baidu.com/p/3487673152 如图的错误 如果你按照破解了mac支持的VMware Workstation 11的新建虚拟机向导一步一步创建了一个mac ...