Friday, September 27, 2013

MySQL Fabric - Sharding - Shard Maintenance


Let us start by listing the scenarios in which we will need to perform shard maintenance. In addition to periodic maintenance operations the following situations might mandate performing shard maintenance.

A shard is physically a server group. A single non-performant server can impact the latency of requests for the entire group. Hence we need to be able to pull out this non-performant server and replace it by a spare, without impacting the accessibility of the entire shard.

Maintenance activity might involve performing software upgrades on the different servers in the server group of the shard.

We might also need to upgrade the hardware on all the machines in the server group of a shard without impacting the accessibility of the entire data.

What if we want to form an alternate group and migrate the entire shard there? For example during times of heavy load we will want to create a group using more powerful servers, while during light load we might want to migrate to a group of more economical, less power consuming and cheaper machines.

Let us look at what options are available to do the above.


Sharding Topology

The topology we create has three shards. There are four server groups. One of the server groups serves as the Global group for the setup. Each of the server group has two MySQL servers, one serving as the master and another as the slave.

The assumption is that you have already gone through the following related blogs to create the above configuration.

Pulling out a non-performant server

We use the intrinsic HA management capabilities built into a Fabric server group to manage moving servers in and out seamlessly out of the shards.

case 1: Server is a master in the group

In the above setup assume we want to retire the MySQL Server running on host3:port3 (master in GROUPID1).

Step 1: Find the UUID of the server


mysqlfabric server lookup_uuid <host:port> <user_id> <password>


host:port – host:port of the server whose uuid we want to lookup (in the above

case host3:port3). 

user_id, password – credentials for the MySQL Server.


mysqlfabric group lookup_servers <group-id>


group-id – The group-id of the Group whose servers we want to lookup (in the 

above case GROUPID1).

Step 2: Choose another server in the group and promote that server into 



mysqlfabric group promote <group-id><server-uuid>


group-id – The group-id of the Group in which we want to promote a server to 

master (in the above case GROUPID1).

server-id – The server-id of the server which we want to promote as master.

Step 3: Remove the server from the group


mysqlfabric group remove <group-id> <server-uuid>


group-id – The groupid of the Group from which we want to remove a server (in 

the above case GROUPID1).

server-uuid – The uuid of the server which we want to remove from the group.

Now the server is safely out of the group. Now we can perform maintanence operations on the server and restore it later.

case 2: Server is a slave in the group

Step 1: Remove the server from the group
mysqlfabric group remove <group-id> <server-uuid>
group-id – The group-id of the group from which we want to remove a server (in the above case GROUPID1).
Server-uuid – The server UUID of the server we want to remove.


Performing software and hardware updates on a server

The same operation as above can be performed to remove the servers one by one and perform upgrades on them (or) we can move the entire shard to an alternate server group, upgrade all the servers in the current server group and move the
shard back.

Moving shards is explained below.

Moving the shard into another group

The sharding implementation supports a Move operations that allows moving a shard into another server group (a group with GROUPID4). The original server group is detached from the global group and will not receive any updates and its servers will not be reflected during lookups either.

While the move operation is in progress transactions can carry on without being affected.

For example to move a shard with shard-id=1 into a new group with new-group-id=GROUPID4. (The shard-id can be found using the command – mysqlfabric store dump_sharding_information)

mysqlfabric sharding move <shard-id> <new-group-id>

shard-id – The shard-id of the shard that needs to be moved (in this case 1)
new-group-id – The group-id of the server group into which this shard needs to be moved. (in this case GROUPID4).

