[root@localhost src]# cd /usr/local/src/
[root@localhost src]# tar zxvf mysql-router-2.0.3-linux-glibc2.12-x86-64bit.tar.gz -C /usr/local/soft/
[root@localhost src]# cd /usr/local/soft/
[root@localhost soft]# ll
total 36
drwxr-xr-x. 9 xiaojf xiaojf 4096 Oct 30 00:20 elasticsearch
drwxr-xr-x. 2 root root 4096 Jul 9 2016 filebeat
drwxr-xr-x. 8 uucp 143 4096 Apr 1 2016 jdk
drwxrwxr-x. 11 1000 1000 4096 Jul 10 2016 kibana
drwxr-xr-x. 6 root root 4096 Jul 9 2016 logstash
drwxrwxr-x. 7 7161 wheel 4096 Feb 22 2016 mysql-router-2.0.3-linux-glibc2.12-x86-64bit
drwxrwxr-x. 6 root root 4096 Dec 6 00:38 redis-3.2.6
drwxr-xr-x. 5 root root 4096 Jan 13 22:57 redis_cluster
drwxr-xr-x. 2 root root 4096 Jul 9 2016 tar
[root@localhost soft]# mv mysql-router-2.0.3-linux-glibc2.12-x86-64bit mysql-router
[root@localhost soft]# ll
total 36
drwxr-xr-x. 9 xiaojf xiaojf 4096 Oct 30 00:20 elasticsearch
drwxr-xr-x. 2 root root 4096 Jul 9 2016 filebeat
drwxr-xr-x. 8 uucp 143 4096 Apr 1 2016 jdk
drwxrwxr-x. 11 1000 1000 4096 Jul 10 2016 kibana
drwxr-xr-x. 6 root root 4096 Jul 9 2016 logstash
drwxrwxr-x. 7 7161 wheel 4096 Feb 22 2016 mysql-router
drwxrwxr-x. 6 root root 4096 Dec 6 00:38 redis-3.2.6
drwxr-xr-x. 5 root root 4096 Jan 13 22:57 redis_cluster
drwxr-xr-x. 2 root root 4096 Jul 9 2016 tar
[root@localhost mysql-router]# cd /usr/local/soft/mysql-router/
[root@localhost mysql-router]# touch mysqlrouter.ini
[root@localhost mysql-router]# vi mysqlrouter.ini
[DEFAULT]
logging_folder = /usr/local/soft/mysql-router/logs
[logger]
level = INFO
[routing:read_write]
bind_address = 192.168.59.128
bind_port = 8001
destinations = 192.168.59.128:3306
mode = read-write
max_connections = 1024
max_connect_errors = 100
client_connect_timeout = 9
[routing:read_only]
bind_address = 192.168.59.128
bind_port = 8002
destinations = 192.168.59.129:3306
mode = read-only
max_connections = 65535
max_connect_errors = 100
client_connect_timeout = 9
[root@localhost mysql-router]# mkdir -p /usr/local/soft/mysql-router/logs
[root@localhost mysql-router]./bin/mysqlrouter -c ./mysqlrouter.ini &
[root@localhost ~]# tail -f /usr/local/soft/mysql-router/logs/mysqlrouter.log
[root@localhost mysql-router]# mysql -uxiaojf -pxiaojf -P 8001
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 29
Server version: 5.6.28-log MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| elearning |
| mysql |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)
mysql>
[root@localhost src]# cd /usr/local/src/
[root@localhost src]# tar zxvf mysql-router-2.0.3-linux-glibc2.12-x86-64bit.tar.gz -C /usr/local/soft/
[root@localhost src]# cd /usr/local/soft/
[root@localhost soft]# ll
total 36
drwxr-xr-x. 9 xiaojf xiaojf 4096 Oct 30 00:20 elasticsearch
drwxr-xr-x. 2 root root 4096 Jul 9 2016 filebeat
drwxr-xr-x. 8 uucp 143 4096 Apr 1 2016 jdk
drwxrwxr-x. 11 1000 1000 4096 Jul 10 2016 kibana
drwxr-xr-x. 6 root root 4096 Jul 9 2016 logstash
drwxrwxr-x. 7 7161 wheel 4096 Feb 22 2016 mysql-router-2.0.3-linux-glibc2.12-x86-64bit
drwxrwxr-x. 6 root root 4096 Dec 6 00:38 redis-3.2.6
drwxr-xr-x. 5 root root 4096 Jan 13 22:57 redis_cluster
drwxr-xr-x. 2 root root 4096 Jul 9 2016 tar
[root@localhost soft]# mv mysql-router-2.0.3-linux-glibc2.12-x86-64bit mysql-router
[root@localhost soft]# ll
total 36
drwxr-xr-x. 9 xiaojf xiaojf 4096 Oct 30 00:20 elasticsearch
drwxr-xr-x. 2 root root 4096 Jul 9 2016 filebeat
drwxr-xr-x. 8 uucp 143 4096 Apr 1 2016 jdk
drwxrwxr-x. 11 1000 1000 4096 Jul 10 2016 kibana
drwxr-xr-x. 6 root root 4096 Jul 9 2016 logstash
drwxrwxr-x. 7 7161 wheel 4096 Feb 22 2016 mysql-router
drwxrwxr-x. 6 root root 4096 Dec 6 00:38 redis-3.2.6
drwxr-xr-x. 5 root root 4096 Jan 13 22:57 redis_cluster
drwxr-xr-x. 2 root root 4096 Jul 9 2016 tar
[root@localhost mysql-router]# cd /usr/local/soft/mysql-router/
[root@localhost mysql-router]# touch mysqlrouter.ini
[root@localhost mysql-router]# vi mysqlrouter.ini
[DEFAULT]
logging_folder = /usr/local/soft/mysql-router/logs
[logger]
level = INFO
[routing:read_write]
bind_address = 192.168.59.128
bind_port = 8001
destinations = 192.168.59.128:3306
mode = read-write
max_connections = 1024
max_connect_errors = 100
client_connect_timeout = 9
[routing:read_only]
bind_address = 192.168.59.128
bind_port = 8002
destinations = 192.168.59.129:3306
mode = read-only
max_connections = 65535
max_connect_errors = 100
client_connect_timeout = 9
[root@localhost mysql-router]# mkdir -p /usr/local/soft/mysql-router/logs
[root@localhost mysql-router]./bin/mysqlrouter -c ./mysqlrouter.ini &
[root@localhost ~]# tail -f /usr/local/soft/mysql-router/logs/mysqlrouter.log
[root@localhost mysql-router]# mysql -uxiaojf -pxiaojf -P 8001
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 29
Server version: 5.6.28-log MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| elearning |
| mysql |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)
mysql>
- Centos 7环境下配置MySQL 5.7读写分离
1.实验目的: 实现在Centos 7系统环境下,MySQL5.7读写分离. 2.实验条件: MySQL主服务器:Centos 7桌面环境,IP:10.10.11.31 MySQL从服务器:Cento ...
- 利用MySQL Router构建读写分离MGR集群
GreatSQL社区原创内容未经授权不得随意使用,转载请联系小编并注明来源. 目录 1. 部署MySQL Router 2. 启动mysqlrouter服务 3. 确认读写分离效果 4. 确认只读负载 ...
- MySQL5.6 实现主从复制,读写分离,分散单台服务器压力
闲来无事,在本地搭建几台虚拟机,准备配一个mysql读写分离的主从配置,版本选用最新版的,mysql.5.6.28 版本,本处使用源码安装(鄙人一向喜欢源码安装,因为centos中鄙人不知道yum安装 ...
- MySQL5.6 Replication主从复制(读写分离) 配置完整版
MySQL5.6 Replication主从复制(读写分离) 配置完整版 MySQL5.6主从复制(读写分离)教程 1.MySQL5.6开始主从复制有两种方式: 基于日志(binlog): 基于GTI ...
- Centos7.5部署MySQL5.7基于GTID主从复制+并行复制+半同步复制+读写分离(ProxySQL) 环境- 运维笔记 (完整版)
之前已经详细介绍了Mysql基于GTID主从复制的概念,原理和配置,下面整体记录下MySQL5.7基于GTID主从复制+并行复制+增强半同步复制+读写分离环境的实现过程,以便加深对mysql新特性GT ...
- spring+mybatis+mysql5.7实现读写分离,主从复制
申明:请尽量与我本博文所有的软件版本保持一致,避免不必要的错误. 所用软件版本列表:MySQL 5.7spring5mybaties3.4.6 首先搭建一个完整的spring5+springMVC5+ ...
- 利用mycat实现基于mysql5.5主从复制的读写分离
整体步骤: 1.准备好两台服务器,一台作为主数据库服务器,一台作为从服务器,并安装好mysql数据库,此处略 2.配置好主从同步 3.下载JDK配置mycat依赖的JAVA环境,mycat采用java ...
- MySQL5.6基于mysql-proxy实现读写分离
已经搭建好MySQL主从架构 10.205.22.185 #mysql-proxy 10.205.22.186 #master 10.205.22.187 #slave 1.安装mysql-proxy ...
- MySQL集群(三)mysql-proxy搭建负载均衡与读写分离
前言 前面学习了主从复制和主主复制,接下来给大家分享一下怎么去使用mysql-proxy这个插件去配置MySQL集群中的负载均衡以及读写分离. 注意:这里比较坑的就是mysql-proxy一直没有更新 ...
随机推荐
- 学习MVC之租房网站(二)-框架搭建及准备工作
在上一篇<学习MVC之租房网站(一)-项目概况>中,确定了UI+Service的“双层”架构,并据此建立了项目 接下来要编写Common类库.配置AdminWeb和FrontWeb 一.编 ...
- mac上使用使用rz,sz命令
mac上使用rz,sz命令,mac上的终端不支持rz 和sz,所以安装iterm并配置使用rz和cz 1.首先需要下载安装iterm2,下载地址:下载后安装 http://www.iterm2.cn/ ...
- CSS开发框架技术OOCSS编写和管理CSS的方法
目前最流行的CSS开发框架技术当属OOCSS,尽管还有其他类似技术(如BEM).这些方法试图对CSS采用面向对象的编程原则.样式语言与面向对象的设计原则在概念之间存在一定的问题.欠缺经验的人员可能不会 ...
- AngularJS创建新指令directive参数说明
var myapp = angular.module('myapp', []); myapp.directive('worldname', function() { return { template ...
- 运行第一个Docker容器
1. Docker介绍 Docker由dotCloud公司发起的一个内部项目,后来Docker火了,dotCloud公司改名为Docker了: Docker使用了Go语言开发,基于 Linux 内核的 ...
- SQLiteServer+SQLiteClient 用于.Net项目的SQLite服务端程序和客户端类库
SQLite没有官方的支持CS方式调用的方式,因项目需要我自行开发了一个简易的版本. 当前版本支持的方法 SQLiteOpen(fileName):bool SQLiteClose():void SQ ...
- Javascript中this关键字
this 是谁调用的时候,指定的是谁,通俗一点讲就是,函数是谁执行是不是由其中一个对象点出来的那就是代表它, 比如执行对象a中b函数a.b();这个b函数中this代表a; 当换成var c=a.b; ...
- 函数, lambda表达式
函数 函数:简单的理解,就是一次执行很多行代码 函数的返回值 函数的参数,和变量没区别 例: def hello(): print "hello world" hello() he ...
- 通过 U 盘启动重装 macOS 系统
重装系统是工作和生活中经常需要做的事情,作为一名开发人员,学会该技能你才是一名合格的程序猿!以后再也不会遇到"程旭元你会装系统吗?"的尴尬了!本文主要介绍怎样通过U盘启动重新安装 ...
- Gym - 101102C线段树
Judge Bahosain was bored at ACM AmrahCPC 2016 as the winner of the contest had the first rank from t ...