- Introduction
- Quick Start
- Table Design
- Data Loading
- Data Export
- Using StarRocks
- Reference
- SQL Reference
- User Account Management
- Cluster Management
- ADMIN CANCEL REPAIR
- ADMIN CHECK TABLET
- ADMIN REPAIR
- ADMIN SET CONFIG
- ADMIN SET REPLICA STATUS
- ADMIN SHOW CONFIG
- ADMIN SHOW REPLICA DISTRIBUTION
- ADMIN SHOW REPLICA STATUS
- ALTER SYSTEM
- CANCEL DECOMMISSION
- CREATE FILE
- DROP FILE
- INSTALL PLUGIN
- SHOW BACKENDS
- SHOW BROKER
- SHOW FILE
- SHOW FRONTENDS
- SHOW FULL COLUMNS
- SHOW INDEX
- SHOW PLUGINS
- SHOW TABLE STATUS
- UNINSTALL PLUGIN
- DDL
- ALTER DATABASE
- ALTER TABLE
- ALTER VIEW
- BACKUP
- CANCEL BACKUP
- CANCEL RESTORE
- CREATE DATABASE
- CREATE INDEX
- CREATE MATERIALIZED VIEW
- CREATE REPOSITORY
- CREATE RESOURCE
- CREATE TABLE AS SELECT
- CREATE TABLE LIKE
- CREATE TABLE
- CREATE VIEW
- CREATE FUNCTION
- DROP DATABASE
- DROP INDEX
- DROP MATERIALIZED VIEW
- DROP REPOSITORY
- DROP RESOURCE
- DROP TABLE
- DROP VIEW
- DROP FUNCTION
- HLL
- RECOVER
- RESTORE
- SHOW RESOURCES
- SHOW FUNCTION
- TRUNCATE TABLE
- DML
- ALTER ROUTINE LOAD
- BROKER LOAD
- CANCEL LOAD
- DELETE
- EXPORT
- GROUP BY
- INSERT
- PAUSE ROUTINE LOAD
- RESUME ROUTINE LOAD
- ROUTINE LOAD
- SELECT
- SHOW ALTER
- SHOW BACKUP
- SHOW DATA
- SHOW DATABASES
- SHOW DELETE
- SHOW DYNAMIC PARTITION TABLES
- SHOW EXPORT
- SHOW LOAD
- SHOW PARTITIONS
- SHOW PROPERTY
- SHOW REPOSITORIES
- SHOW RESTORE
- SHOW ROUTINE LOAD
- SHOW ROUTINE LOAD TASK
- SHOW SNAPSHOT
- SHOW TABLES
- SHOW TABLET
- SHOW TRANSACTION
- SPARK LOAD
- STOP ROUTINE LOAD
- STREAM LOAD
- Data Type
- Auxiliary Commands
- Function Reference
- Date Functions
- Geographic Functions
- String Functions
- Aggregation Functions
- Bitmap Functions
- Array Functions
- cast function
- hash function
- Crytographic Functions
- Math Functions
- Utility Functions
- System variables
- Error code
- System limits
- SQL Reference
- Administration
- FAQ
- Deployment
- Data Migration
- SQL
- Others FAQs
- Benchmark
- Developers
- Contribute to StarRocks
- Code Style Guides
- Use the debuginfo file for debugging
- Development Environment
- Trace Tools
- Integration
ALTER SYSTEM
description
This statement is used to operate nodes in a system. (Administrator only!)
Syntax:
Add nodes (Please add in this way if multi-tenant functionality is not used).
ALTER SYSTEM ADD BACKEND "host:heartbeat_port"[,"host:heartbeat_port"...];
Add idle nodes (Namely, add BACKEND that does not belong to any cluster).
ALTER SYSTEM ADD FREE BACKEND "host:heartbeat_port"[,"host:heartbeat_port"...];
Add nodes to a cluster.
ALTER SYSTEM ADD BACKEND TO cluster_name "host:heartbeat_port"[,"host:heartbeat_port"...];
Delete nodes.
ALTER SYSTEM DROP BACKEND "host:heartbeat_port"[,"host:heartbeat_port"...];
Take nodes offline.
ALTER SYSTEM DECOMMISSION BACKEND "host:heartbeat_port"[,"host:heartbeat_port"...];
Add Broker.
ALTER SYSTEM ADD BROKER broker_name "host:port"[,"host:port"...];
Reduce Broker.
ALTER SYSTEM DROP BROKER broker_name "host:port"[,"host:port"...];
Delete all Brokers.
ALTER SYSTEM DROP ALL BROKER broker_name
Set up a Load error hub for collecting and displaying import errors.
ALTER SYSTEM SET LOAD ERRORS HUB PROPERTIES ("key" = "value"[, ...]);
Note:
host could be a host name and an ip address.
heartbeat_port is the heartbeat port of the node.
Adding and deleting nodes are synchronous operations. Without considering the existing data on nodes, these two operations delete nodes from the metadata directly. Please operate with caution.
Nodes decommission means safely removing the nodes. This operation is asynchronous. If successful, the nodes will be deleted from metadata. If not, they will not be taken offline.
Nodes decommission process can be cancelled manually. For more details, please refer to CANCEL DECOMMISSION.
Load error hub:
Currently, only two types of Hub are supported: Mysql and Broker. Please specify "type" = "mysql" or "type" = "broker" in PROPERTIES. To delete the current load error hub, please set the type as null.
When using the Mysql type, import errors will be inserted into specified Mysql database table and can be viewed directly through show load warnings statement.
Hub of Mysql type needs to specify the following parameters:
host:mysql host port:mysql port user:mysql user password:mysql password database:mysql database table:mysql table
When using the Broker type, import errors will be generated into a file and be written into a designated remote storage system through Broker. Please make sure that corresponding broker is already deployed in the remote system.
Hub of Broker type needs to specify the following parameters:
broker: Name of broker path: Remote storage path other properties: Other information required for accessing remote storage, e.g. Authentication information, etc.
example
Add a node.
ALTER SYSTEM ADD BACKEND "host:port";
Add an idle node.
ALTER SYSTEM ADD FREE BACKEND "host:port";
Delete two nodes.
ALTER SYSTEM DROP BACKEND "host1:port", "host2:port";
Take two nodes offline.
ALTER SYSTEM DECOMMISSION BACKEND "host1:port", "host2:port";
Add two Hdfs Broker.
ALTER SYSTEM ADD BROKER hdfs "host1:port", "host2:port";
Add a load error hub with Mysql type.
ALTER SYSTEM SET LOAD ERRORS HUB PROPERTIES ("type"= "mysql", "host" = "192.168.1.17" "port" = "3306", "user" = "my_name", "password" = "my_passwd", "database" = "starrocks_load", "table" = "load_errors" );
Add a load error hub with Broker type.
ALTER SYSTEM SET LOAD ERRORS HUB PROPERTIES ("type"= "broker", "name" = "bos", "path" = "bos://backup-cmy/logs", "bos_endpoint" = "http://gz.bcebos.com", "bos_accesskey" = "069fc278xxxxxx24ddb522", "bos_secret_accesskey"="700adb0c6xxxxxx74d59eaa980a" );
Delete the current load error hub.
ALTER SYSTEM SET LOAD ERRORS HUB PROPERTIES ("type"= "null");
keyword
ALTER,SYSTEM,BACKEND,BROKER,FREE