The DELETE CLUSTER
statement removes the specified cluster with its name. Once the cluster is deleted, it is removed from all nodes, but its tables remain intact and become active local non-replicated tables.
- SQL
- JSON
- PHP
- Python
- javascript
- Java
- C#
DELETE CLUSTER click_query
{u'error': u'', u'total': 0, u'warning': u''}
ALTER CLUSTER <cluster_name> ADD <table_name>[, <table_name>]
adds one or more existing local tables to the cluster. The node that receives the ALTER query sends the table(s) to the other nodes in the cluster. All the local tables with the same name on the other nodes of the cluster are replaced with the new table(s).
Once the tables are replicated, write statements can be performed on any node, but the table names must be prefixed with the cluster name, like INSERT INTO <clusterName>:<table_name>
.
- SQL
- JSON
- PHP
- Python
- javascript
- Java
- C#
ALTER CLUSTER click_query ADD clicks_daily_index
{u'error': u'', u'total': 0, u'warning': u''}
ALTER CLUSTER <cluster_name> DROP <table_name>[, <table_name>]
forgets about one or more existing table(s), meaning it does not remove the table(s) files on the nodes, but rather just makes them inactive, non-replicated table(s).
Once a table is removed from a cluster, it becomes a local
table, and write statements must use just the table name, like INSERT INTO <table_name>
, without the cluster prefix.
- SQL
- JSON
- PHP
- Python
- javascript
- Java
- C#
ALTER CLUSTER posts DROP weekly_index
{u'error': u'', u'total': 0, u'warning': u''}
The ALTER CLUSTER <cluster_name> UPDATE nodes
statement updates the node lists on each node within the specified cluster to include all active nodes in the cluster. For more information on node lists, see Joining a cluster.
- SQL
- JSON
- PHP
- Python
- javascript
- Java
- C#
ALTER CLUSTER posts UPDATE nodes
{u'error': u'', u'total': 0, u'warning': u''}
For instance, when the cluster was initially established, the list of nodes used to rejoin the cluster was 10.10.0.1:9312,10.10.1.1:9312
. Since then, other nodes joined the cluster and now the active nodes are 10.10.0.1:9312,10.10.1.1:9312,10.15.0.1:9312,10.15.0.3:9312
.However, the list of nodes used to rejoin the cluster has not been updated.
To rectify this, you can run the ALTER CLUSTER ... UPDATE nodes
statement to copy the list of active nodes to the list of nodes used to rejoin the cluster. After this, the list of nodes used to rejoin the cluster will include all the active nodes in the cluster.
Both lists of nodes can be viewed using the Cluster status statement (cluster_post_nodes_set
and cluster_post_nodes_view
).
To remove a node from the replication cluster, follow these steps:
- Stop the node
- Remove the information about the cluster from
<data_dir>/manticore.json
(usually/var/lib/manticore/manticore.json
) on the node that has been stopped. - Run
ALTER CLUSTER cluster_name UPDATE nodes
on any other node.
After these steps, the other nodes will forget about the detached node and the detached node will forget about the cluster. This action will not impact the tables in the cluster or on the detached node.