MySQL Replication is a well-known approach to providing
high-availability and scaling out read-only operations (i.e.
transactions) as well. In order to make it easy to exploit this
scalability axis, we have extended both Fabric and the
connectors' interface so that an application can express its
willingness to execute a read-only operation and have its request
redirected to the server that is most capable of handling
it.
In this post, we are going to describe how we can use Fabric and
the connector python to scale out read-only operations. We need
to introduce some concepts first though.
Fabric organizes the servers in high-availability groups, uses
the standard MySQL Replication to synchronize the servers which
can be classified according to its status, mode and weight. The
blog post MySQL Fabric …
Github user Adrianlzt provided a python-twisted alternative version of pyclustercheck per discussion on issue 7.
Due to sporadic performance issues noted with the original implementation in SimpleHTTPserver, the benchmarks which I’ve included as part of the project on github use mutli-mechanize library,
- cache time 1 sec
- 2 x 100 thread pools
- 60s ramp up time
- 600s total duration
- testing simulated node fail (always returns 503, rechecks mysql node on cache expiry)
- AMD FX(tm)-8350 Eight-Core Processor
- Intel 330 SSD
- local loop back test (127.0.0.1)
The SimpleHTTPServer instance faired as follows:
…
[Read more]
If we want to run the application presented in "Writing a Fault-tolerant Database Application
using MySQL Fabric" with MySQL Fabric 1.4.2 Release
Candidate, some changes to the application are required. In
the previous post, we used MySQL Fabric 1.4.0 Alpha and many
changes have been made since this version. We can find an updated
version of the application here:
- Updated application, ready to use with MySQL Fabric 1.4.2 Release Candidate.
Recall that the application creates a simple database, a high availability group, registers the MySQL Servers into Fabric and runs a thread that mimics a client and another one that periodically executes a switch …
[Read more]
The MySQL Utilities Team is pleased to announce the latest
release candidate (RC) release of MySQL Utilities. This release
includes a number of improvements for useabilty, stability, and a
few enhancements. A complete list of all improvements can be
found in our release_notes.
New Utilities!
We have also included two new utilities.
- The mysqlrplsync utility was added, which checks data consistency between servers in a replicated setup.
- The mysqlrplms utility was added, which provides round-robin multi-source replication (a slave server continually cycles through multiple masters in order to store a consolidated data set).
How Can I Download MySQL Utilities?
You can download MySQL Utilities 1.4.2 from the following link
using one of the pre-built …
To install and run MySQL Fabric, we need:
- Python 2.6 or 2.7
- Connector Python (MySQL Fabric-aware Version 1.2.1 or later)
- One or more MySQL servers installed and running (5.6.10 or
later):
- Backing Store
- Managed Servers
- MySQL Utilities 1.4.2 or later
Python 2.6 or 2.7
We can use the following command to check whether
python is installed in our machine or not:
$ python --version
If you don't have the appropriate version installed, please, read
through the following web page and find out how to download and
install python 2.6 or 2.7:
Monday 31 March 2014 proved to be a big day for MySQL with 5 announcements of products getting new releases: the next milestone release MySQL Server 5.7.4, MySQL Workbench 6.1 going GA and Connector/J 5.1.30 and MySQL Utilities 1.4.2 RC which include MySQL Fabric. That’s 4, the fifth being Connector/Python.
Connector/Python v1.2.1 has been released as Release Candidate. Check out the …
[Read more]As you saw in the press release, MySQL Fabric 1.4.2 is now released! If you're interested in learning more about MySQL Fabric, there is a session April 3, 2014 11:10–12pm titled Sharding and Scale-out using MySQL Fabric in Ballroom G.
MySQL Fabric is a relatively new project in the MySQL ecosystem and it focuses on building a framework for working with large deployments of MySQL Servers. The architecture of MySQL Fabric is such that it allows extensions to be added and the first two extensions that we added were support for high-availability using High-Availability groups (HA groups) and sharding to manage very large databases. The first version of sharding have hash and range sharding implemented as well as …
[Read more]Problem
Using MySQL Connector/Python, you are calling a stored procedure which is also selecting data and you would like to fetch the rows of the result.
Solution
For this example we create a stored procedure which is executing SHOW SLAVE STATUS.
cnx = mysql.connector.connect(user='scott', password='tiger',
database='mining')
cur = cnx.cursor()
cur.execute("DROP PROCEDURE IF EXISTS slave_status")
proc = "CREATE PROCEDURE slave_status () BEGIN SHOW SLAVE STATUS; END"
cur.execute()
cur.call("slave_status")
for result_cursor in cur.stored_results():
for row in result_cursor:
print(row[0])
The result from the above would be:
shell> python foo.py Waiting for master to send event
Discussion
The stored_results() method of …
[Read more]Often I would need to work on customer servers where MySQL Utilities would be a really good fit for the tools I need. However, I would not want to mess around with the customer servers just to have it running so I would have the tools built and sandboxed on its own directory where I can cleanup later. Here’s how:
cd ~ wget http://mysql.mirrors.hoobly.com/Downloads/MySQLGUITools/mysql-utilities-1.4.1.tar.gz tar xzf mysql-utilities-1.4.1.tar.gz cd mysql-utilities-1.4.1 python setup.py build python setup.py install --root=/home/revin/mysql-utilities-1.4.1 export PYTHONPATH=.:/home/revin/mysql-utilities-1.4.1/usr/lib/python2.6/site-packages /home/revin/mysql-utilities-1.4.1/usr/bin/mysqlfrm --help
Your source of the package and install directory may vary – enjoy!
This week we released MySQL Connector/Python v1.1.6 has been released with a fix for the Django backend. If you wonder (or not?) where Connector/Python v1.1.5, it got released a few weeks ago. Yes, PyPi has been updated! Don’t forget to use –allow-external using newest pip.
Some useful links:
- Documentation: http://dev.mysql.com/doc/connector-python/en/index.html
- Release Notes: …