Documentation Home
MySQL Utilities 1.5 Manual
Related Documentation Download this Manual
PDF (US Ltr) - 1.5Mb
PDF (A4) - 1.5Mb
HTML Download (TGZ) - 289.5Kb
HTML Download (Zip) - 301.7Kb


MySQL Utilities 1.5 Manual  /  ...  /  Group Commands

8.4.4 Group Commands

The group commands are used to define, modify, and control groups.

  • Command: activate: Activate failure detector for server(s) in a group. By default the failure detector is disabled.

    Usage:
      mysqlfabric  group activate <group_id> [--synchronous]                    
    
    Parameters:
      <group_id>  Group's id.                                                   
    
    Options:
      --synchronous=SYNCHRONOUS                                                 
                Whether one should wait until the execution finishes or not. By 
                default True.                                                   
    
    Return:
      Tuple with job's uuid and status.
    
  • Command: add: Add a server into group. If users just want to update the state store and skip provisioning steps such as configuring replication, the update_only parameter must be set to true. Note that the current implementation has a simple provisioning step that makes the server point to the master if there is any.

    Usage:
      mysqlfabric  group add <group_id> <address> [--timeout=TIMEOUT]           
                   [--update_only] [--synchronous]                              
    
    Parameters:
      <group_id>  Group's id.                                                   
      <address>   Server's address.                                             
    
    Options:
      --timeout=TIMEOUT  Time in seconds after which an error is reported if one
                         cannot access the server. By default None.             
      --update_only=UPDATE_ONLY                                                 
                         By default False.                                      
      --synchronous=SYNCHRONOUS                                                 
                         Whether one should wait until the execution finishes or
                         not. By default True.                                  
    
    Return:
      Tuple with job's uuid and status.
    
  • Command: create: Create a group.

    Usage:
      mysqlfabric  group create <group_id> [--description=DESCRIPTION]          
                   [--synchronous]                                              
    
    Parameters:
      <group_id>  Group's id.                                                   
    
    Options:
      --description=DESCRIPTION                                                 
                Group's description. By default None.                           
      --synchronous=SYNCHRONOUS                                                 
                Whether one should wait until the execution finishes or not. By 
                default True.                                                   
    
    Return:
      Tuple with job's uuid and status.
    
  • Command: deactivate: Deactivate failure detector for server(s) in a group. By default the failure detector is disabled.

    Usage:
      mysqlfabric  group deactivate <group_id> [--synchronous]                  
    
    Parameters:
      <group_id>  Group's id.                                                   
    
    Options:
      --synchronous=SYNCHRONOUS                                                 
                Whether one should wait until the execution finishes or not. By 
                default True.                                                   
    
    Return:
      Tuple with job's uuid and status.
    
  • Command: demote: Demote the current master if there is one. If users just want to update the state store and skip provisioning steps such as configuring replication, the update_only parameter must be set to true. Otherwise any write access to the master is blocked, slaves are synchronized with the master, stopped and their replication configuration reset. Note that no slave is promoted as master.

    Usage:
      mysqlfabric  group demote <group_id> [--update_only] [--synchronous]      
    
    Parameters:
      <group_id>                                                                
    
    Options:
      --update_only=UPDATE_ONLY                                                 
                Only update the state store and skip provisioning. By default   
                False.                                                          
      --synchronous=SYNCHRONOUS                                                 
                Whether one should wait until the execution finishes or not. By 
                default True.                                                   
    
  • Command: description: Update a group's description.

    Usage:
      mysqlfabric  group description <group_id> [--description=DESCRIPTION]     
                   [--synchronous]                                              
    
    Parameters:
      <group_id>  Group's id.                                                   
    
    Options:
      --description=DESCRIPTION                                                 
                Group's description. By default None.                           
      --synchronous=SYNCHRONOUS                                                 
                Whether one should wait until the execution finishes or not. By 
                default True.                                                   
    
    Return:
      Tuple with job's uuid and status.
    
  • Command: destroy: Remove a group.

    Usage:
      mysqlfabric  group destroy <group_id> [--synchronous]                     
    
    Parameters:
      <group_id>  Group's id.                                                   
    
    Options:
      --synchronous=SYNCHRONOUS                                                 
                Whether one should wait until the execution finishes or not. By 
                default True.                                                   
    
    Return:
      Tuple with job's uuid and status.
    
  • Command: health: Check if any server within a group has failed and report health information.

    Usage:
      mysqlfabric  group health <group_id> [--timeout=TIMEOUT]                  
    
    Parameters:
      <group_id>  Timeout value after which a server is considered unreachable. If
                  None is provided, it assumes the default value in the         
                  configuration file.                                           
    
    Options:
      --timeout=TIMEOUT  By default None.                                       
    
  • Command: lookup_groups: Return information on existing group(s).

    Usage:
      mysqlfabric  group lookup_groups [--group_id=GROUP_ID]                    
    
    Options:
      --group_id=GROUP_ID  None if one wants to list the existing groups or     
                           group's id if one wants information on a group. By   
                           default None.                                        
    
    Return:
      List with {"group_id" : group_id, "failure_detector": ON/OFF, "description"
      : description}.
    
  • Command: lookup_servers: Return information on existing server(s) in a group.

    Usage:
      mysqlfabric  group lookup_servers <group_id> [--server_id=SERVER_ID]      
                   [--status=STATUS] [--mode=MODE]                              
    
    Parameters:
      <group_id>  Group's id.                                                   
    
    Options:
      --server_id=SERVER_ID                                                     
                       None if one wants to list the existing servers in a group
                       or server's id if one wants information on a server in a 
                       group. Accepted values: Servers's UUID or HOST:PORT. By  
                       default None.                                            
      --status=STATUS  Server's status one is searching for. By default None.   
      --mode=MODE      Server's mode one is searching for. By default None.     
    
    Return:
      Information on servers. List with [uuid, address, status, mode, weight]
    
  • Command: promote: Promote a server into master.

    If users just want to update the state store and skip provisioning steps such as configuring replication, the update_only parameter must be set to true. Otherwise, the following happens.

    If the master within a group fails, a new master is either automatically or manually selected among the slaves in the group. The process of selecting and setting up a new master after detecting that the current master failed is known as failover.

    It is also possible to switch to a new master when the current one is still alive and kicking. The process is known as switchover and may be used, for example, when one wants to take the current master off-line for maintenance.

    If a slave is not provided, the best candidate to become the new master is found. Any candidate must have the binary log enabled, should have logged the updates executed through the SQL Thread and both candidate and master must belong to the same group. The smaller the lag between slave and the master the better. So the candidate which satisfies the requirements and has the smaller lag is chosen to become the new master.

    In the failover operation, after choosing a candidate, one makes the slaves point to the new master and updates the state store setting the new master.

    In the switchover operation, after choosing a candidate, any write access to the current master is disabled and the slaves are synchronized with it. Failures during the synchronization that do not involve the candidate slave are ignored. Then slaves are stopped and configured to point to the new master and the state store is updated setting the new master.

    Usage:
      mysqlfabric  group promote <group_id> [--slave_id=SLAVE_ID] [--update_only]
                   [--synchronous]                                              
    
    Parameters:
      <group_id>                                                                
    
    Options:
      --slave_id=SLAVE_ID  Candidate's UUID or HOST:PORT. By default None.      
      --update_only=UPDATE_ONLY                                                 
                           Only update the state store and skip provisioning. By
                           default False.                                       
      --synchronous=SYNCHRONOUS                                                 
                           Whether one should wait until the execution finishes or
                           not. By default True.                                
    
  • Command: remove: Remove a server from a group.

    Usage:
      mysqlfabric  group remove <group_id> <server_id> [--synchronous]          
    
    Parameters:
      <group_id>   Group's id.                                                  
      <server_id>  Servers's UUID or HOST:PORT.                                 
    
    Options:
      --synchronous=SYNCHRONOUS                                                 
                Whether one should wait until the execution finishes or not. By 
                default True.                                                   
    
    Return:
      Tuple with job's uuid and status.
    

User Comments
Sign Up Login You must be logged in to post a comment.