close
ApplicationsDatabaseLinux/Unix

Using Cluster Control To Deploy MySQL Cluster Master-Master With HAProxy

 ClusterControl is an agentless management and automation software for database clusters. It helps deploy, monitor, manage and scale your database server/cluster directly.”

I/Overview: “ClusterControl is an agentless management and automation software for database clusters. It helps deploy, monitor, manage and scale your database server/cluster directly from ClusterControl user interface.”

ClusterControl consists of a number of components:

Component Package naming Role
ClusterControl Controller (cmon) clustercontrol-controller The brain of ClusterControl. A backend service performing automation, management, monitoring and scheduling tasks. All the collected data will be stored directly inside CMON database.
ClusterControl UI clustercontrol A modern web user interface to visualize and manage the cluster. It interacts with CMON controller via remote procedure call (RPC) or REST API interface.
ClusterControl SSH clustercontrol-ssh Optional package introduced in ClusterControl 1.4.2 for ClusterControl’s web SSH console. Only works with Apache 2.4+.
ClusterControl Notifications clustercontrol-notifications Optional package introduced in ClusterControl 1.4.2 providing a service and user interface for notification services and integration with third party tools.
ClusterControl Cloud clustercontrol-cloud Optional package introduced in ClusterControl 1.5.0 providing a service and user interface for integration with cloud providers.
ClusterControl Cloud File Manager clustercontrol-clud Optional package introduced in ClusterControl 1.5.0 providing a command-line interface to interact with storage objects on cloud.
ClusterControl CLI s9s-tools Open-source command line tool to manage and monitor clusters provisioned by ClusterControl.

*Supported Database Server/Cluster: Galera Cluster +Percona XtraDB Cluster (Percona) +MariaDB Galera Cluster (MariaDB) MySQL Cluster (NDB) MySQL/MariaDB +Standalone +Replication (master-master and master-slave) MongoDB/Percona Server for MongoDB +Replica set +Sharded cluster +Replicated sharded cluster PostgreSQL/TimescaleDB +Standalone +Streaming replication (asynchronous and synchronous II/Install Cluster Control Using Ansible: – Automatic installation cluster control using Ansible Role download at:https://github.com/severalnines/ansible-clustercontrol.git 1/Configure inventory and SSH passwordless using key:

– Test new host in  inventory by using module ping

2/Create role list using for installing role by command ansible-galaxy:

– Installing new role:

– List all role installed in control node:

– Add variable mysql_port with value 3306 in file main.yml of installed role clustercontrol

3/Writing playbook to install cluster control: – Define variable file store information using for authentication of mysql running on cluster control:

– Writing playbook using role clustercontrol to install Cluster Control on managed node:

– Browsing to cluster control admin url: http://IP Cluster Control/clustercontrol/users/welcome/ – Create admin account for first login

*Stop/Start Cluster Control Service: – Stop services:

– Start services:

III/Deploy MySQL Cluster Master-Master Replication On Cluster Control GUI: – Configure SSH Using key authentication on Cluster Control To 2 MySQL nodes

– On dashboard-> Menu Deploy

– Choose Deploy -> MySQL Replication-> Input account information for SSH  user to execute command on MySQL nodes

– Choose MySQL version deployed and environment information (port and data dir, MySQL root password)

– Enter 2 master node information to deployed and add to cluster

– Click Deploy to process creating new Master-Master MySQL cluster automatically – Choose menu Activity-> Job for monitoring process deployment

– After process of deploy cluster finish, monitoring/controlling cluster/node status in menu If has error Cluster Control UI cannot retrieve cluster information to display do some below step to fix: – Query rpc_token value stored on cluster control database:

– Verify and edit (if different) rpc key and rpc_token key on file /etc/cmon.cnf and

– Restart cmon service and httpd service if edit rpc key in these fiels – Now can monitor and control cluster MySQL created in UI

– Support monitor Top queries and running queries

*Deploy ha-proxy as load balancer for MySQL cluster: – Configure SSH using key authentication on cluster control node to ha-proxy node

– Choose menu Add Load Balancer on cluster created

– Monitor new job for deploying ha proxy status

– Monitor haproxy backend and frontend status

– Connect to mysql cluster by using ha-proxy node

Tags : applications
Tech2FunAdmin

The author Tech2FunAdmin

Leave a Response

error: Content is protected !!