Install an Apache Cassandra database

Tip   A new guide is available in the latest release of API Gateway that includes information on Apache Cassandra best practices and tuning, setting up high availability, and backup and restore. Much of the information in this guide also applies to API Gateway 7.5.3. See the API Gateway 7.6.2 Apache Cassandra Administrator Guide.

Apache Cassandra is required to store data for API Manager (for example, API catalog, quotas, and client registry) or API Gateway client registry (API key and OAuth). In addition, Cassandra is optional to store data for the following API Gateway components:

  • Custom KPS table definitions and data
  • OAuth token stores
Note   You must ensure that Cassandra is installed and running to use API Manager or API Gateway client registry.

You can use the API Gateway installer to install Cassandra version 2.2.8 in GUI mode or unattended mode. Alternatively, you can download Apache Cassandra, or use an existing Cassandra installation.

Supported Cassandra versions

API Gateway supports Apache Cassandra versions 2.2.8 and 2.2.5. For more details on Apache Cassandra, see http://cassandra.apache.org/.

Cassandra 2.2.8 is the recommended version. Cassandra 2.2.5 is supported by API Gateway for backwards compatibility.

For details on upgrading your Cassandra version, see Upgrade from Apache Cassandra version 2.2.5 to version 2.2.8 in the API Gateway Upgrade Guide.

Upgrade from earlier API Gateway versions

API Gateway version 7.5.3 includes the Datastax Cassandra client, which uses a default port of 9042 to communicate with Cassandra over the Cassandra native protocol. Earlier API Gateway versions included the Hector Cassandra client, which used a default port of 9160 to communicate with Cassandra over the Apache Thrift protocol.

In API Gateway version 7.5.1 or later, Cassandra runs externally to the API Gateway process. In earlier API Gateway versions, Cassandra was embedded in the API Gateway process.

For details on upgrading from an earlier API Gateway version, see the API Gateway Upgrade Guide.

Prerequisites

This section describes Cassandra-specific prerequisites in addition to the general API Gateway Prerequisites.

Production environment requirements

API Gateway supports the following in production:

  • Operating systems:
  • Cassandra:
    • Cassandra version 2.2.8 or 2.2.5 on Linux and Windows
    • 64-bit Oracle JRE version 8 on Linux and Windows (OpenJDK is not supported)
Note   On Linux, the default API Gateway installation includes a 64-bit Oracle JRE (apigateway/Linux.x86_64/jre/bin). On Windows, API Gateway includes a 32-bit Oracle JRE (apigateway\Win32\jre), which is suitable for development only.

In a Windows production environment, you must download and install a 64-bit Oracle JRE manually. For more details, see Install a 64-bit Oracle JRE on Windows.

For details on requirements for high availability, see HA production environment requirements.

Install a 64-bit Oracle JRE on Windows

The default 32-bit Oracle JRE bundled with API Gateway on Windows limits the memory available to Cassandra on 64-bit systems, and cannot run Cassandra as a Windows service. In a production environment, you must download and install a separate 64-bit Oracle JRE.

Note   If you select the default 32-bit Oracle JRE bundled with API Gateway, and later decide to switch to a 64-bit Oracle JRE, you must edit your CASSANDRA_HOME\bin\cassandra.in.bat script, and change the JAVA_HOME variable at the top of the file to point to the new Oracle JRE. For example:

SET JAVA_HOME=C:\Program Files\Java\jre8

JCE policies for Cassandra TLS/SSL

If client TLS/SSL will be enabled for Cassandra, you must install the Java Cryptographic Extension (JCE) policies for your Oracle JRE. For example, you can download the Java 8 JCE policies from:

http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html

Install Apache Cassandra

Note   Apache Cassandra 2.2.8 is installed by default in an API Gateway Standard or Complete setup. For more details, see in Installation options.

Install Cassandra in GUI mode

In GUI mode, to install Apache Cassandra only, use the steps described in Installation options with the following selections:

  • Setup Type: Select Custom.
  • Select Components: Select Cassandra.
  • Cassandra configuration: Enter your Cassandra Installation Directory and your JRE Location. For more details, see Cassandra configuration.

Install Cassandra in unattended mode

To install Apache Cassandra using the API Gateway installer in unattended mode, follow the steps described in Unattended installation. For example, the following command shows how to install Apache Cassandra only in unattended mode:

UNIX/Linux

./APIGateway_7.5.3_Install_linux-x86-32_BN<n>.run --mode unattended 
--setup_type advanced 
--enable-components cassandra
--disable-components apigateway,analytics,qstart,policystudio,
configurationstudio,apitester,apimgmt,packagedeploytools
--cassandraInstalldir /opt/db/cassandra
--cassandraJDK /opt/jre
--startCassandra 0

Windows

./APIGateway_7.5.3_Install_linux-x86-32_BN<n>.run --mode unattended 
--setup_type advanced 
--enable-components cassandra
--disable-components apigateway,analytics,qstart,policystudio,
configurationstudio,apitester,apimgmt,packagedeploytools
--cassandraInstalldir c:\cassandra
--cassandraJDK c:\jre
--startCassandra 0
Note   To keep your Cassandra installation after API Gateway is uninstalled, you must ensure that you first install Cassandra only. For example, perform the following steps:
  1. Run the API Gateway installer, and select Cassandra only.
  2. Run the API Gateway installer, and select API Gateway components to install.

Then when API Gateway is uninstalled, Cassandra remains installed.

Further details

For more details on Apache Cassandra, see the following:

Related Links