linux - 以编程方式加载 Cassandra 架构

标签 linux nosql cassandra

我正在尝试使用 shell 脚本以编程方式安装和配置 cassandra。 我安装了 cassandra,运行 ./cassandra然后我尝试使用 cassandra-cli --host localhost -f <schema-file> 加载模式.问题是它试图在 cassandra 启动并抛出异常之前加载架构。有什么方法可以知道 cassandra 何时启动并运行?

谢谢!

最佳答案

您可以在加载架构之前检查是否有任何内容正在监听 9160(Thrift 端口)。绑定(bind)到端口是服务所做的最后一件事,表明它已准备好为请求提供服务。

如果 Cassandra 正在运行,此命令将返回一些内容:

sudo lsof -i :9160

关于linux - 以编程方式加载 Cassandra 架构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14650429/

相关文章:

linux - CronTab 没有运行

c - strtok 的段错误

nosql - 在我的错误跟踪应用程序中使用 redis/nosql 而不是 postgres 会有什么好处吗?

javascript - 有没有好的方法来替换集合中的所有 couchDB 对象?

C++ Cassandra 构建错误

linux - 在 Intellij IDEA 13 (Linux) 中打开一个 eclipse 项目

php 无法在 ubuntu 桌面 16.04.02 上运行

elasticsearch - 在Elasticsearch中更新过滤的文档

scala.ScalaReflectionException : <none> is not a term

cassandra - Cassandra 的 Stargate 文档 API 分页