How to set temp directory for Cassandra with Management and Security Server

  • 7023463
  • 22-Oct-2018
  • 23-Oct-2018

Environment

Host Access Management and Security Server (MSS) 12.5 and later
Reflection for the Web (All Editions) 12.3 and later
Reflection ZFE 2.2.3 and later
Linux

Situation

Some companies are requiring the "/tmp" directory to be secured from execution within the directory.  This can cause some problems for applications that use the "/tmp" directory as temporary storage (e.g. Cassandra).

To change where Cassandra stores its temporary files, modify the "cassandra-env.sh" shell script by following the instructions in the resolution section of this document.

Resolution

Note: By default, the "cassandra-env.sh" shell script is located at "/opt/microfocus/mss/server/microservices/cassandra/conf".

  1. Backup "cassandra-env.sh" by copying to another location.
  2. Open the file "cassandra-env.sh" in an editor.
  3. Add the following two entries at the beginning of the shell script.
    • JVM_OPTS="$JVM_OPTS -Djna.tmpdir=/opt/microfocus/mss/server/microservices/cassandra/tmp".
    • JVM_OPTS="$JVM_OPTS -Djava.io.tmpdir=/opt/microfocus/mss/server/microservices/cassandra/tmp".
  4. Save the "cassandra-env.sh" shell script.
  5. Create the directory "/opt/microfocus/mss/server/microservices/cassandra/tmp"
  6. Set your security team's recommended ownership and permissions for the "/opt/microfocus/mss/server/microservices/cassandra/tmp" directory. (default: root root drwxrwxrwt)
  7. Start the Management and Security Server.

Cause

Cassandra stores its temporary files to the "/tmp" directory and if the directory is set to not execute, Cassandra will not start.