proxysql_tools.galera package¶
Submodules¶
proxysql_tools.galera.galera_cluster module¶
Module describes GaleraCluster class
-
class
proxysql_tools.galera.galera_cluster.GaleraCluster(cluster_hosts, user='root', password=None)[source]¶ Bases:
objectGaleraCluster describes Galera cluster.
Parameters: - cluster_hosts (str) –
.
- user (str) – MySQL user to connect to a cluster node.
- password (str) – MySQL password.
-
find_node(host, port)[source]¶ BY given host and port find a node in the cluster.
Parameters: - host – IP or address of node.
- port – node port.
Returns: GaleraNode instance.
Return type: Raise: GaleraClusterNodeNotFound
-
find_synced_nodes()[source]¶ Find a node in the cluster in SYNCED state. :return: List of Galera node in SYNCED state. :rtype: list(GaleraNode) :raise: GaleraClusterSyncedNodeNotFound
-
nodes¶ Get list of Galera nodes
Returns: Return list of Galera nodes Return type: list(GaleraNode)
- cluster_hosts (str) –
proxysql_tools.galera.galera_node module¶
Module describes GaleraNode class
-
class
proxysql_tools.galera.galera_node.GaleraNode(host, port=3306, user='root', password=None)[source]¶ Bases:
objectGaleraNode class describes a single node in Galera Cluster.
Parameters: - host – hostname of the node.
- port – port to connect to.
- user – MySQL username to connect to the node.
- password – MySQL password.
-
execute(query, *args)[source]¶ Execute query in Galera Node.
Parameters: query (str) – Query to execute. Returns: Query result or None if the query is not supposed to return result. Return type: dict
-
wsrep_cluster_name¶ The logical cluster name for the node.
-
wsrep_cluster_state_uuid¶ Provides the current State UUID. This is a unique identifier for the current state of the cluster and the sequence of changes it undergoes.
-
wsrep_cluster_status¶ Status of this cluster component. That is, whether the node is part of a
PRIMARYorNON_PRIMARYcomponent.
-
wsrep_local_state¶ Internal Galera Cluster FSM state number.