MySQL 法布里c是Oracle提供的用于支援进行ha,法布里c由多个零部件组成

MySQL Fabric安装

MySQL:Fabric 安装,mysqlfabric安装

MySQL Fabric安装

 

MySQL Fabric是Oracle提供的用于支援进行ha\sharding的工具,它的骨干框架结构:

 图片 1

 

 

从地点看出,借助于法布里c, 能够搭建 HA 集群、Sharing 、HA+Sharding。

采纳从fabric中搜查缴获各样数据库、表、分区等的照射关系,然后访问相应的mysql
实例。

 

法布里c由两个零部件组成:

1)fabric 的管理工科具(相当于 mysqlfabric)。

2)fabric
nodes,能够运维1到多少个node。每一个node也是一个经过。用于拍卖fabric的管理请求、应用的mapping请求。

3)backstore,它也是二个mysql server,维护了HA Group、Sharding Group。

 

 

 

下载

 

在mysql
5.6随后的版本,能够利用fabric的相应版本是1.5,在mysql官网上能够直接下载。由于fabric是由python语言编写的,并且当中通信用会用到
mysql-connector- python,所以也要下载对应的python驱动。

         作者下载的本子是:

mysql-utiltities-1.5.6-1.el6.noarch.rpm
mysql-connector-ptyhon-2.0.4-1.el6.noarch.rpm

 

  

安装

壹 、安装介质

运用操作系统root用户来安装。

先安装mysql-connector-ptyhon,再安装mysql-utilities:

rpm –i mysql-connector-ptyhon-2.0.4-1.el6.noarch.rpm
rpm –i mysql-utiltities-1.5.6-1.el6.noarch.rpm

 安装收尾后,会有1个mysqlfabric命令能够选拔。所以能够通过该命令来判断是或不是安装成功。

贰 、配置文件

在装置好fabric之后,就会有一个暗中认可的布局文件:fabric.cfg。

默许的配备文件的职位:

Platform

Package

Location

Microsoft Windows

mysql-utilities-1.5.6-win32.msi

UTILITIES_INSTALLDIR/etc/mysql/fabric.cfg

Ubuntu Linux 14.04

mysql-utilities_1.5.6-1ubuntu14.04_all.deb

/etc/mysql/fabric.cfg

Debian Linux 6.0

mysql-utilities_1.5.6-1debian6.0_all.deb

/etc/mysql/fabric.cfg

Red Hat Enterprise Linux 6 / Oracle Linux 6

mysql-utilities-1.5.6-1.el6.noarch.rpm

/etc/mysql/fabric.cfg

OS X

mysql-utilities-1.5.6-osx10.9.dmg

/etc/mysql/fabric.cfg

 

暗中同意的安顿文件预览:

[DEFAULT]
prefix = /usr/local
sysconfdir = /usr/local/etc
logdir = /var/log

[storage]
address = localhost:3306
user = fabric_store
password = secret
database = mysql_fabric
auth_plugin = mysql_native_password
connection_timeout = 6
connection_attempts = 6
connection_delay = 1

[servers]
user = fabric_server
password = secret
backup_user = fabric_backup
backup_password = secret
restore_user = fabric_restore
restore_password = secret
unreachable_timeout = 5

[protocol.xmlrpc]
address = localhost:32274
threads = 5
user = admin
password = secret
disable_authentication = no
realm = MySQL Fabric
ssl_ca =
ssl_cert =
ssl_key =

[protocol.mysql]
address = localhost:32275
user = admin
password = secret
disable_authentication = no
ssl_ca =
ssl_cert =
ssl_key =

[executor]
executors = 5

[logging]
level = INFO
url = file:///var/log/fabric.log

[sharding]
mysqldump_program = /usr/bin/mysqldump
mysqlclient_program = /usr/bin/mysql

[statistics]
prune_time = 3600

[failure_tracking]
notifications = 300
notification_clients = 50
notification_interval = 60
failover_interval = 0
detections = 3
detection_interval = 6
detection_timeout = 1
prune_time = 3600

[connector]
ttl = 1

 