Now we can cleanup and use the servers in GROUPID1 in whichever way we want.


  1. This comment has been removed by the author.


  2. Parking software condominium
    email blast to tenants
    Guest parking
    Web Parking Software- The Elite Software Solution for Condominiums and Apartments:
    If you are worn out browsing the web just to search for the superb software solution that is creatively developed, designed and intended for condominiums and apartments, worry no more since Web Parking Software is the best option that you should try and consider. Web Parking Software will greatly help you to convert your unorganized parking management into an easy and quick online management system. In addition to this, Web Parking Software has the ability to keep track of all maintenance people, guests, tenants and registrants and at the same time they have the potential to assign parking and allow them to login to update and manage their vehicles.
    Aside from this, there are also various level permissions and access that will allow managers, registrants and even HOA members to manage all aspects of parking. Web Parking Software is considered as one of the best web based software system that was built to manage all your parking related tasks online. With the existence of help of Web Parking Software, management companies can easily add their residential properties and all their tenants, occupants and registrants from every building to the system. Once you decided to avail the services of Web Parking Software, you can be sure that you will have a full control on your apartments and condominiums without worrying for any hassles and difficulties.
    With Web Parking Software, you can be sure that your apartments, condominiums and other business establishments are secure and safe and at the same time they are in the right hands. Furthermore, Web Parking Software has competent, reliable and professional management team that has vast expertise, understanding and knowledge in the field of providing such services to all their respected clients. Since Web Parking Software is web based, any decent computer with compatible browser, Safari, Firefox and Internet Explorer will do. Apart from this, Web Parking Software has Android and iPhone support that you will definitely love.
    When it comes to their service free, you don’t need to worry since the basic service of Web Parking Software is absolutely free. Web Parking Software works great for housing tracks, townhouses, condominiums, apartments and almost all kind of organization where a management acts to manage a building. Majority of their clients who already tried and avail their services are all amazed and satisfied with the quality of their web based parking software. On the other hand, Web Parking Software will keep their tenants and occupants connected to what is happening. With the help of Web Parking Software, you can be sure that your residential and commercial properties are safe and secure all the time.
    There is no other web based parking software that can beat the excellence of Web Parking Software and this is one of the top reasons why more and more people want to try and avail their services. If you want to know valuable information and details about Web Parking Software, don’t hesitate to visit their website at and rest assured that they will be glad and pleased to help you in solving your parking problems and issues.


  3. I truly like to reading your post. Thank you so much..

    Duct Cleaning

  4. This comment has been removed by the author.

  5. Our agency is inviting you to enter the world of fantasy by booking one of our beatiful PAKISTANI ESCORTSand uae

  6. We are famous for young female models Our Pakistani escorts have special qualities in their work they are very intelligent and friendly behavior Our Service is Very different than other as we have something very special Best Call Girls In pakistan for you. We have more than 50 top Elite Females models that are waiting for you. You can enjoy escort services by Pakistani escorts


  7. Thanks a lot for posting, seriously found out quite a lot right here. I really appreciate.

    Advertising Agency Austin
    Logo Design Austin

  8. Great information keep posting and visit my website for more Maintenance tips

  9. Thank you for this nice and well written article.I am associated with a company which providesapplication support in USA

  10. Hi , thanks for sharing your information.The insights are really helpful and informative. If anyone want to know about SERVICE APARTMENTS, I think this will be the right place for you.
    service apartments in coimbatore for rent
    service apartments in coimbatore


  11. Parking Management Software
    online parking software
    Cloud based parking solutions
    Free Parking Software for Town Houses, Condominiums, and Businesses Solves Parking Problems
    Searching for a parking space is such as frustrating routine activity for lots of people in cities all over the world. This search is burning over a million barrels of oil of the world each day. There are also 4-parking spaces every vehicle in the US and almost all streets are most of the time, empty, which leads to urban environments that are ironically doing far more to accommodate the vehicles than people. As the global population continuously urbanize, without a convenience-driven and well-planned retreat from cars, these sort of parking problems will worsen. software is the first step in the right decision. It involves using low-cost sensors, mobile phone-enabled, and real time data collection automated payment systems enabling people to reserve parking in advance or predict accurately where they can find a spot. When deployed as a system, free parking software thereby reduces car emissions in the urban centers by means of reducing the necessity for the people to circle the city blocks needlessly searching for parking. Furthermore, it permits the cities to manage their parking supply carefully.
    This free parking software is now being developed in many different states and cities around the United States and some other countries. For instance, in LA, smart meters and low-power sensors are tracking the occupancy of parking spaces across the Hollywood district, one of the most congested areas. The users will be able to access this occupancy data in order to determine the availability of the spots and then pay for them with their mobile phones. Other than the environmental benefits and lending convenience, free parking software is improving the utilization of the current parking, which lead to greater revenue for parking owners.
    These programs will be able to make great differences on a neighborhood level, but more widespread development and deployment is necessary for free parking software to change the cities and to contribute to the transportation sector pollution reductions greenhouse gas. One problem is that there are no citywide solutions all over the fragmented private and public parking providers. The occupancy data has a tendency to have many owners and is not accessible or standardized in a way that may enable software developers to turn into user-friendly applications. Thereby, individual smart parking efforts are so far successful locally, but uncoordinated, and operates in their own entrepreneurial or bureaucratic vacuums without a need to take gap between current free parking software and more widespread transportation system planning is an enormous missed opportunity for the cities to reduce the transportation related emissions.
    Moreover, free parking software has been hindered by a lack of insight into the complete benefits of this software, specifically when compared to the cost of building extra parking spaces. Lack of collaboration between communities with the parking software programs, as well as lack of coordination between hardware providers, municipalities, and developers is also contributing to the slower adoption of smart parking. Nevertheless, it is possible to overcome all these issues. Cities will be able further accelerate these advantages by means of updating the land use and building codes policies to reflect the reduced need for parking.