我想知道是否有义务执行cassandra -f使用cassandra-cli或cqlsh ???因为,我测试了连接到cassandra-cli --host 127.0.0.1 --port 9160或cqlsh,我有一条消息错误:连接失败了localhost / 9160
答案 0 :(得分:1)
-f选项是一个标志,所以在启动cassandra时你不必提供它。
-f用于什么?
取决于操作系统,但它用于选择是否在前台/后台运行该过程。
在Windows中
-f
表示您将在后台运行该过程。简单地调用cassandra.bat意味着进程从前台开始。例如:
cassandra.bat # cassandra runs in foreground (i.e.) you see logdata in the terminal
cassandra.bat -f # cassandra runs in background
在基于UNIX的操作系统(linux / osx)
中提供-f标志意味着您在前台运行该进程。不提供它意味着该过程将在后台启动。 E.g:
cassandra.bat # cassandra runs in background, you wont see anything in the terminal
cassandra.bat -f # cassandra runs in foreground
返回错误
这意味着cassandra没有运行。启动任务管理器/活动监视器并验证Cassandra是否正在作为进程/服务执行。此外,如果您想将cqlsh / cassandra-cli连接到本地服务器而不指定localhost ip地址,您只需键入:
path/to/cassandra/bin/cqlsh -3 # the -3 means you use CQL3
path/to/cassandra/bin/cassandra-cli