Glusterd Ops contains all the functions which are required for glusterd specific operations.
-
start_glusterd
Function to start glusterdArgs: nodes (list): Nodes on which glusterd is to be started. enable_retry (bool): Optional parameter with default value as True. If enabled, it'll bypass the burst limit of glusterd. Returns: dictionary of the following form 1. Flag: Flag to check if the connection failed. 2. msg: stdout message 3. error_msg: stderr message 4. error_code: error code returned 5. cmd: Command that got executed 6. node: node on which the command is run Example: self.start_glusterd(self.server_list[0]) -
restart_glusterd
Function to restart glusterd.Args: nodes (list): List of nodes no which glusterd is to be restarted. enable_retry (bool): Optional parameter with default value as True. If enabled, it'll bypass the burst limit of glusterd. Returns: dictionary of the following form 1. Flag: Flag to check if the connection failed. 2. msg: stdout message 3. error_msg: stderr message 4. error_code: error code returned 5. cmd: Command that got executed 6. node: node on which the command is run Example: self.restart_glusterd(self.server_list[0]) -
stop_glusterd
Function to stop glusterdArgs: node (list): The nodes on which glusterd has to be stopped. Returns: dictionary of the following form 1. Flag: Flag to check if the connection failed. 2. msg: stdout message 3. error_msg: stderr message 4. error_code: error code returned 5. cmd: Command that got executed 6. node: node on which the command is run Example: self.stop_glusterd(self.server_list[0]) -
reset_failed_glusterd
Function to reset the start burst limit for glusterd.Args: node (list): Nodes on which the burst limit is to be reset. Returns: dictionary of the following form 1. Flag: Flag to check if the connection failed. 2. msg: stdout message 3. error_msg: stderr message 4. error_code: error code returned 5. cmd: Command that got executed 6. node: node on which the command is run Example: self.reset_failed_glusterd(self.server_list[0]) -
is_glusterd_running
Function to check ig glusterd is running in the said servers.Args: node (list): Nodes on which the glusterd state has to be checked. Returns: 1: if glusterd is active on said servers 0: if glusterd is not active on said servers -1: if glusterd is not active but PID is alive in said servers. Example: self.is_glusterd_running(self.server_list) -
wait_for_glusterd_to_start
Function to wait for glusterd to start on said node.Args: 1. node (str): The node on which the state is to be checked. 2. timeout (int): Optional parameter with default value as 80. This is the max time till which the function will wait for glusterd to start on the said server. Returns: True is the state is started else False Example: self.wait_for_glusterd_to_start(self.server_list[0]) -
wait_for_glusterd_to_stop
Function to wait for glusterd to stop on said node.Args: 1. node (str): The node on which the state is to be checked. 2. timeout (int): Optional parameter with default value as 80. This is the max time till which the function will wait for glusterd to stop on the said server. Returns: True is the state is stopped else False Example: self.wait_for_glusterd_to_stop(self.server_list[0]) -
get_state
Function to run gluster get-state command on a said node.Args: 1. node (str): Node on which the command is to be run. Returns: The get-state output in dictionary format on success Example: self.get_state(self.server_list[0]) -
get_gluster_version
This function checks the glusterfs version on the node.Args: node (str): Node wherein the gluster version is checked. Returns: str: The gluster version value. Example: ver = redant.get_gluster_version(self.server_list[0]) -
get_glusterd_process_count
This function gets the gluster process count for a given node.Args: node (str): Node on which glusterd process has to be counted. Returns: int: Number of glusterd processes running on the node. None: If the command fails to execute. Example: pcnt = redant.get_glusterd_process_count(self.server_list[0]) -
get_all_gluster_process_coun
This function gets all gluster related process count for a given node.Args: node (str): Node on which gluster process has to be counted. Returns: int: Number of gluster processes running on the node. None: If the command fails to execute. Example: pcnt = redant.get_all_gluster_process_count(self.server_list[0])