Reputation: 61
I would to know if it's an obligation to execute cassandra -f for use cassandra-cli or cqlsh ??? Because, i tested connection to cassandra-cli --host 127.0.0.1 --port 9160 or cqlsh and i have a message error : connection failed to localhost/9160
Upvotes: 1
Views: 768
Reputation: 14173
The -f option is a FLAG, so no you don't have to supply it when starting cassandra.
What does -f get used for?
Depends on the OS but its used for choosing whether to run the process in the foreground / background.
In Windows
-f
means you will run the process in the background. Simply calling cassandra.bat means the process starts in the foreground. E.g:
cassandra.bat # cassandra runs in foreground (i.e.) you see logdata in the terminal
cassandra.bat -f # cassandra runs in background
In UNIX based OSs (linux / osx)
Supplying the -f flag means you run the process in the foreground. Not supplying it means the process will start in the background. E.g:
cassandra.bat # cassandra runs in background, you wont see anything in the terminal
cassandra.bat -f # cassandra runs in foreground
Back to the error
This means that cassandra isn't running. Start the task manager / activity monitor and verify that Cassandra is executing as a process / service. And also if you want to connect cqlsh / cassandra-cli to a local server without specifying the localhost ip address you can simply type:
path/to/cassandra/bin/cqlsh -3 # the -3 means you use CQL3
path/to/cassandra/bin/cassandra-cli
Upvotes: 1