Configuration Parameters
OmniSci has minimal configuration requirements with a number of additional configuration options. This topic describes the required and optional configuration changes you can use in your OmniSci instance.
Data Directory
Before starting the OmniSci server, you must initialize the persistent data
directory. To do so, create an empty directory at the desired path, such as /var/lib/mapd
. Create the environment variable $MAPD_STORAGE
.
export MAPD_STORAGE=/var/lib/mapd
Change the owner of the directory to the user that the server will run as
($MAPD_USER
):
sudo mkdir -p $MAPD_STORAGE
sudo chown -R $MAPD_USER $MAPD_STORAGE
Where $MAPD_USER
is the system user account that the server runs
as, such as mapd
, and $MAPD_STORAGE
is the path to the parent of the OmniSci server data
directory.
Finally, run $MAPD_PATH/bin/initdb
with the data directory path as the argument:
$MAPD_PATH/bin/initdb $MAPD_STORAGE
Configuration File
OmniSci supports storing options in a configuration file. This is useful if, for example, you need to run the OmniSci server and web server on ports different than the defaults.
If you store a copy of mapd.conf
in the $MAPD_STORAGE directory, the configuration settings are picked up automatically by the sudo systemctl start mapd_server
and sudo systemctl start mapd_web_server
commands.
Set the flags in the configuration file using the format <flag> = <value>
. Strings must be enclosed in quotes. The following is a sample configuration file. The entry for data
path is a string and must be in quotes. The last entry in the first section, for null-div-by-zero
, is the Boolean value true
and does not require quotes.
port = 9091
http-port = 9090
data = "/var/lib/mapd/data"
null-div-by-zero = true
[web]
port = 9092
frontend = "/opt/mapd/frontend"
servers-json = "/var/lib/mapd/servers.json"
enable-https = true
Configuration Flags for OmniSci Server
Advanced Configuration Flags for OmniSci Server
Configuration Flags for OmniSci Web Server
Using Configuration Flags on the Command Line
To use options provided in a configuration file, set the --config
flag to the path of the configuration file for mapd_server
and mapd_web_server
. For example:
$MAPD_PATH/bin/mapd_server --config $MAPD_STORAGE/mapd.conf
You can also specify configuration settings at the command line. OmniSci recommends that you use the systemctl
command to start and stop the servers, but you can use the mapd_server
and mapd_web_server
commands with configuration flags for testing and debugging.
Command Line Configuration Flags for OmniSci Server
Command Line Configuration Flags for OmniSci Web Server
Flag | Description | Default | Why Change It? |
---|---|---|---|
-b | backend-url string |
URL to http-port on mapd_server | http://localhost:9090 |
Change to avoid collisions with other services. |
--cert string |
Certificate file for HTTPS | cert.pem |
Change for testing and debugging. |
-c | --config string |
Path to OmniSci configuration file | Change for testing and debugging. | |
-d | --data string |
Path to OmniSci data directory | data |
Change for testing and debugging. |
--docs string |
Path to documentation directory | docs |
|
--enable-https |
Enable HTTPS support | Change to enable secure HTTP. | |
-f | --frontend string |
Path to frontend directory | frontend |
|
--key string |
Key file for HTTPS | key.pem |
Change for testing and debugging. |
-p | --port int |
Frontend server port | 9092 |
Change to avoid collisions with other services. |
-r | --read-only |
Enable read-only mode | Prevent inadvertent (or nefarious) changes to the data. | |
--servers-json string |
Path to servers.json | Change for testing and debugging. | |
--timeout duration |
Maximum request duration in #h#m#s format. For example 0h30m0s represents a duration of 30 minutes. |
1h0m0s |
The --timeout option controls the maximum duration of individual HTTP requests. This is used to manage resource exhaustion caused by improperly closed connections. One side effect is that it limits the execution time of queries made over the Thrift HTTP transport. This timeout duration must be increased if queries are expected to take longer than the default duration of one hour; for example, if you perform a COPY FROM on a large file when using mapdql with the HTTP transport. |
--tmpdir string |
Path for temporary file storage | /tmp |
The temporary directory is used as a staging location for file uploads. You might want to place this directory on the same file system as the OmniSci data directory. If not specified on the command line, mapd_web_server also respects the standard TMPDIR environment variable as well as a specific MAPD_TMPDIR environment variable, the latter of which takes precedence. If you use neither the command-line argument nor one of the environment variables, the default, /tmp/ is used. |
-v | --verbose |
Print all log messages to stdout | Change for testing and debugging. | |
--version |
Return version | ||
--db-query-list <path-to-query-list-file> |
Pre-load data to memory based on SQL queries stored in a list file. | n/a | Automatically run queries that load the most frequently used data to enhance performance. See Pre-loading Data. |