在这么些布局文件中,会涉及到很种种帐户:
·backstore

在[storage]区域,用来布署backstore mysql
server的新闻。所以那里配置的就是backstore mysql server的操作帐户。

该用户必需的权位:

ALTER              - alter some database objects
CREATE             - create most database objects
CREATE VIEW        - create views
DELETE             - delete rows
DROP               - drop most database objects
EVENT              - manage events
REFERENCES         - foreign keys
INDEX              - create indexes
INSERT             - insert rows
SELECT             - select rows
UPDATE             - update rows

  

·server

在[servers]区域布局的,是装有的受管mysql server的帐户。

该用户必需的权柄:

内部全局满围的权位:

DELETE             - prune_shard
PROCESS            - list sessions to kill
RELOAD             - RESET SLAVE
REPLICATION CLIENT - SHOW SLAVE STATUS
REPLICATION SLAVE  - SHOW SLAVE HOSTS

 

其中法布里c 数据库的权杖:

ALTER              - alter some database objects
CREATE             - create most database objects
DELETE             - delete rows
DROP               - drop most database objects
INSERT             - insert rows
SELECT             - select rows
UPDATE             - update rows

 

·backup

在[servers]区域布局的,它是负有的受管mysql
server上用以backup的帐户。例如执行mysqldump。

该用户的权限:

EVENT              - show event information
EXECUTE            - show routine information inside views
REFERENCES         - foreign keys
SELECT             - read data
SHOW VIEW          - SHOW CREATE VIEW
TRIGGER            - show trigger information

 

·restore

在[servers]区域布局的,它是有所的受管mysql
server上用来restore的帐户。Restore 用户能够运用mysql
client执行restore操作。

该用户的权限:

ALTER              - ALTER DATABASE
ALTER ROUTINE      - ALTER {PROCEDURE|FUNCTION}
CREATE             - CREATE TABLE
CREATE ROUTINE     - CREATE {PROCEDURE|FUNCTION}
CREATE TABLESPACE  - CREATE TABLESPACE
CREATE VIEW        - CREATE VIEW
DROP               - DROP TABLE (used before CREATE TABLE)
EVENT              - DROP/CREATE EVENT
INSERT             - write data
LOCK TABLES        - LOCK TABLES (--single-transaction)
REFERENCES         - Create tables with foreign keys
SELECT             - LOCK TABLES (--single-transaction)
SUPER              - SET @@SESSION.SQL_LOG_BIN = 0
TRIGGER            - CREATE TRIGGER

 

·admin 

在[protocol.mysql]、[protocol.xmlrpc]中布局的admin用户,是法布里c
CLI(mysqlfabric) 与fabric node交互操使用的用户、密码。

 在行使mysqlfabric时,能够行使暗许的陈设文件,也可以动用自定义的安顿文件。不管采纳哪个配置文件,相关的布局项都以要配的。

 

 

3、创建backstore 帐户

创办八个mysql 实例作为fabric 的backstore。然后创设1个fabric
backstore帐户。

CREATE USER 'fabric_store'@'localhost'
   IDENTIFIED BY 'secret';

GRANT ALTER, CREATE, CREATE VIEW, DELETE, DROP, EVENT,
   INDEX, INSERT, REFERENCES, SELECT, UPDATE ON mysql_fabric.*
   TO 'fabric_store'@'localhost';

始建的那几个用户名、密码要跟配置文件fabric.cfg中[storeage]区域中的user、password相同。 

那时fabric数据库还不曾创制,但是也毫无本身去创立。

 

4、初始化fabric数据库、表

使用mysqlfabric初始化:

mysqlfabric manage setup

若是要运用自定义的fabric.cfg配置文件:

 

mysqlfabric --config=/your/fabric/cfg/path manage setup

 

5、mysqlfabric命令

1)启动fabric节点

mysqlfabric --config=/your/fabric/cfg/path manage start

2)停止fabric节点 

mysqlfabric --config=/your/fabric/cfg/path manage stop

关于其余命令,能够参见官方文书档案。 

 

