mirror of https://github.com/citusdata/citus.git
38 lines
888 B
Plaintext
38 lines
888 B
Plaintext
-- Tests functions related to cluster membership
|
|
-- add the nodes to the cluster
|
|
SELECT master_add_node('localhost', :worker_2_port);
|
|
master_add_node
|
|
-----------------------
|
|
(1,1,localhost,57638)
|
|
(1 row)
|
|
|
|
SELECT master_add_node('localhost', :worker_1_port);
|
|
master_add_node
|
|
-----------------------
|
|
(2,2,localhost,57637)
|
|
(1 row)
|
|
|
|
-- get the active nodes
|
|
SELECT master_get_active_worker_nodes();
|
|
master_get_active_worker_nodes
|
|
--------------------------------
|
|
(localhost,57638)
|
|
(localhost,57637)
|
|
(2 rows)
|
|
|
|
-- try to add the node again when it is activated
|
|
SELECT master_add_node('localhost', :worker_1_port);
|
|
master_add_node
|
|
-----------------------
|
|
(2,2,localhost,57637)
|
|
(1 row)
|
|
|
|
-- get the active nodes
|
|
SELECT master_get_active_worker_nodes();
|
|
master_get_active_worker_nodes
|
|
--------------------------------
|
|
(localhost,57638)
|
|
(localhost,57637)
|
|
(2 rows)
|
|
|