Starting and Stopping MapD Core Services¶
MapD Core consists of two system services: mapd_server
and
mapd_web_server
. You can start these services individually using
systemd
or run them using the interactive script startmapd
.
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 if they die.
Initial Setup¶
The 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
for the script to perform tasks such as creating directories and
changing owner.
cd $MAPD_PATH/systemd
sudo ./install_mapd_systemd.sh
This script asks for the information described in the following table.
Variable | Use | Default | Notes |
---|---|---|---|
MAPD_PATH | Path to the MapD Core installation directory | Current install directory | Consider creating a generic symlink pointing at the install directory 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 exist 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. |
NOTE: On MapD releases 3.0.0 and lower, 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 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
¶
MapD recommends that you start MapD Core using systemd
. However, you can use the startmapd
command for quick testing and system validation.
It does not require root access to run. In addition, use startmapd
on platforms that do not support systemd
, such as Debian 7, CentOS 6, and Docker.
You can run MapD Core using the startmapd
script provided in
$MAPD_PATH/startmapd
. This script creates the data
directory if it does not exist, inserts a sample dataset if desired,
and starts both mapd_server
and mapd_web_server
.
NOTE: For MapD releases 3.0.0 and lower, 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 using CTRL-C
or
pkill startmapd
. You can also use pkill mapd
to ensure that all
processes have been killed.