Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 shell 脚本以编程方式安装和配置 cassandra。我安装 cassandra,运行./cassandra,然后尝试使用cassandra-cli --host localhost -f <schema-file>. 问题是它试图在 cassandra 启动之前加载模式并引发异常。有什么方法可以知道 cassandra 何时启动并运行?
./cassandra
cassandra-cli --host localhost -f <schema-file>
谢谢!
在加载模式之前,您可以检查是否有任何东西正在侦听 9160(Thrift 端口)。绑定到端口是服务所做的最后一件事,并表明它已准备好为请求提供服务。
如果 Cassandra 正在运行此命令将返回一些内容:
sudo lsof -i :9160
使用./cassandra -f然后当 Cassandra 开始监听 Thrift 端口时你就会知道它
./cassandra -f