http://www.bkjia.com/Mysql/1183314.htmlwww.bkjia.comtruehttp://www.bkjia.com/Mysql/1183314.htmlTechArticleMySQL:Fabric 安装,mysqlfabric安装 MySQL
法布里c安装 MySQL
法布里c是Oracle提供的用于帮忙举行ha\sharding的工具,它的着力架构:
从地方看出,借助于…

 

MySQL 法布里c是Oracle提供的用于支援进行ha\sharding的工具,它的宗旨框架结构:

 图片 2

 

 

从下面看出,借助于法布里c, 能够搭建 HA 集群、Sharing 、HA+Sharding。

利用从fabric中获悉各类数据库、表、分区等的投射关系,然后访问相应的mysql
实例。

 

法布里c由多少个零件组成:

1)fabric 的管理工具(也正是 mysqlfabric)。

2)fabric
nodes,能够运维1到多个node。每一种node也是1个进程。用于拍卖fabric的田管请求、应用的mapping请求。

3)backstore,它也是贰个mysql server,维护了HA Group、Sharding Group。

 

 

 

下载

 

在mysql
5.6事后的本子,能够行使fabric的相应版本是1.5,在mysql官网上可以直接下载。由于fabric是由python语言编写的,并且个中通讯用会用到
mysql-connector- python,所以也要下载对应的python驱动。

         笔者下载的本子是:

mysql-utiltities-1.5.6-1.el6.noarch.rpm
mysql-connector-ptyhon-2.0.4-1.el6.noarch.rpm

 

  

安装

一 、安装介质

动用操作系统root用户来设置。

先安装mysql-connector-ptyhon,再安装mysql-utilities:

rpm –i mysql-connector-ptyhon-2.0.4-1.el6.noarch.rpm
rpm –i mysql-utiltities-1.5.6-1.el6.noarch.rpm

 安装收尾后,会有1个mysqlfabric命令可以利用。所以能够透过该命令来判定是不是安装成功。

② 、配置文件

在装置好fabric之后,就会有多个默许的安插文件:fabric.cfg。

私下认可的配备文件的岗位:

Platform

Package

Location

Microsoft Windows

mysql-utilities-1.5.6-win32.msi

UTILITIES_INSTALLDIR/etc/mysql/fabric.cfg

Ubuntu Linux 14.04

mysql-utilities_1.5.6-1ubuntu14.04_all.deb

/etc/mysql/fabric.cfg

Debian Linux 6.0

mysql-utilities_1.5.6-1debian6.0_all.deb

/etc/mysql/fabric.cfg

Red Hat Enterprise Linux 6 / Oracle Linux 6

mysql-utilities-1.5.6-1.el6.noarch.rpm

/etc/mysql/fabric.cfg

OS X

mysql-utilities-1.5.6-osx10.9.dmg

/etc/mysql/fabric.cfg

 

默许的陈设文件预览:

[DEFAULT]
prefix = /usr/local
sysconfdir = /usr/local/etc
logdir = /var/log

[storage]
address = localhost:3306
user = fabric_store
password = secret
database = mysql_fabric
auth_plugin = mysql_native_password
connection_timeout = 6
connection_attempts = 6
connection_delay = 1

[servers]
user = fabric_server
password = secret
backup_user = fabric_backup
backup_password = secret
restore_user = fabric_restore
restore_password = secret
unreachable_timeout = 5

[protocol.xmlrpc]
address = localhost:32274
threads = 5
user = admin
password = secret
disable_authentication = no
realm = MySQL Fabric
ssl_ca =
ssl_cert =
ssl_key =

[protocol.mysql]
address = localhost:32275
user = admin
password = secret
disable_authentication = no
ssl_ca =
ssl_cert =
ssl_key =

[executor]
executors = 5

[logging]
level = INFO
url = file:///var/log/fabric.log

[sharding]
mysqldump_program = /usr/bin/mysqldump
mysqlclient_program = /usr/bin/mysql

[statistics]
prune_time = 3600

[failure_tracking]
notifications = 300
notification_clients = 50
notification_interval = 60
failover_interval = 0
detections = 3
detection_interval = 6
detection_timeout = 1
prune_time = 3600

