问题标签 [cassandra-2.1]
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.
cassandra - 在 cassandra 中使用唯一列作为分区键的任何限制
我有一个场景,我只有可以在分区键中使用的序列号列,其余列将在节点上创建大分区。
所以我的问题是,在分区键中使用序列号有什么缺点吗?
通过这样做,我的选择查询将扫描整个表而不是转到特定分区。
注意:我有动态选择语句。
谢谢
datastax-enterprise - Cassandra中的通用VS特定模型?
这篇文章很长,让我们从一些背景开始:天气数据在我们的架构中起着核心作用。一个天气数据主要由五个值组成:
- 温度
- 雨
- 全球辐射
- 风(方向、速度)
- 相对湿度
但是我们也可以有更多的自定义值。
我们的特点是:
缺失值:所有这五个值并不总是可以从一个气象站获得。有时我们需要从最近的气象站获取缺失值(例如:全球辐射)
采样率:对于一个给定的气象站,五个值之间的采样率可以不同。
虚拟站:我们也有特殊的“虚拟”气象站,由分离的气象传感器(来自真实气象站)组成。
在所有情况下,在采集过程结束时,对于气象站(真实或虚拟)中的每个事件,我们都需要根据这五个值计算一些更高级别的指数。这五个值或更高级别的指数中的一些每天汇总。
我们计划使用 Spark 进行数据处理。
这三个模型中哪一个是最相关的,并且不会剥夺我们对 Cassandra 的好处?
如何管理传感器和weather_stations(缺失数据和虚拟站)之间的关系?
传感器模型 - 所有数据的一张表
测量模型 - 按数据类型的一张表
对于所有类型的测量都是一样的。然后从这些表中,我们需要处理数据以聚合所有内容,填充缺失值并以较低的采样率重复值。
气象站模型 - 一张包含所有数据的表格
然后我们用虚拟站、缺失值和具有较低采样率的重复值填充一个weather_data_processed 表。
java - Cassandra load balancing with TokenAwarePolicy and shuffleReplicas
We have 6 node cluster where we deploy everything to one region on AWS with 3 Availability Zones. We are using Ec2Snitch which should distribute one replica in each availability zone. We use DataStax Java driver. Servers doing write and read are distributed in availability zones same as nodes are (1 server by AZ). What we want to achieve is best possible read performance, write for us is not that important in a sense that we need to write data but not necessary fast. We use replication factor 3 but read and write with consistency level ONE.
We are investigating shuffle replicas in TokenAwarePolicy. It is said in DataStax Java Driver that it can increase read performance but decrease write distribution.
First question is about shuffleReplicas
implementation, I followed implementation of newQueryPlan
method and what I figured out is that for replicas LinkedHashSet
is used meaning that primary replica will be always preferred to non primary replica.
Just to confirm, that will mean that driver will always prefer to connect to node where primary replica is, to have it as coordinator, if we set shuffleReplicas
to false, which can create hot spots?
Second question is about idea to separate connection to cluster, and for writes use shuffleReplicas
on true, which will distribute evenly tokens across cluster and for read to use TokenAwarePolicy
with shuffleReplicas
on false to gain best possible reads, is this idea viable and do you see any problems with it?
We would like to have reads always from same availability zone to gain maximum possible speed while reading data. Is this better approach then leaving shuffleReplicas
on true and letting cluster choose coordinator evenly. Idea can be also to use WhiteListPolicy
which will select only nodes from same AZ to servers placed in that AZ which will result in local read but that can create hot spots.
java - Cassandra java.lang.IllegalArgumentException:getMetaData 时的文本
我在收集元数据时遇到了 cassandra 异常。例外:
CassandraDriver 第 70 行中的代码:
CassandraDriver 方法的代码:
为什么会抛出异常?这是什么意思?谢谢!
编辑:添加代码该方法负责连接到 cassandra 集群并设置密钥空间。因此有一个配置文件被解析为对象配置。
uuid - 将 UUID 数据从 DSE 解释到 Tableau
考虑在 DSE 4.8.3 Cassandra 中有一个表:
我正在使用Simba SparkSQL连接器在Tableau和Cassandra之间进行连接。
但我收到以下错误:
此错误似乎是由于UUID字段 - test_orders列族中的 order_id 而发生的。如何解决这个问题?
apache-spark - 为什么我在使用 spark+cassandra 时出现错误:“大小超过 Integer.MAX_VALUE”?
我有 7 个 cassandra5 nodes with 32 cores and 32G memory, and 4 nodes with 4 cores and 64G memory
节点8th node
(我为他们使用了spark-cassandra-connector。现在我的 cassandra 有近 10 亿条记录和 30 个字段,我编写了包含以下代码段的 scala:
spark-submit
在我用来运行上述代码的 spark 的 master中,当执行语句:时rdd_cache.count()
,我ERROR
在一个工作节点中得到了一个192.168.0.185
::
我只是认为最终的错误Size exceeds Integer.MAX_VALUE
是由 warn:16/03/08 15:43:49 WARN MemoryStore: Not enough space to cache rdd_6_0 in memory! (computed 4.6 GB so far)
之前引起的,但我不知道为什么,或者我是否应该设置一个大于.set("spark.executor.memory", "12G")
,我应该怎么做才能纠正这个?
cassandra - 如何从 cassandra 2.1 的缓存中驱逐准备好的语句
我正在尝试使用 datastax 中的 nodejs 驱动程序将字段添加到 cassandra 2.1.2 中的用户定义类型。我ALTER TYPE
在 cqlsh 中添加了该字段。当我尝试添加包含 udt 和新字段值的行时,它会以空值插入,而不是我提供的值。我强烈怀疑这与集群缓存准备好的语句的方式有关。因为我记得读过准备好的语句是由查询的哈希索引的,所以我尝试更改查询中的一些空格以查看它是否有帮助。这实际上似乎有效,但只有一次。随后的插入导致错误:
并且似乎没有添加新行..直到我重新启动cassandra,此时不仅我认为失败的插入出现,而且后续的插入也可以正常工作。这非常令人不安,但幸运的是我只在测试实例中这样做了。但是,我确实需要在生产中进行此更改,并且重新启动集群以添加单个字段并不是一个真正的选择。有没有更好的方法让集群驱逐缓存的准备好的语句?
java - Cassandra 复制因子大于节点数
我正在为 Apache Cassandra (v. 2.1.9) 使用 datastax java 驱动程序,我想知道当我将 replication_factor 设置为大于节点数时会发生什么。我在某处读过 Cassandra 允许此操作,但是当我尝试保存一些数据时应该会失败(当然这取决于写入一致性级别,但我的意思是 ALL 的情况)。
问题是一切正常,即使我尝试保存数据也不会抛出异常。为什么?
对于旧版本的 Cassandra,我读过的信息可能是旧的?还有一个问题,这是否属实,而不是当我将另一个节点添加到集群时会发生什么?
cassandra - 在 Cassandra 中查找重复行
我有一张如下表:
它也有一些数据。
现在,当我运行此查询时:
它返回 165 行
同样,当我运行此查询时:
它返回 162 行。
有没有办法找出重复的 3 行?