Background #
Apache ShardingSphere provides a wealth of system configuration properties, which users can configure through server.yaml
.
Parameters #
Name | Data Type | Description | Default Value | Dynamic effect |
---|---|---|---|---|
sql_federation_type | String | Federal query actuator types, including: NONE, ORIGINAL, ADVANCED. | NONE | Yes |
agent_plugins_enabled | boolean | Whether to enable agent plugin | TRUE | No |
transaction_type | String | Transaction Type (LOCAL/XA/BASE/MANUALXA) | LOCAL | No |
kernel_executor_size | int | Used to set the size of the task processing thread pool. Each ShardingSphereDataSource uses a separate thread pool and different data sources of the same JVM do not share thread pools. | infinite | No |
max_connections_size_per_query | int | The maximum number of connections that can be used in each database instance for a single query request. | 1 | Yes |
check_table_metadata_enabled | boolean | Whether the structural consistency of the slice metadata is checked at program start and update. | false | Yes |
proxy_frontend_flush_threshold | int | Set the IO refresh threshold for the number of data entries transferred in the ShardingSphere-Proxy. | 128 | Yes |
proxy_hint_enabled | boolean | Whether to allow the use of Hint in ShardingSphere-Proxy, which changes the thread processing model of Proxy from IO multiplexing to a separate thread for each request, reducing the throughput of Proxy. | false | Yes |
proxy_backend_query_fetch_size | int | The number of rows of data fetched per Proxy backend interaction with the database (in the case of using cursors). Increasing the value may increase the memory usage of ShardingSphere Proxy. The default value is -1, which represents a setting to the minimum value for the JDBC driver. | -1 | Yes |
proxy_frontend_executor_size | int | Number of Netty thread pool threads on Proxy front end, default value 0 means that the Netty default is used. | 0 | No |
proxy_backend_executor_suitable | String | Optional options: OLAP, OLTP. the OLTP option may reduce the time overhead of writing packets to clients, but it may increase the delay in SQL execution or even block connections from other clients if the number of client connections exceeds proxy-frontend-executor-size, especially when executing slow SQL. | OLAP | Yes |
proxy_frontend_max_connections | int | The maximum number of clients allowed to connect to Proxy, the default value of 0 means no limit. | 0 | Yes |
proxy_mysql_default_version | String | Proxy specifies the version of MySQL via a configuration file, default version: 5.7.22. Only MySQL needs to be configured so that the client recognises the protocol version of the database. | 5.7.22 | No |
proxy_default_port | String | Proxy specifies the default port via a configuration file. | 3307 | No |
proxy_netty_backlog | int | Proxy specifies the default netty back_log parameter via the configuration file. | 1024 | No |
proxy_frontend_database_protocol_type | String | Proxy front-end protocol type, supports MySQL, PostgreSQL, openGauss | "" | No |
proxy_instance_type | String | Proxy instance type, options: Proxy, SphereEx:Proxy, Proxy for on-cloud deployment type, SphereEx:Proxy for local deployment type | Proxy | No |
system_log_level | String | System logging level, not built-in logger use this configuration, system logging level, support DEBUG, INFO, WARN, ERROR | INFO | Yes |
system_log_pattern | String | System log format, common across the board, log format can be found inLogback Layouts | [%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %logger{36} - %msg%n | Yes |
sql_show | boolean | “Whether to print SQL in the system log. Printing SQL can help developers to quickly locate system problems. The logs contain: logical SQL, real SQL and SQL parsing results. If configured on, the logs will use Topic ShardingSphere-SQL and the syslog level is INFO.” | false | Yes |
sql_simple | boolean | Whether to print simple style SQL in the system log. | false | Yes |
slow_query_log | boolean | Whether to enable slow queries TRUE/FALSE | false | Yes |
long_query_time | int | Slow query threshold in ms | 10 | Yes |
general_query_log | boolean | Whether to enable full logging (audit log) TRUE/FALSE | false | Yes |
system_log_level | String | The system log level of the current computing node (proxy) DEBUG, INFO, WARN, ERROR | INFO | Yes |
system_log_pattern | String | System log format of the current compute node (proxy) | [%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %logger{36} - %msg%n | Yes |
storage_node_heartbeat_interval_milliseconds | int | Used to configure the storage node status collection interval, in milliseconds. If the configuration is equal to 0, the storage node status collection function is turned off | 0 | Yes |
meta_data_consistency_enabled | boolean | Used to control whether to enable proxy DDL and RDL consistency updates | false | Yes |
Properties can be modified online through DistSQL. Properties that support dynamic change can take effect immediately. For the ones that do not support dynamic change, the effect will be implemented after a restart.
Sample #
For a complete sample
#props:
# max-connections-size-per-query: 1
# kernel-executor-size: 16 # Infinite by default.
# proxy-frontend-flush-threshold: 128 # The default value is 128.
# proxy-hint-enabled: false
# sql-show: false
# check-table-metadata-enabled: false
# show-process-list-enabled: false
# # Proxy backend query fetch size. A larger value may increase the memory usage of ShardingSphere Proxy.
# # The default value is -1, which means set the minimum value for different JDBC drivers.
# proxy-backend-query-fetch-size: -1
# check-duplicate-table-enabled: false
# proxy-frontend-executor-size: 0 # Proxy frontend executor size. The default value is 0, which means let Netty decide.
# # Available options of proxy backend executor suitable: OLAP(default), OLTP. The OLTP option may reduce time cost of writing packets to client, but it may increase the latency of SQL execution
# # and block other clients if client connections are more than `proxy-frontend-executor-size`, especially executing slow SQL.
# proxy-backend-executor-suitable: OLAP
# proxy-frontend-max-connections: 0 # Less than or equal to 0 means no limitation.
# sql-federation-enabled: false
# # Available proxy backend driver type: JDBC (default), ExperimentalVertx
# proxy-backend-driver-type: JDBC
# proxy-mysql-default-version: 5.7.22 # In the absence of schema name, the default version will be used.
# proxy-default-port: 3307 # Proxy default port.
# proxy-netty-backlog: 1024 # Proxy netty backlog.