Setting permissions to run the agent as a different user

Describes necessary directory and file permissions if you need to run the agent as a different user than the default user for DataStax Enterprise or , which is cassandra.

Running the agent as the same user running DataStax Enterprise or is highly recommended because directory and file permissions do not need to be set manually. By default, the DataStax agent is installed with the Installer-Services or package installations and runs as the same user as DataStax Enterprise and , which is cassandra. When installing the agent from Installer-No Services or tarball installations, you must manually configure the agent and DataStax Enterprise or as different users.

Prerequisites

Ensure the necessary read and write permissions are set for the user or group running the agent:
Directory and File Permissions
Feature functionality Permissions required
General agent functionality Read permission to cassandra.yaml
Configuring a cluster Read/write permissions to configuration directories and files.
Backup and restore
  • Read/write permissions to configuration directories and files.
  • Read/write permissions to Cassandra data directories.
    Note: A umask must also be set to accommodate group permissions for new tables and data.
  • If commitlog archiving is enabled, the DataStax Enterprise process must also have permissions to run the agent's archive script and write permissions to the configured backup directory.
Directory and File Locations
Directory/File Location
cassandra.yaml See Configuration directories and files below.
Configuration directories and files
  • DataStax Enterprise Installer-Services or package installations: /etc/dse
  • DataStax Enterprise Installer-No Services or tarball installations: install_location/conf
  • Cassandra package: /etc/cassandra
  • Cassandra tarball: install_location/conf
Data directories Default: /var/lib/cassandra
Note: Location is user-configurable; set in cassandra.yaml.
Commitlog archiving script
  • Agent package install: /usr/share/datastax-agent/bin/archive_commitlog.sh
  • Agent tarball install: <install location>/bin/archive_commitlog.sh

Procedure

To set up the umask:

  1. Open a terminal.
  2. To give read/write permissions for new tables and data, edit the appropriate shell file for the DataStax Enterprise or environment:
    File Location
    dse-env.sh
    • /etc/dse/
    • <install location>/conf/
    cassandra-env.sh
    • /etc/cassandra
    • <install location>/conf
  3. Add the command umask 002 to the top of the file.
    Setting the umask to 002 is required because Cassandra creates new directories or files as 0700 by default, which does not grant read or write permissions.
    umask 002