In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
MySQL Fabric installation
MySQL Fabric is a tool provided by Oracle to assist with ha\ sharding, and its basic architecture:
As you can see from the above, with the help of Fabric, you can build HA clusters, Sharing, HA+Sharding.
The application learns the mapping relationship of each database, table, partition and so on from fabric, and then accesses the corresponding mysql instance.
Fabric consists of three components:
1) fabric management tool (that is, mysqlfabric).
2) fabric nodes, you can start 1 or more node. Each node is also a process. Used to process management requests of fabric and mapping requests of applications.
3) backstore, which is also a mysql server, maintains HA Group and Sharding Group.
download
After mysql 5.6, the corresponding version of fabric is 1.5, which can be downloaded directly from the official website of mysql. Since fabric is written in python and mysql-connector- python is used for internal communication, download the corresponding python driver as well.
The version I downloaded is:
Mysql-utiltities-1.5.6-1.el6.noarch.rpmmysql-connector-ptyhon-2.0.4-1.el6.noarch.rpm
Installation
1. Installation media
Use the operating system root user to install.
Install mysql-connector-ptyhon before installing mysql-utilities:
Rpm-I mysql-connector-ptyhon-2.0.4-1.el6.noarch.rpmrpm-I mysql-utiltities-1.5.6-1.el6.noarch.rpm
After installation, a mysqlfabric command will be available. So you can use this command to determine whether the installation is successful or not.
2. Configuration file
After you install fabric, you will have a default configuration file: fabric.cfg.
Location of the default profile:
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 profile preview:
[DEFAULT] prefix = / usr/localsysconfdir = / usr/local/etclogdir = / var/ log [storage] address = localhost:3306user = secretdatabase = mysql_fabricauth_plugin = mysql_native_passwordconnection_timeout = 6connection_delay = 1 [servers] user = fabric_serverpassword = fabric_backupbackup_password = secretrestore_user = secretunreachable_timeout = 5 [protocol.xmlrpc] address = localhost:32274threads = 5user = adminpassword = secretdisable_authentication = norealm = MySQL Fabricssl_ca = ssl_ Cert = ssl_key = [protocol.mysql] address = localhost:32275user = adminpassword = secretdisable_authentication = nossl_ca = ssl_cert = ssl_key = [executor] executors = 5 [logging] level = INFOurl = file:///var/log/fabric.log[sharding]mysqldump_program = / usr/bin/mysqldumpmysqlclient_program = / usr/bin/ MySQL [statistics] prune_time = 3600 [failure_tracking] notifications = 300notification_clients = 50notification_interval = 60failover_interval = 0detections = 3detection_interval = 6detection_timeout = 1prune_time = 3600 [connector] ttl = 1
In this configuration file, many kinds of accounts are involved:
Backstore
In the [storage] area, the information used to configure backstore mysql server. So what is configured here is the operation account of backstore mysql server.
Required permissions for this user:
ALTER-alter some database objectsCREATE-create most database objectsCREATE VIEW-create viewsDELETE-delete rowsDROP-drop most database objectsEVENT-manage eventsREFERENCES-foreign keysINDEX-create indexesINSERT-insert rowsSELECT-select rowsUPDATE-update rows
Server
Configured in the [servers] area are the accounts of all managed mysql server.
Required permissions for this user:
The global permissions are as follows:
DELETE-prune_shardPROCESS-list sessions to killRELOAD-RESET SLAVEREPLICATION CLIENT-SHOW SLAVE STATUSREPLICATION SLAVE-SHOW SLAVE HOSTS
The permissions of the Fabric database:
ALTER-alter some database objectsCREATE-create most database objectsDELETE-delete rowsDROP-drop most database objectsINSERT-insert rowsSELECT-select rowsUPDATE-update rows
Backup
Configured in the [servers] area, it is the account for backup on all managed mysql server. For example, perform a mysqldump.
Permissions of the user:
EVENT-show event informationEXECUTE-show routine information inside viewsREFERENCES-foreign keysSELECT-read dataSHOW VIEW-SHOW CREATE VIEWTRIGGER-show trigger information
Restore
Configured in the [servers] area, it is the account for restore on all managed mysql server. Restore users can use mysql client to perform restore operations.
Permissions of the user:
ALTER-ALTER DATABASEALTER ROUTINE-ALTER {PROCEDURE | FUNCTION} CREATE-CREATE TABLECREATE ROUTINE-CREATE {PROCEDURE | FUNCTION} CREATE TABLESPACE-CREATE TABLESPACECREATE VIEW-CREATE VIEWDROP-DROP TABLE (used before CREATE TABLE) EVENT-DROP/CREATE EVENTINSERT-write dataLOCK TABLES-LOCK TABLES (--single-transaction) REFERENCES-Create tables with foreign keysSELECT -LOCK TABLES (--single-transaction) SUPER-SET @ @ SESSION.SQL_LOG_BIN = 0TRIGGER-CREATE TRIGGER
Admin
The admin users configured in [protocol.mysql] and [protocol.xmlrpc] are the users and passwords used by Fabric clients (including mysqlfabric, jdbc-driven applications, etc.) to interact with fabric node.
When using mysqlfabric, you can use either a default profile or a custom profile. No matter which configuration file is used, the relevant configuration items are to be matched.
3. Create a backstore account
Create an instance of mysql as the backstore of fabric. Then create a fabric backstore account.
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'
The user name and password created should be the same as the user and password in the [storeage] area of the configuration file fabric.cfg.
The fabric database hasn't been created yet, but don't create it yourself.
4. Initialize fabric database and table
Initialize with mysqlfabric:
Mysqlfabric manage setup
To use a custom fabric.cfg profile:
Mysqlfabric-config=/your/fabric/cfg/path manage setup
5. Mysqlfabric command
1) start the fabric node
Mysqlfabric-config=/your/fabric/cfg/path manage start
2) stop the fabric node
Mysqlfabric-config=/your/fabric/cfg/path manage stop
As for other commands, you can refer to the official documentation.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.