Starting and Stopping MapD Core Services¶
MapD Core consists of two system services: mapd_server
and
mapd_web_server
. These services can be started individually using
systemd
or run via the interactive script startmapd
. For
permanent installations, MapD recommends that you use systemd
to
manage the MapD Core services.
Starting and Stopping MapD Core Using systemd
¶
For permanent installations of MapD Core, MapD recommends that you use
systemd
to manage the MapD Core services. systemd
automatically
handles tasks such as log management, starting the services on restart,
and restarting the services in case they die. See Initial Setup.
Initial Setup¶
The provided install_mapd_systemd.sh
script asks a few questions
about your environment, and then installs the systemd
service files
in the correct location. You must run the script as the root
user
to allow the script to perform tasks such as creating directories and
changing their owner.
cd $MAPD_PATH/systemd
sudo ./install_mapd_systemd.sh
This script asks for the following listed in the table that follows.
MAPD_PATH
: path to the MapD Core installation directoryMAPD_STORAGE
: path to the storage directory for MapD Core data and configuration filesMAPD_USER
: user to run MapD Core as. User must exist prior to running the script.MAPD_GROUP
: group to run MapD Core as. Group must exist prior to running the script.MAPD_LIBJVM_DIR
: path to thelibjvm
library directory, as determined in Common Dependencies.
Variable | Use. | Default | Notes |
---|---|---|---|
MAPD_PATH | Path to the MapD Core installation directory. | Current install dir | Consider creating a generic symlink pointing at the install dir and set MAPD_PATH to the symlink to make upgrades easier. |
MAPD_STORAGE | Path to the storage directory for MapD Core data and configuration files | /var/lib/mapd | Must be dedicated to
MapD. The installation
script creates the
directory
$MAPD_STORAGE/data ,
generates an appropriate
configuration file, and
saves the file as
$MAPD_STORAGE/mapd.conf. |
MAPD_USER | User MapD Core is run as | Current user | User must exist before you run the script. |
MAPD_GROUP | Group MapD Core is run as | Current user’s primary group | Group must exit before you run the script. |
MAPD_LIBJVM_DIR | Path to the libjvm library directory. | The script attempts to find the default path | See Common Dependencies. |
For backend rendering-enabled builds, the install_mapd_systemd.sh
script installs a service named mapd_xorg
. This service is
configured to start Xorg
on display :1
, which the
mapd_server
service is configured to use. Before proceeding,
start the the mapd_xorg
service before mapd_server
if you want
to use backend rendering:
sudo systemctl start mapd_xorg
sudo systemctl enable mapd_xorg # start mapd_xorg on startup
Starting MapD Core Using systemd
¶
To manually start MapD Core using systemd
, run:
sudo systemctl start mapd_server
sudo systemctl start mapd_web_server
Stopping MapD Core Using systemd
¶
To manually stop MapD Core using systemd
, run:
sudo systemctl stop mapd_server
sudo systemctl stop mapd_web_server
Enabling MapD Core on Startup¶
To enable the MapD Core services to start on restart, run:
sudo systemctl enable mapd_server
sudo systemctl enable mapd_web_server
Starting and Stopping MapD Core Using startmapd
¶
While MapD recommends that you start MapD Core using systemd
, you can use the startmapd
command for quick testing and system validation. It does not require root access to run. Another reason to use startmapd
is that systemd
is not available on all platforms (for example, Debian 7, CentOS 6, Docker).
You can run MapD Core using the startmapd
script provided in
$MAPD_PATH/startmapd
. This script handles creating the data
directory if it does not exist, inserts a sample dataset if desired,
and starts both mapd_server
and mapd_web_server
.
For backend rendering support, start Xorg and set the DISPLAY
environment variable before running startmapd
:
sudo X :1 &
export DISPLAY=:1
Starting MapD Core Using startmapd
¶
To use startmapd
to start MapD Core, run:
$MAPD_PATH/startmapd --config /path/to/mapd.conf
if you are using a configuration file, or
$MAPD_PATH/startmapd --data $MAPD_STORAGE
to explicitly specify the $MAPD_STORAGE
directory.
Stopping MapD Core When Using startmapd
¶
To stop an instance of MapD Core that was started with the startmapd
script, kill the startmapd
process via CTRL-C
or
pkill startmapd
. You can also use pkill mapd
to ensure all
processes have been killed.