Run CrateDB on Red Hat Linux

CrateDB maintains the official RPM repositories for:

Both of these work with RedHat Enterprise Linux, CentOS, and Scientific Linux.

Table of Contents

Configure YUM

All CrateDB packages are signed with GPG.

To get started, you must import the CrateDB public key, like so:

sh$ sudo rpm --import https://cdn.crate.io/downloads/yum/RPM-GPG-KEY-crate

You must then install the CrateDB repository definition.

For Red Hat Linux 7, run:

sh$ sudo rpm -Uvh https://cdn.crate.io/downloads/yum/7/noarch/crate-release-7.0-1.noarch.rpm

For Red Hat Linux 6, run:

sh$ sudo rpm -Uvh https://cdn.crate.io/downloads/yum/6/x86_64/crate-release-6.5-1.noarch.rpm

Both of the above commands will create the /etc/yum.repos.d/crate.repo configuration file.

CrateDB provides a stable and a testing release channel. At this point, you should select which one you wish to use.

By default, YUM (Red Hat’s package manager) will use the stable repository. This is because the testing repository’s configuration marks it as disabled.

If you would like to enable to testing repository, open the crate.repo file and set enabled=1 under the [crate-testing] section.

Install CrateDB

With everything set up, you can install CrateDB, like so:

yum install crate

CrateDB is now installed, but not running.

Running and Controlling CrateDB

With Red Hat Linux 7, you can control the crate service like so:

sh$ sudo systemctl COMMAND crate

With Red Hat Linux 6, you should use:

sh$ sudo service crate COMMAND

In both instances, replace COMMAND with start, stop, restart, status, etc.

After you run the appropriate command with the start argument, the crate service should be up-and-running.

You should be able to access it by visiting:

http://localhost:4200/

See also

If you’re new to CrateDB, check out our our first use documentation.

Caution

Be sure to read the guide to rolling upgrades and full restart upgrades before attempting to upgrade a running cluster.

Configuration

Configuration Files

The main CrateDB configuration files are located in the /etc/crate directory.

Environment

The CrateDB startup script sources environment variables from the /etc/sysconfig/crate file.

You can use this mechanism to configure CrateDB.

Here’s one example:

# Heap Size (defaults to 256m min, 1g max)
CRATE_HEAP_SIZE=2g

# Maximum number of open files, defaults to 65535.
# MAX_OPEN_FILES=65535

# Maximum locked memory size. Set to "unlimited" if you use the
# bootstrap.mlockall option in crate.yml. You must also set
# CRATE_HEAP_SIZE.
MAX_LOCKED_MEMORY=unlimited

# Additional Java OPTS
# CRATE_JAVA_OPTS=

# Force the JVM to use IPv4 stack
CRATE_USE_IPV4=true

Customized Setups

A full list of package files can be obtained with this command:

sh$ rpm -ql crate

If you want to deviate from the way that the crate package integrates with your system, we recommend that you go with a basic tarball installation.