Quick Start
Simulate Time Series Scenarios
Standard Cluster Deployment
Data Modeling
Connecting to The database
Data Writing
Data Migration
Data Query
Scene Application Examples
Federal Query
Maintenance and Monitoring
Global Maintenance
Partition Maintenance
Backup and Restore
Cluster Expansion
Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool Guide
Data Type
Storage Engine
Execution Engine
Configuration Parameters
SQL Reference
FAQ
This document describes the basic usage of MatrixGate, including the following topics:
First, specify the target database and tables to generate the mxgate configuration file. This example uses a three-node cluster, with the master node (Master) named mdw, and segment nodes named sdw1 and sdw2.
[mxadmin@mdw ~]$ mxgate config --db-database demo --target public.testtable --target public.testtable2 --allow-dynamic > mxgate.conf
The above command generates a configuration file named mxgate.conf. You can customize data loading settings for testtable and testtable2, or use global default settings to load data into other tables.
Modify the mxgate configuration file as needed, for example, to set data delimiters. Skip this step if using default settings. The configuration for testtable and testtable2 appears as follows:
[[job.target]]
# delimiter = "|"
# exclude-columns = []
# format = "text"
name = "job_text_to_public.testtable"
# null-as = ""
table = "public.testtable"
# time-format = "unix-second"
# use-auto-increment = true
[[job.target]]
# delimiter = "|"
# exclude-columns = []
# format = "text"
name = "job_text_to_public.testtable2"
# null-as = ""
table = "public.testtable2"
# time-format = "unix-second"
# use-auto-increment = true
If the delimiter for testtable is @ and for testtable2 is %, update the configuration as shown below:
[[job.target]]
delimiter = "@"
# exclude-columns = []
# format = "text"
name = "job_text_to_public.testtable"
# null-as = ""
table = "public.testtable"
# time-format = "unix-second"
# use-auto-increment = true
[[job.target]]
delimiter = "%"
# exclude-columns = []
# format = "text"
name = "job_text_to_public.testtable2"
# null-as = ""
table = "public.testtable2"
# time-format = "unix-second"
# use-auto-increment = true
By default, mxgate listens on port 8086 for incoming data. In mxgate.conf, you can find the http-port setting under source.http set to 8086. Change it to another port if necessary:
[source]
## Source plugin is the data entrance to MatrixGate
## Types restricted to: http
source = "http"
[source.http]
## Port of http push
# http-port = 8086
## Maximum request body size (after gzip)
## The server rejects requests with bodies exceeding this limit.
# max-body-bytes = 4194304
## The maximum number of concurrent HTTP connections to the server
## The server response with 503 after exceed this limit.
# max-concurrency = 40000
Start mxgate with the configuration file, connect to the demo database, and prepare to receive data loading requests.
[mxadmin@mdw ~]$ mxgate start --config mxgate.conf
[mxadmin@mdw ~]$ mxgate status
[mxadmin@mdw ~]$ mxgate stop
To force stop in case of timeout or other issues, run:
[mxadmin@mdw ~]$ mxgate stop --force
Note!
For complete command-line options of MatrixGate, see MatrixGate Command-Line Parameters; for main features, see MatrixGate Main Features.