This document describes TuGraph's service configuration parameters, configuration file formats, and command line configuration parameters
The TuGraph server loads configurations from the configuration file and command line options at startup, and if different values are specified for the same option in the configuration file and command line, the value specified in the command line will be used preferentially.
Configuration parameters
The parameters and their types are described as follows:
| Parameter names | Instructions | |
|---|---|---|
| license | string | Path of the authorization file. The default value is /var/lib/lgraph/fma.lic. |
| directory | string | Directory where data files are stored. If the directory does not exist, it is automatically created. The default directory is /var/lib/lgraph/data. |
| async | boolean | Whether to use asynchronous mode. Asynchronous mode can reduce disk I/O overhead, but data can be lost in extreme cases such as machine power outages. The default value is false. |
| host | string | The IP address on which the REST server listens. The default address is 0.0.0.0. |
| port | int | The Port on which the REST server listens. The default port is 7070. |
| enable_rpc | boolean | Whether to use RPC services. The default value is 0. |
| rpc_port | int | Port used by RPC and HA services. The default port number is 9090. |
| enable_ha | boolean | Whether to enable the HA mode. The default value is false. |
| ha_log_dir | string | HA log directory. The HA mode needs to be enabled. The default value is null. |
| master | string | Initialize a node based on host1:port1 and host2:port2. The default value is null. |
| verbose | int | Detail level of log output information. The value can be 0,1,2. The larger the value, the more detailed the output information. The default value is 1. |
| log_dir | string | Directory where log files are stored. The default directory is /var/log/lgraph/. |
| ssl_auth | boolean | Whether to use SSL authentication. When HTTPS is enabled, only the HTTPS service is enabled on the REST server. The default value is false. |
| web | string | The directory where the web files (including the visual part) are located. The default directory is/usr/local/share/lgraph/resource. |
| server_cert | string | certificate file path used by the server when SSL authentication is enabled. The default path is/usr/local/etc/lgraph/server - cert.pem. |
| server_key | string | The public key file used by the server when SSL authentication is enabled. The default directory is/usr/local/etc/lgraph/server - key.pem。 |
| enable_audit_log | boolean | Whether to enable audit logs. The default value is false. |
| audit_log_expire | int | When audit logs are enabled, the validity period (hours) of audit logs is automatically cleared upon timeout. If the value is 0, the logs are not cleared. The default value is 0. |
| audit_log_dir | string | Specifies the directory for storing log files when audit logs are enabled. The default directory is $directory/audit_log. |
| load_plugins | boolean | Import all stored procedures when starting the service. The default value is 1. |
| optimistic_txn | boolean | Enable optimistic multithreaded write transactions for Cypher. The default is 0. |
| disable_auth | boolean | Disable REST authentication. The default is 0. |
| snapshot_interval | int | Snapshot interval (in seconds) The default value is 86400. |
| heartbeat_interval_ms | int | Heartbeat interval in milliseconds. The default value is 1000. |
| heartbeat_failure_duration_ms | int | The heartbeat times out and the interval (in milliseconds) between nodes going offline. The default value is 60000. |
| node_dead_duration_ms | int | The interval (in milliseconds) at which a node is considered completely dead and removed from the list. The default value is 120000. |
| enable_ip_check | boolean | Allow IP address whitelists. The default value is 0。 |
| idle_seconds | int | The maximum number of seconds a child process can be idle. The default value is 600. |
| enable_backup_log | boolean | Whether to enable backup logging. The default value is 0. |
| backup_log_dir | string | The directory where backup files are stored. The default value is null. |
| snapshot_dir | string | Directory where snapshot files are stored. The default value is null. |
| thread_limit | int | The maximum number of threads that can be used simultaneously. The default value is 0, which means that no restriction is imposed. The license file prevails. |
| help | boolean | Print the help message. The default value is 0. |
Server configuration file
TuGraph's configuration file is stored in JSON format. It is recommended that most configuration be stored in configuration files and that some configuration parameters be modified only temporarily using command-line options when needed.
A typical configuration file looks like this:
{
"directory": "/var/lib/lgraph/data",
"license": "/var/lib/lgraph/fma.lic",
"port": 7090,
"rpc_port": 9090,
"enable_ha": false,
"verbose": 1,
"log_dir": "/var/log/lgraph/",
"ssl_auth": false,
"server_key": "/usr/local/etc/lgraph/server-key.pem",
"server_cert": "/usr/local/etc/lgraph/server-cert.pem"
}