|
1 | 1 | = TypeDB Configuration
|
2 |
| -:page-aliases: {page-version}@manual::configure.adoc |
| 2 | +:keywords: typedb, config, CLI |
| 3 | +:pageTitle: Server configuration manual |
| 4 | +:summary: TypeDB Server configuration. |
3 | 5 |
|
4 |
| -[placeholder] |
5 |
| -Configure TypeDB servers. |
| 6 | +You can configure a TypeDB server via two means: a YAML config file or command line options. |
| 7 | +Command line options override values defined in the config file. |
| 8 | + |
| 9 | +For a full list of configurable properties run: |
| 10 | + |
| 11 | +[source,bash] |
| 12 | +---- |
| 13 | +typedb server --help |
| 14 | +---- |
| 15 | + |
| 16 | +This page lists & explains the available options. |
| 17 | + |
| 18 | +== General CLI arguments |
| 19 | + |
| 20 | +General, non-configuration arguments available on the CLI. |
| 21 | + |
| 22 | +[cols=".^3,^.^1,5"] |
| 23 | +|=== |
| 24 | +3+^| General CLI arguments |
| 25 | + |
| 26 | +| `--config <path-to-file>` |
| 27 | +| |
| 28 | +| Specify a custom configuration file |
| 29 | + |
| 30 | +| `--help` |
| 31 | +| `-h` |
| 32 | +| Show help message. |
| 33 | + |
| 34 | +| `--version` |
| 35 | +| `-V` |
| 36 | +| Print version information and exit. |
| 37 | + |
| 38 | +|=== |
| 39 | + |
| 40 | +== Configuration file |
| 41 | +By default, TypeDB looks for a `config.yml` file in the same folder as the TypeDB server executable (i.e., `/server/config.yml`). |
| 42 | +This path can be overridden using the CLI argument: `--config <path-to-your-config>`. |
| 43 | + |
| 44 | +== Command line overrides |
| 45 | + |
| 46 | +When using the command line to override a specific option, all CLI arguments must: |
| 47 | + |
| 48 | +* start with the double dash prefix `--`, |
| 49 | +* be separated from their value (if any) either by an equals sign (`--arg=val`) or a whitespace (`--arg val`). |
| 50 | + |
| 51 | +e.g., `--server.address=0.0.0.0:1730` |
| 52 | + |
| 53 | + |
| 54 | +[#_overview] |
| 55 | +== Configuration options |
| 56 | + |
| 57 | +[#_server] |
| 58 | +=== Server |
| 59 | + |
| 60 | +The `server` section of the configuration contains network and encryption options. |
| 61 | +For example, a server can be booted up on `0.0.0.0:1730` by using this command: |
| 62 | + |
| 63 | +[source,bash] |
| 64 | +---- |
| 65 | +typedb server --server.address=0.0.0.0:1730 |
| 66 | +---- |
| 67 | +[cols=".^3,5"] |
| 68 | +|=== |
| 69 | +2+^| Server |
| 70 | +| `server.address` |
| 71 | +| Server host and port. Default value: `0.0.0.0:1729`. + |
| 72 | + |
| 73 | +| `server.http.enabled` |
| 74 | +| Enable/disable HTTP endpoint. Default value: `true`. + |
| 75 | + |
| 76 | +| `server.http.address` |
| 77 | +| HTTP endpoint host and port. Cannot be the same as `server.address`. Default value: `0.0.0.0:8000`. + |
| 78 | + |
| 79 | +| `server.authentication.token-expiration-seconds` |
| 80 | +| The amount of seconds generated authentication tokens will remain valid, specified in seconds. Default value: `14400` (4 hours). + |
| 81 | + |
| 82 | +|=== |
| 83 | + |
| 84 | +[#_encryption] |
| 85 | +==== Encryption |
| 86 | + |
| 87 | +Configure the TLS certificate & private-key to be used for inflight encryption. |
| 88 | + |
| 89 | +[cols=".^3,5"] |
| 90 | +|=== |
| 91 | +2+^| Server encryption |
| 92 | +| `server.encryption.enabled` |
| 93 | +| Enable in-flight encryption. Do not specify this argument to leave it disabled. + |
| 94 | + |
| 95 | +| `server.encryption.certificate` |
| 96 | +| Encryption certificate in PEM format. Must be supplied if encryption is enabled. + |
| 97 | + |
| 98 | +| `server.encryption.certificate-key` |
| 99 | +| Encryption certificate key. Must be supplied if encryption is enabled. + |
| 100 | + |
| 101 | +| `server.encryption.ca-certificate` |
| 102 | +| Encryption CA in PEM format. (Optional) + |
| 103 | + |
| 104 | +|=== |
| 105 | + |
| 106 | +[#_storage] |
| 107 | +=== Storage |
| 108 | + |
| 109 | +The `storage` section of the configuration contains the storage layer options. |
| 110 | + |
| 111 | +[IMPORTANT] |
| 112 | +==== |
| 113 | +For production use, it is recommended that the `storage.data-directory` is set to a path outside the `$TYPEDB_HOME` |
| 114 | +(directory with TypeDB server files). |
| 115 | +This helps to make the process of upgrading TypeDB easier. |
| 116 | +==== |
| 117 | + |
| 118 | +[cols=".^3,5"] |
| 119 | +|=== |
| 120 | +2+^| Storage |
| 121 | +| `storage.data-directory` |
| 122 | +| Path to the user data directory. Defaults to within the server distribution under `server/data`. + |
| 123 | +|=== |
| 124 | + |
| 125 | +[#_diagnostics] |
| 126 | +=== Diagnostics |
| 127 | + |
| 128 | +TypeDB optionally reports anonymous diagnostics to guide the development and optimisation of TypeDB. |
| 129 | +This data includes unexpected errors and occasional system status updates for number and size of databases, as well as numbers of transactions and queries executed per hour. |
| 130 | + |
| 131 | +To see what information is being reported, enable and access the monitoring Web page of the server (e.g. `localhost:4104/diagnostics?format=json`). |
| 132 | + |
| 133 | +[cols=".^3,5"] |
| 134 | +|=== |
| 135 | +2+^| Diagnostics |
| 136 | +| `diagnostics.reporting.metrics` |
| 137 | +| Enable usage metrics reporting by setting a boolean flag. Default value: `true`. + |
| 138 | + |
| 139 | +| `diagnostics.reporting.errors` |
| 140 | +| Enable critical error reporting by setting a boolean flag. Default value: `true`. + |
| 141 | + |
| 142 | +| `diagnostics.monitoring.enable` |
| 143 | +| Enable a diagnostics monitoring HTTP endpoint by setting a boolean flag. Default value: `true`. + |
| 144 | + |
| 145 | +| `diagnostics.monitoring.port` |
| 146 | +| Port on which to expose the diagnostics monitoring endpoint. Default value: `4104`. + |
| 147 | + |
| 148 | +|=== |
| 149 | + |
| 150 | +[#_log] |
| 151 | +=== Logging |
| 152 | + |
| 153 | +You can configure the directory that TypeDB uses for server logs. |
| 154 | +[cols=".^3,5"] |
| 155 | +|=== |
| 156 | +2+^| Logging |
| 157 | +| `logging.directory` |
| 158 | +| Path to the server logs directory. Defaults to within the server distribution under `server/logs`. + |
| 159 | +|=== |
| 160 | + |
| 161 | +[#_machine_requirements] |
| 162 | +== Host machine configuration |
| 163 | +This section describes recommended changes to the host OS. |
| 164 | + |
| 165 | +=== Open file limit |
| 166 | + |
| 167 | +To support large data volumes, it is important to check the open file limit the operating system imposes. |
| 168 | +Some Unix distributions default to `1024` open file descriptors. |
| 169 | +This can be checked with the following command: |
| 170 | + |
| 171 | +[source,bash] |
| 172 | +---- |
| 173 | +ulimit -n |
| 174 | +---- |
| 175 | + |
| 176 | +We recommend this is increased to at least `50 000`. |
0 commit comments