Spider Cluster Management
Covers advanced management topics like executing direct SQL on backends, copying tables between nodes, and monitoring the cluster using status variables.
Direct SQL
spider1 backend << EOF
CREATE TEMPORARY TABLE res
(
id INT(10) UNSIGNED NOT NULL,
k INT(10) UNSIGNED NOT NULL DEFAULT '0',
c CHAR(120) NOT NULL DEFAULT '',
pad CHAR(60) NOT NULL DEFAULT ''
) ENGINE=MEMORY;
SELECT spider_direct_sql(
'SELECT * FROM sbtest s WHERE s.id IN(10,12,13)',
'res',
concat('host "', host, '", port "', port, '", user "', username, '", password "', password, '", database "', tgt_db_name, '"')
) a
FROM
mysql.spider_tables
WHERE
db_name = 'backend' AND table_name LIKE 'sbtest#P#pt%';
SELECT * FROM res;
EOFDirect Handler Socket
Inter Nodes Copy Table
General Log
Compiling in Debug Mode
Compiling in Static
Status Variables
Information Schema Tables
Performance Schema
Last updated
Was this helpful?

