MapD Core Services and Utilities

Assuming $MAPD_PATH is the directory where MapD Core is installed, make sure that $MAPD_PATH/bin is in PATH:

export PATH=$MAPD_PATH:$PATH

Services

You can use the commands mapd_server and mapd_web_server to test and debug your MapD Core instance. When you start your production server, MapD recommends that you use the systemctl command. See Starting and Stopping MapD Core Services.

mapd_server

mapd_server $MAPD_DATA [--cpu|--gpu]
                       [--config </path/to/mapd.conf>]
                       [--data]
                       [--db-convert]
                       [--rendering]
                       [--flush-log]
                       [--http-port <port number>]
                       [--ldap-uri <string>]
                       [--ldap-dn <string>
                       [--num-gpus <number>]
                       [{-p|--port} <port number>]
                       [--start-gpu <number>]
                       [--version|-v]
                       [--help|-h]

This command starts the MapD Core Server process. $MAPD_DATA must match that in the initdb command when it was run. The options are:

  • [--cpu|--gpu]: Execute queries on CPU only or on both GPU and CPU. The default is --gpu. If Xorg and NVIDIA CUDA are not installed, your MapD server automatically executes queries only on the CPU.
  • [--config]: Path to mapd.conf.
  • [--data]: Path to the MapD data directory.
  • [--db-convert]: Only required when converting existing databases from version 2.0.4 to 2.1.0. Path to the source directory.
  • [{-p|--port} <port number>]: Specify the port for MapD Core Server’s binary-over-TCP protocol. The default is port 9091.
  • [{--http-port} <port number>]: Specify the port for MapD Core Server’s JSON-over-HTTP protocol. The default is port 9090.
  • [--ldap-uri <string>]: LDAP URI for authentication; for example, ldap://ldap.mycompany.com
  • [--ldap-dn <string]: LDAP distinguished name (DN), defaults to uid=%s,cn=users,cn=accounts,dc=mapd,dc=com. Note: The single %s in this string is replaced by the username at authentication time.
  • [--flush-log]: Flush log files to disk. Useful for tail -F on log files.
  • [--rendering]: Enables server-based rendering. Defaults to TRUE.
  • [--num-gpus <number>]: Number of GPUs to use, defaults to number detected on hardware.
  • [--start-gpu <number>]: When not using all detected GPUs, start using GPUs at this number. Defaults to zero.
  • [--version|-v]: Print version number.
  • [--help|-h]: Print this help text.

mapd_web_server

mapd_web_server [{--port} <port number>]
                [{--proxy-backend} <bool>]
                [{--backend-url} <backend URL>]
                [{--frontend} <path/to/frontend>]
                [{--enable-https} <bool>]
                [{--cert} <cert.pem>]
                [{--key} <key.pem>]
                [{--tmpdir} </path/to/tmp>]
                [{--timeout} <1h0m0s>]

This command starts the MapD Core Web Server. This server provides access to the MapD Immerse visualization frontend and allows MapD Immerse to communicate with MapD Core Server. HTTPS certificates and keys can be generated via the provided generate_cert utility, or provided by your Certificate Authority. The options are:

  • [{--port} <port number>]: Specify the port the web server listens on. The default is port 9092.
  • [{--proxy-backend} <bool>]: Specify whether to act as a proxy to the backend. The default is true.
  • [{--backend-url} <backend URL>]: Specify the URL to the backend HTTP server. The default is http://localhost:9090.
  • [{--frontend} <path/to/frontend>]: Specify the path to the MapD Immerse directory. The default is frontend.
  • [{--enable-https} <bool>]: Enable HTTPS for serving MapD Immerse. The default is false.
  • [{--cert} <cert.pem>]: Path to the HTTPS certificate file. The default is cert.pem.
  • [{--key} <key.pem>]: Path to the HTTPS key file. The default is key.pem.
  • [{--tmpdir} </path/to/tmp>]: Path to custom temporary directory. The default is /tmp/.
  • [{--timeout} <1h0m0s>]: Maximum HTTP request duration. The default is 1h0m0s.

The temporary directory is a staging location for file uploads. You may want to place this directory on the same file system as the MapD Core 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. The temporary directory defaults to the system default /tmp/ if neither the command-line argument nor at least one of the environment variables are specified.

The --timeout option controls the maximum duration of individual HTTP requests. Use this option to manage resource exhaustion caused by improperly closed connections. Note that it limits the execution time of queries made over the Thrift HTTP transport. This timeout duration therefore must be increased if queries are expected to take longer than the default duration of one hour; for example, if you are performing a COPY FROM on a large file when using mapdql with the HTTP transport.

Utilities

initdb

Before using MapD Core is, initialize the data directory via initdb:

initdb [-f] $MAPD_DATA

This creates three subdirectories:

  • mapd_catalogs: Stores MapD Core’s catalogs
  • mapd_data: Stores MapD Core’s data
  • mapd_log: Contains all MapD Core’s log files. MapD Core uses glog for logging.

The -f flag forces initdb to overwrite existing data and catalogs in the specified directory.

generate_cert

generate_cert [{-ca} <bool>]
              [{-duration} <duration>]
              [{-ecdsa-curve} <string>]
              [{-host} <host1,host2>]
              [{-rsa-bits} <int>]
              [{-start-date} <string>]

This command generates certificates and private keys for an HTTPS server. The options are:

  • [{-ca} <bool>]: Whether this certificate should be its own Certificate Authority. The default is false.
  • [{-duration} <duration>]: Duration that the certificate is valid for. The default is 8760h0m0s.
  • [{-ecdsa-curve} <string>]: ECDSA curve to use to generate a key. Valid values are P224, P256, P384, P521.
  • [{-host} <string>]: Comma-separated hostnames and IPs to generate a certificate for.
  • [{-rsa-bits} <int>]: Size of RSA key to generate. Ignored if –ecdsa-curve is set. The default is 2048.
  • [{-start-date} <string>]: Start date formatted as Jan 1 15:04:05 2011