MysqlConfig¶
-
class
playback.mysql_config.
MysqlConfig
(user='ubuntu', hosts=None, key_filename=None, password=None, parallel=True, *args, **kwargs)¶ Bases:
playback.common.Common
Config Galera Cluster for MySQL
Parameters: - user(str) – the user for remote server to login
- hosts(list) – this is a second param
- key_filename(str) – the ssh private key to used, default None
- password(str) – the password for remote server
- parallel(bool) – paralleler execute on remote server, default True
Returns: None
Examples: # create a mysql instance mysql_controller1 = MysqlConfig( user='ubuntu', hosts=['controller1'] ) # setup cluster on controller1 mysql_controller1.update_mysql_config( wsrep_cluster_address = 'gcomm://controller1,controller2' wsrep_node_name = 'galera1' wsrep_node_address = '192.168.1.2' ) # setup cluster on controller2 mysql_controller2.update_mysql_config( wsrep_cluster_address = 'gcomm://controller1,controller2' wsrep_node_name = 'galera2' wsrep_node_address = '192.168.1.3' )
-
update_mysql_config
(*args, **kwargs)¶ If trusty setup Galera Cluster for MySQL. If xenial setup MariaDB Galera Cluster
Parameters: - wsrep_cluster_address – the IP addresses for each cluster node e.g. gcomm://CONTROLLER1_IP,CONTROLLER2_IP
- wsrep_node_name – the logical name of the cluster node e.g. galera1
- wsrep_node_address – the IP address of the cluster node e.g. CONTROLLER1_IP
Returns: None