Datastax Cassandra without root
Asked Answered
R

4

6

I am trying to install and run the Datastax cassandra community edition on Redhat Linux but I don't have root privileges. I extracted the tar in my home directory but I'm unable to do ./cassandra

I am doing this on a HPC cluster and thought I'd install Cassandra in my home directory and save the data in a scratch space we've been provided (home directory doesn't have enough space to hold entire data)

I would appreciate any help! Thanks!

Rustin answered 6/8, 2014 at 19:49 Comment(2)
Why are you unable to execute Cassandra. What error message do you get? It is entirely possible to run Cassandra as a non root user.Johanson
From your Cassandra's bin directory, can you run and post the output from: ls -al cassandraBornholm
S
10

From the installation docs for DataStax community edition, the only other step you need is to create the data and log directories:

$ sudo mkdir /var/lib/cassandra
$ sudo mkdir /var/log/cassandra
$ sudo chown -R  $USER: $GROUP /var/lib/cassandra
$ sudo chown -R  $USER: $GROUP /var/log/cassandra

If you are using a different location, that's fine. Just make sure to create the dirs and assign owners (like above) and also set the appropriate values in cassandra.yaml (data_file_directories, commitlog_directories, saved_caches_directory) and log4j-server.properties.

A more detailed log of the results you're seeing would confirm whether this is the problem.

Sing answered 27/8, 2014 at 2:20 Comment(0)
I
1

Yes, you can run Cassandra without having root or sudo privileges. Extract Cassandra tar file into your local user directory, configure cassandra.yaml as single node. Then you run Cassandra from bin directory, either in foreground or background and login using cql shell.

bin/cassandra -f OR bin/cassandra AND cqlsh

Imaret answered 10/6, 2015 at 17:7 Comment(0)
G
1

This is for Cassandra version 2.1x You can run Cassandra without root or sudo privileges, Besides extracting the tar file, you need to modify the conf/logback.xml to redirect the log to your home or somewhere you can write.

    <file>/home/xxxx/system.log</file>
     <fileNamePattern>/home/xxxx/system.log.%i.zip</fileNamePattern>

The only minor issue of not running with root is - the ULIMIT -l (RLIMIT on max locked memory) will need to be increased and I cannot increase it with my account. But this does not prevent it to run..

Galyak answered 12/6, 2015 at 3:10 Comment(0)
K
0

In my opinion, almost all the java-written apache projects need not the root privilege. Cassandra has the same feature.

Firstly, download apache-cassandra-bin.tar.gz from http://cassandra.apache.org/download/. Remember that do not use .deb or .rpm or others.

Secondly, run tar -xzf cassandra-bin.tar.gz to unzip it to any folder, suppose the folder is $cassandra_home

Thirdly, just go to $cassandra_home/bin, run ./cassandra, done! The data is stored in $cassandra_home/data and the logs are in $cassandra_home/logs.

If you want to set the position of data and logs:

1st, go to $cassandra_home/conf, modify cassandra.yaml file. Set these directories to the folder which you have read and write access:

  • data_file_directories:
  • commitlog_directory:
  • cdc_raw_directory:
  • hints_directory:
  • saved_caches_directory:

(different cassandra version may have different parameters. You can just search director in the yaml file.)

2nd, if you want to enable the log, modify the log file position, modify $cassandra_home/conf/logback.xml (or log4j or others), and set the log folder to another position.

Enjoy it.

Kalisz answered 13/4, 2017 at 15:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.