SHUTDOWN_SUBCLUSTER

仅限 Eon 模式

关闭子群集。此函数将同步关闭子群集,并在关闭完成后返回子群集已关闭消息。如果子群集已关闭,此函数将不返回错误。

如果有活动用户会话连接到子群集,则停止子群集不会发出警告。此行为与停止单个节点相同。在停止子群集之前,确认没有用户连接到它。

如果想在关闭子群集之前排空客户端连接,则可以使用 SHUTDOWN_WITH_DRAIN 优雅地关闭子群集。

这是元函数。您必须在顶级 SELECT 语句中调用元函数。

行为类型

易变

语法

SHUTDOWN_SUBCLUSTER('subcluster‑name')

参数

subcluster‑name
要关闭的子群集的名称。

特权

超级用户

示例

以下示例演示了如何关闭子群集 analytics

=> SELECT subcluster_name, node_name, node_state FROM nodes order by 1,2;
  subcluster_name   |      node_name       | node_state
--------------------+----------------------+------------
 analytics          | v_verticadb_node0004 | UP
 analytics          | v_verticadb_node0005 | UP
 analytics          | v_verticadb_node0006 | UP
 default_subcluster | v_verticadb_node0001 | UP
 default_subcluster | v_verticadb_node0002 | UP
 default_subcluster | v_verticadb_node0003 | UP
(6 rows)

=> SELECT SHUTDOWN_SUBCLUSTER('analytics');
WARNING 4539:  Received no response from v_verticadb_node0004 in stop subcluster
WARNING 4539:  Received no response from v_verticadb_node0005 in stop subcluster
WARNING 4539:  Received no response from v_verticadb_node0006 in stop subcluster
 SHUTDOWN_SUBCLUSTER
---------------------
 Subcluster shutdown
(1 row)

=> SELECT subcluster_name, node_name, node_state FROM nodes order by 1,2;
  subcluster_name   |      node_name       | node_state
--------------------+----------------------+------------
 analytics          | v_verticadb_node0004 | DOWN
 analytics          | v_verticadb_node0005 | DOWN
 analytics          | v_verticadb_node0006 | DOWN
 default_subcluster | v_verticadb_node0001 | UP
 default_subcluster | v_verticadb_node0002 | UP
 default_subcluster | v_verticadb_node0003 | UP
(6 rows)

另请参阅