MySQL:Fabric 安装,mysqlfabric安装

/etc/mysql/fabric.cfg

MySQL:Fabric 安装,mysqlfabric安装

MySQL Fabric安装

 

MySQL 法布里c是Oracle提供的用于扶助举行hasharding的工具,它的为主框架结构:

 图片 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

 

  

安装

1、安装介质

应用操作系统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

 安装达成后,会有一个mysqlfabric命令能够行使。所以能够经过该命令来判定是或不是安装成功。

2、配置文件

在设置好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。然后创设二个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

关于其余命令,可以参照官方文书档案。 

 

安装,mysqlfabric安装 MySQL 法布里c安装 MySQL 法布里c是Oracle提供的用来扶助进行hasharding的工具,它的主干架构: 从地方看出,借助于...

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

3、创建backstore 帐户

MySQL Fabric安装

  

mysqlfabric manage setup

此时fabric数据库还尚无开创,可是也绝不自身去创造。

Microsoft Windows

 

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

Platform

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

该客商的权杖:

该顾客的权柄:

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

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

下载

 

/etc/mysql/fabric.cfg

 

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

Red Hat Enterprise Linux 6 / Oracle Linux 6

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

内部全局满围的权位:

 

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

 

该客商必需的权杖:

暗中认可的布局文件预览:

在装置好fabric之后,就能够有贰个暗许的配备文件:fabric.cfg。

使用mysqlfabric初始化:

·backup

 

1)启动fabric节点

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

MySQL 法布里c是Oracle提供的用来扶持举行hasharding的工具,它的主导架构:

UTILITIES_INSTALLDIR/etc/mysql/fabric.cfg

 

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

 

接纳操作系统root客户来设置。

Debian Linux 6.0

 

 

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

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

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

 

 在选择mysqlfabric时,能够运用私下认可的安插文件,也能够行使自定义的布局文件。不管采用哪个配置文件,相关的安排项都以要配的。

/etc/mysql/fabric.cfg

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

创造的这么些客户名、密码要跟配置文件fabric.cfg中[storeage]区域中的user、password同样。 

·admin 

 

2)fabric nodes,能够运维1到多少个node。每种node也是贰个进度。用于拍卖fabric的管住诉求、应用的mapping伏乞。

Ubuntu Linux 14.04

暗中认可的配备文件的地点:

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

/etc/mysql/fabric.cfg

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

 

万一要利用自定义的fabric.cfg配置文件:

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

 

该客商必须的权位:

mysql-utilities-1.5.6-osx10.9.dmg

Package

 

安装

[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

 图片 2

在[servers]区域布局的,它是富有的受管mysql server上用来backup的帐户。举个例子实践mysqldump。

Location

 

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

  

5、mysqlfabric命令

在[storage]区域,用来安顿backstore mysql server的音讯。所以那边配置的就是backstore mysql server的操作帐户。

 

 

         笔者下载的版本是:

 

在[servers]区域布局的,它是兼具的受管mysql server上用于restore的帐户。Restore 客商能够使用mysql client实行restore操作。

4、初始化fabric数据库、表

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

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

在那几个布局文件中,会提到到非常多种帐户:
·backstore

·server

OS X

当中法布里c 数据库的权限:

1、安装介质

·restore

动用从fabric中摸清种种数据库、表、分区等的映照关系,然后访问相应的mysql 实例。

 

在mysql 5.6后头的本子,能够行使fabric的应和版本是1.5,在mysql官方网址络可以间接下载。由于fabric是由python语言编写的,並且当中通讯用会用到 mysql-connector- python,所以也要下载对应的python驱动。

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';

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

2、配置文件

2)停止fabric节点 

mysql-utilities-1.5.6-win32.msi

 

 安装收尾后,会有二个mysqlfabric命令能够利用。所以能够透过该命令来剖断是还是不是安装成功。

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

本文由开元棋牌发布于数据库,转载请注明出处:MySQL:Fabric 安装,mysqlfabric安装

TAG标签:
Ctrl+D 将本页面保存为书签,全面了解最新资讯,方便快捷。