Running CrateDB

This document covers the basics of running CrateDB from the command line.

See also

For help installing CrateDB for the first time, check out Getting Started With CrateDB.

If you’re deploying CrateDB, check out the CrateDB Guide.

Table of Contents

Introduction

CrateDB ships with a crate command in the bin directory.

The simplest way to start a CrateDB instance is to invoke crate without parameters. This will start the process in the foreground.

sh$ ./bin/crate

You can also start CrateDB in the background using the -d option. When starting CrateDB in the background it is helpful to write the process ID into a pid file so you can find out the process id easlily:

sh$ ./bin/crate -d -p ./crate.pid

To stop the process that is running in the background send the TERM or INT signal to it.

sh$ kill -TERM `cat ./crate.pid`

The crate executable supports the following command line options:

Command Line Options

Option

Description

-d

Start the daemon in the background

-h

Print usage information

-p <pidfile>

Log the pid to a file

-v

Print version information

-C

Set a CrateDB configuration value (overrides configuration file)

-D

Set a Java system property value

-X

Set a nonstandard java option

Example:

sh$ ./bin/crate -d -p ./crate.pid

Signal Handling

The CrateDB process can handle the following signals.

Signal

Description

TERM

Stops a running CrateDB process

kill -TERM `cat /path/to/pidfile.pid`

INT

Stops a running CrateDB process

Same behaviour as TERM.

USR2

Stops a running CrateDB process gracefully. See Rolling Upgrade for more information

kill -USR2 `cat /path/to/pidfile.pid`

USR2 is not supported on Windows.