1

我想知道是否有义务执行 cassandra -f 以使用 cassandra-cli 或 cqlsh ??? 因为,我测试了与 cassandra-cli --host 127.0.0.1 --port 9160 或 cqlsh 的连接,我收到一条消息错误:连接到 localhost/9160 失败

4

1 回答 1

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 标志意味着您在前台运行该进程。不提供它意味着该过程将在后台启动。例如:

cassandra.bat     # cassandra runs in background, you wont see anything in the terminal
cassandra.bat -f  # cassandra runs in foreground


回到错误

这意味着 cassandra 没有运行。启动任务管理器/活动监视器并验证 Cassandra 是否作为进程/服务执行。此外,如果您想在不指定 localhost ip 地址的情况下将 cqlsh / cassandra-cli 连接到本地服务器,您只需键入:

path/to/cassandra/bin/cqlsh -3      # the -3 means you use CQL3
path/to/cassandra/bin/cassandra-cli
于 2013-06-03T12:46:55.223 回答