问题标签 [cassandra-2.0]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
416 浏览

datastax - Datastax Opscenter 显示空存储容量

我正在使用 opscenter 免费版 4.0.2,在 centos 6 上使用 cassandra 2.0.3。登录页面上的存储容量小部件根本没有显示任何数据。storage-capacity 调用正在返回:

{“free_gb”:0,“used_gb”:0,“reporting_nodes”:0}

然而,在集群环视图大小显示正确。

有没有办法来解决这个问题?

0 投票
1 回答
888 浏览

csv - 将 CSV 批量导入 Cassandra 2.0.3

我想将 CSV 批量上传到 cassandra 2.0.3。现在我已经成功地将 CSV 转换为 sstables。

但是,当我运行 sstableloader 时,会出现如下错误消息。这个错误是否会影响我的批量加载,因为我在 cassandra 2.0.3 中找不到导入的数据?

0 投票
1 回答
2215 浏览

cassandra - 在 Cassandra 上使用计数器处理自动增量 ID 的方法?

这不是关于在 Cassandra 上使用自增整数而不是 UUID 作为主键的问题,在这种情况下,我想在 Cassandra 上生成像 PostgreSQL 这样的自动增量效果,它不需要是可扩展的。我使用 UUID 作为表中条目的主键,但我需要为这些条目生成一个类似于 bitly 的 shortid。所以我想创建一个应用程序来获取特定条目的索引并根据该索引生成一个shortid,然后将shortid 设置为条目。

所以我试图在 Cassandra 上做这样的事情:

因此,在这个将处理 shortid 的应用程序中,当应用程序启动时,它将获取该系列的最后一个索引,然后它将增加应用程序本身的值,因为该应用程序将在 Nodejs 上运行,并且 Nodejs 可以扩展它.

应用程序.js

应用程序增加索引并生成 shortid 后,它将在 Cassandra 上持续存在:

那么,真的没有更好的方法在 Cassandra 中做到这一点,而无需创建一个可以做到这一点的应用程序吗?我不能在 Cassandra 上做类似 PostgreSQL 的事情吗:

相比之下,如果上面的语句有效,它可能会锁定行,但是在应用程序本身中增加并获取索引,然后安全地增加 Cassandra 中的计数器不会也锁定行吗?应用程序的规模有多大?

0 投票
1 回答
778 浏览

cassandra - 用于处理 Cassandra CQL 中的集合的 Java API

我正在寻找可以处理 Cassandra 中的集合的 java API。它具有读取/更新/插入/删除列值中的列表/设置/映射等集合的方法。我现在正在使用 Hector 客户端,我没有找到任何可以执行上述要求的方法。API 应该能够处理混合列类型(比如一个列值可以是 utf8,而另一个可以是集合)。任何示例或教程也将不胜感激。

0 投票
1 回答
720 浏览

windows - 如何获取cassandra表中分配的索引列表

1)像使用“DESCRIBE COLUMFAMILY schemaname.tablename”这个命令我们可以获得特定表的详细信息如何知道分配给特定表的索引列表?

提前致谢。

0 投票
0 回答
232 浏览

cassandra - Need multiple Index in cassandra

We are migrating from oracle to cassandra. We have a requirement to do minimal changes to the application.

Three questions came up when i am doing POC on cassandra.

  1. In a Oracle we have created multiple composite indexes but i don't find any document saying cassandra will support that. Is it possible to create multiple composite indexes?. If not any suggestion on this.

  2. Our Txn table is having 7 out of 15 columns used in where clause. Without index i cannot put that column in where clause. Even if i create multiple secondary index, In where clause, Casandra will select one column with low cardinality and it will not use other secondary indexes i have created. Any other way to improve the performance?

  3. Problem on creating index on boolean data type. This is how we are decided to create a table/columnfamily

create table dept( emp_name varchar, emp_id int, dept_id int, dept_name varchar, active boolean, primary key(dept_id,emp_id));

In application we have queries like below 1. select * from dept where dept_name='software'; I have created secondary index for dept_name. So This problem is solved.

  1. select * from dept where dept_id=1001 and active = 'Y'; I feel difficult to create indexes for this query. Since active column is a boolean type, creating secondary index is not useful. Without index i will not able to include that condition in where clause.

Any suggestions for my queries?

0 投票
2 回答
2809 浏览

cassandra - 如何正确使用 cassandra.config 启动参数

我正在尝试通过命令行启动 Cassandra 实例,但在设置 cassandra.config 参数时遇到了一些问题:

当我将其设置为我的配置文件所在的路径时,进程停止并抛出以下错误:

我知道该目录存在,所以我不确定从这里开始。关于如何让它发挥作用的任何想法?

0 投票
2 回答
121 浏览

cassandra - 难以定义 Cassandra 数据模型

我是 Casssandra 的新手,我觉得很难实现数据模型。

我在设计一张桌子时遇到了很多问题。

在我提到表定义之前,我想向您展示我们必须检索和更新记录的方法

要创建一个表,我应该遵循所有 cassandra 定义的规则。我在为表创建索引时遇到了问题

如果我像这样创建主键

我能够检索记录,但是当我更新时,我收到错误消息“在集合中找到主键部分”错误。

如果我创建主键和辅助键,如下所示

我可以进行更新,但是当我检索时,我收到错误消息“二级索引将不允许使用 order by 子句”

我已经使用 cql 创建了电子邮件表,例如

请建议我如何创建满足我查询的电子邮件表。

0 投票
1 回答
20902 浏览

cassandra - 在 cassandra 中使用 Order by 子句

在 cassandra 中创建表时,我们可以提供具有如下排序的聚类键。

当我们向该表中插入数据时,根据 cassandra 文档记录是根据聚类键进行排序的。

当我使用 CQL1 和 CQL2 检索记录时,我得到了相同的排序顺序。

CQL1:

CQL2:

CQL1 和 CQL2 有什么区别?

0 投票
1 回答
767 浏览

cassandra - PreparedStatements 是否由 CQL 字符串缓存?Datastax PreparedStatement 是否保留语句 ID?

服务器和客户端上的语句缓存是否严格按照 PreparedStatement 的字符串再现或其他方式缓存?换句话说,如果两个不同的 PreparedStatement 是通过不同的方式创建的,但最终具有完全相同的 CQL 文本呈现,它们是否都必须准备好(假设相同的服务器)?如果他们来自不同的客户?

更不重要的是......在什么情况下,客户端能够在不咨询服务器的情况下将 PreparedStatement 转换为语句 ID?

(我来自 Oracle 经验,如果有帮助的话。)