Last active
August 10, 2021 08:23
-
-
Save robrich/3b5ee06a1bc179f3c5cfce0055def5d4 to your computer and use it in GitHub Desktop.
MemSQL load-balanced failover queries.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- MemSQL load-balanced failover | |
-- ============================= | |
-- Queries demoing load-balanced failover in MemSQL: https://youtu.be/J86fLCMr5dc | |
create database x_db partitions 8; | |
select host, port, node_id, availability_group as AG from leaves order by AG; | |
SELECT master_host as m_host, master_port as m_port, host as repl_host, port as repl_port, GROUP_CONCAT(database_name ORDER BY database_name) AS list_partitions FROM information_schema.mv_cluster_status WHERE metadata_role='slave' GROUP BY master_host, master_port, repl_host, repl_port ORDER BY master_host, master_port, repl_host, repl_port; | |
set global leaf_failover_fanout='load_balanced'; | |
rebalance partitions on x_db; | |
SELECT master_host as m_host, master_port as m_port, host as repl_host, port as repl_port, GROUP_CONCAT(database_name ORDER BY database_name) AS list_partitions FROM information_schema.mv_cluster_status WHERE metadata_role='slave' GROUP BY master_host, master_port, repl_host, repl_port ORDER BY master_host, master_port, repl_host, repl_port; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment