List keyspaces in Cassandra

2

I need to learn how to use Apache Cassandra. I'm following a book called Cassandra: The Definitive Guide - Jeffrey Carpenter. I was able to do the installation in a good way, it seems, but when I execute the command:

sudo cassandra -f

I get output:

Running Cassandra as root user or group is not recommended - please start Cassandra using a different system user.
If you really want to force running Cassandra as root, use -R command line option.

So I try to start cassandra always super user privilege

cassandra -f

But I get an error saying:

Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file /var/log/cassandra/gc.log due to Permission denied

In addition, I tried to create a keyspace through CQL Shell, which apparently was created successfully, but when I execute the command:

cqlsh> DESCRIBE KEYSPACE

I get the answer:

Not in any keyspace

What am I doing wrong?

    
asked by anonymous 17.10.2016 / 18:09

3 answers

0

You do not have any KEYSPACE defined yet, your book is probably out-of-date relative to the current version of CQL available in your installation, look for that Datastax reference which is the current maintainer of Cassandra and CQL.

Read the data model again and see the CQL query operations.

To create your KEYSPACE:

CREATE KEYSPACE seukeyspacenome WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'datacenter1' : 3 };

To use your Keyspace:

USE seukeyspacenome;
    
17.10.2016 / 19:04
0

@roooooon You get Not in any keyspace in executing this command, because of the syntax error:

DESCRIBE KEYSPACE

  

You forgot "s" and ";" at the end of

The correct way to list keyspaces / cassandra is:

 cqlsh> DESCRIBE keyspaces;

The result will be:

 system_schema system system_auth system_distributed system_traces

I hope to have helped!

    
07.05.2018 / 21:06
-1

To List Keyspaces:

DESCRIBE keyspaces;
    
07.05.2018 / 17:40