[connector]
ttl = 1

 

在这一个布局文件中,会提到到很二种帐户:
·backstore

在[storage]区域,用来配置backstore mysql
server的消息。所以那里配置的正是backstore mysql server的操作帐户。

该用户必需的权位:

ALTER              - alter some database objects
CREATE             - create most database objects
CREATE VIEW        - create views
DELETE             - delete rows
DROP               - drop most database objects
EVENT              - manage events
REFERENCES         - foreign keys
INDEX              - create indexes
INSERT             - insert rows
SELECT             - select rows
UPDATE             - update rows

  

·server

在[servers]区域布局的,是兼具的受管mysql server的帐户。

该用户必需的权柄:

中间全局满围的权位:

DELETE             - prune_shard
PROCESS            - list sessions to kill
RELOAD             - RESET SLAVE
REPLICATION CLIENT - SHOW SLAVE STATUS
REPLICATION SLAVE  - SHOW SLAVE HOSTS

 

其间法布里c 数据库的权杖:

ALTER              - alter some database objects
CREATE             - create most database objects
DELETE             - delete rows
DROP               - drop most database objects
INSERT             - insert rows
SELECT             - select rows
UPDATE             - update rows

 

·backup

在[servers]区域布局的,它是持有的受管mysql
server上用以backup的帐户。例如执行mysqldump。

该用户的权限:

EVENT              - show event information
EXECUTE            - show routine information inside views
REFERENCES         - foreign keys
SELECT             - read data
SHOW VIEW          - SHOW CREATE VIEW
TRIGGER            - show trigger information

 

·restore

在[servers]区域布局的,它是装有的受管mysql
server上用来restore的帐户。Restore 用户能够动用mysql
client执行restore操作。

该用户的权限:

ALTER              - ALTER DATABASE
ALTER ROUTINE      - ALTER {PROCEDURE|FUNCTION}
CREATE             - CREATE TABLE
CREATE ROUTINE     - CREATE {PROCEDURE|FUNCTION}
CREATE TABLESPACE  - CREATE TABLESPACE
CREATE VIEW        - CREATE VIEW
DROP               - DROP TABLE (used before CREATE TABLE)
EVENT              - DROP/CREATE EVENT
INSERT             - write data
LOCK TABLES        - LOCK TABLES (--single-transaction)
REFERENCES         - Create tables with foreign keys
SELECT             - LOCK TABLES (--single-transaction)
SUPER              - SET @@SESSION.SQL_LOG_BIN = 0
TRIGGER            - CREATE TRIGGER

 

·admin 

在[protocol.mysql]、[protocol.xmlrpc]中布局的admin用户,是法布里c
的客户端(包含mysqlfabric、使用jdbc驱动的施用等) 与fabric
node交互使用的用户、密码。

 在应用mysqlfabric时,可以应用默许的布局文件,也足以利用自定义的安排文件。不管选择哪个配置文件,相关的配置项都以要配的。

 

 

3、创建backstore 帐户

创制3个mysql 实例作为fabric 的backstore。然后创造一个fabric
backstore帐户。

CREATE USER 'fabric_store'@'localhost'
   IDENTIFIED BY 'secret';

GRANT ALTER, CREATE, CREATE VIEW, DELETE, DROP, EVENT,
   INDEX, INSERT, REFERENCES, SELECT, UPDATE ON mysql_fabric.*
   TO 'fabric_store'@'localhost';

创办的那一个用户名、密码要跟配置文件fabric.cfg中[storeage]区域中的user、password相同。 

此时fabric数据库还平昔不成立,可是也毫不本身去成立。

 

4、初始化fabric数据库、表

使用mysqlfabric初始化:

mysqlfabric manage setup

假使要使用自定义的fabric.cfg配置文件:

 

mysqlfabric --config=/your/fabric/cfg/path manage setup

 

5、mysqlfabric命令

1)启动fabric节点

mysqlfabric --config=/your/fabric/cfg/path manage start

2)停止fabric节点 

mysqlfabric --config=/your/fabric/cfg/path manage stop

至于其它命令,能够参见官方文书档案。 

 

相关文章