Installation Config
HarperDB is configured through a settings file located at HDB_HOME/config/settings.js
. Any modifications to this file will not take effect until HarperDB is restarted.
settings.js Values
Keyword | Example Value | Description |
PROJECT_DIR | /usr/local/lib/node_modules/harperdb | The directory harperdb has been installed in. |
HDB_ROOT | /Users/user_name/hdb | The directory selected during install where the database files reside. |
HTTP_PORT | 9925 | The port the HarperDB REST interface will listen on. |
HTTPS_PORT | 31283 | If HTTPS is enabled, the port the HarperDB REST interface will listen on. |
CERTIFICATE | /Users/user_name/hdb/keys/certificate.pem | The path to the SSL certificate used when running with HTTPS enabled. |
PRIVATE_KEY | /Users/user_name/hdb/keys/privateKey.pem | The path to the SSL private key used when running with HTTPS enabled. |
HTTPS_ON | TRUE | Set to true to enable HTTPS on the HarperDB REST endpoint. Requires a valid certificate and key. |
HTTP_ON | TRUE | Set to true to have HarperDB run using standard HTTP. |
CORS_ON | TRUE | Set to true to enable Cross Origin Resource Sharing, which allows requests across a domain. |
CORS_WHITELIST | harperdb.io,postman.com,google.com | Allows for setting allowable domains with CORS. Comma separated list. |
SERVER_TIMEOUT_MS | 120000 | Length of time in milliseconds after which a request will timeout. Defaults to 120,000 ms (2 minutes). |
SERVER_KEEP_ALIVE_TIMEOUT | 5000 | The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response. Defaults to 5,000 ms (5 seconds). |
SERVER_HEADERS_TIMEOUT | 60000 | Limit the amount of time the parser will wait to receive the complete HTTP headers.. Defaults to 60,000 ms (1 minute). |
LOG_LEVEL | warn | Set to control amount of logging generated. Accepted levels are trace, debug, warn, error, fatal. |
LOGGER | 1 | Setting LOGGER to 1 uses the WINSTON logger. 2 Uses the more performant PINO logger. |
LOG_PATH | /Users/user_name/hdb/log/hdb_log.log | The path where log files will be written. If there is no file name included in the path, the log file will be created by default as 'hdb_log.log' |
LOG_DAILY_ROTATE | FALSE | Set to true to enable daily log file rotations - each log file name will be prepended with YYYY-MM-DD (for WINSTON logger only). |
LOG_MAX_DAILY_FILES | 7 | Set the number of daily log files to maintain when LOG_DAILY_ROTATE is enabled. If no integer value is set, no limit will be set for daily log files which may consume a large amount of storage depending on your log settings. |
NODE_ENV | production | The environment used by NodeJS. Setting to production will be the most performant, settings to development will generate more logging. |
ALLOW_SELF_SIGNED_SSL_CERTS | false | This allows self signed certificates to be used in clustering. This is a security risk as clustering will not validate the cert, so should only be used internally. The HDB install creates a self signed certificate, if you use that cert this must be set to true. |
MAX_HDB_PROCESSES | 8 | Set the max number of processes HarperDB will start. This can also be limited by number of cores and licenses. |
CLUSTERING | true | Set to true to enable clustering. Requires a valid enterprise license. |
CLUSTERING_PORT | 12345 | The port that will be used for HarperDB clustering. |
NODE_NAME | edge_node_5 | The name of this node in your HarperDB cluster topology. This must be a value unique from the rest of your cluster node names. |
CLUSTERING_USER | cluster_user | The user used to connect to other instances of HarperDB, this user must have a role of cluster_user. |
DISABLE_TRANSACTION_LOG | false | Defines if this instance does not record transactions. Note, if Clustering is enabled and Transaction Log is disabled your nodes will not catch up. |
OPERATION_TOKEN_TIMEOUT | 1d | Defines the length of time an operation token will be valid until it expires. Example values: https://github.com/vercel/ms |
REFRESH_TOKEN_TIMEOUT | 30d | Defines the length of time a refresh token will be valid until it expires. Example values: https://github.com/vercel/ms |