Mentioned @cassandra
My database is ASTRA DB (Casasndra) and I am using Stargate Graphql gateway to interact with astra DB. For client I am using Postman for query and mutation. I have created 2 tables using below mutation from postman:
namespace...My database is ASTRA DB (Casasndra) and I am using Stargate Graphql gateway to interact with astra DB. For client I am using Postman for query and mutation. I have created 2 tables using below mutation from postman:
namespace : createTable(
keyspaceName: "{{gkeyspace}}"
tableName: "T_Namespace"
partitionKeys: [{ name: "namespace_name", type: { basic: TEXT } }]
clusteringKeys: [{ name: "namespace_id", type: { basic: UUID } }]
values: [
{ name: "namespace_desc", type: { basic: TEXT } }
{ name: "audit_info", type: { basic: UDT, info: {name:"audit_info"}}}
]
)
partition : createTable(
keyspaceName: "{{gkeyspace}}"
tableName: "T_Partition"
partitionKeys: [{ name: "partition_name", type: { basic: TEXT } }]
clusteringKeys: [{ name: "partition_id", type: { basic: UUID } }]
values: [
{ name: "partition_desc", type: { basic: TEXT } }
{ name: "namespace_id", type: { basic: UUID } }
{ name: "audit_info", type: { basic: UDT, info: {name:"audit_info"}}}
]
)
}
I would like to know the graphql query to fetch records from T_Namespace table and related records from T_Partition table based on namespace_id present in the T_Partition table.
- Please help to share graphql query.
- Is it a good cassandra table design? if not how to do it?
Forked a repository apache/cassandra
section data is where I get the error section data queen_row db 4 ; Fila inicial de la Reina queen_col db 4 ; Columna inicial de la Reina timer_ticks db 0 ; Contador de ticks del temporizador
section .text global _start
...section data is where I get the error section data queen_row db 4 ; Fila inicial de la Reina queen_col db 4 ; Columna inicial de la Reina timer_ticks db 0 ; Contador de ticks del temporizador
section .text global _start
_start: ; Configurar temporizador mov al, 0B6h ; Modo 3 del temporizador (modo binario) out 43h, al ; Envía el comando al controlador del temporizador mov ax, 1193h ; Valor inicial del temporizador para 10ms out 40h, al ; Envía el byte menos significativo mov al, ah out 40h, al ; Envía el byte más significativo
timer_loop: mov al, 0 ; Esperar a que el temporizador alcance su intervalo in al, 61h ; Leer el registro del controlador del teclado test al, 1 ; Verificar si el bit 0 está activo (indicando que se ha producido un tick) jz timer_loop ; Si no se ha producido un tick, esperar
inc byte [timer_ticks] ; Incrementar contador de ticks
cmp byte [timer_ticks], 5
jne timer_loop; Mover la Reina a una nueva posición cada 5 ticks
; Mover la Reina a una nueva posición en el tablero (aquí iría tu lógica de movimiento)
; Reiniciar el contador de ticks
mov byte [timer_ticks], 0
jmp timer_loop ; Volver a esperar al próximo tick del temporizador
Here's the docker-compose.yml file:
version: "3"
services:
db_cassandra:
container_name: db_cassandra
image: custom.cassandra.image/builder-cassandra
volumes:
-...Here's the docker-compose.yml file:
version: "3"
services:
db_cassandra:
container_name: db_cassandra
image: custom.cassandra.image/builder-cassandra
volumes:
- "./common/cassandra:/lua/cassandra_setup:rw"
environment:
WORKSPACE: "/tmp"
SERVICES_ROOT_DIR: "/services_root"
healthcheck:
test: ["CMD", "cqlsh", "-u", "cassandra", "-p", "cassandra" ]
interval: 5s
timeout: 5s
retries: 60
ports:
- "9042:9042"
remote_cassandra:
container_name: remote_cassandra
build:
context: ../.
dockerfile: ./it/remote_cassandra/Dockerfile
args:
BASE_IMAGE: custom.cassandra.image/builder-cassandra
depends_on:
dd_cassandra:
condition: service_healthy
volumes:
- "./common/cassandra:/lua/cassandra_setup:rw"
environment:
WORKSPACE: "/tmp"
SERVICES_ROOT_DIR: "/services_root"
Here's the remote_cassandra/Dockerfile:
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
COPY ./it/common/cassandra/cassandra-setup.sh /
RUN chmod +x /cassandra-setup.sh
CMD ["/cassandra-setup.sh", "db_cassandra"]
remote_cassandra remotely connects to the db_cassandra service and executes certain queries.
Here's how the cassandra-setup.sh script looks like:
#!/bin/bash
#code that creates schema.cql
.
.
.
DB_CONTAINER="$1"
while ! cqlsh $DB_CONTAINER 9042 -e 'describe cluster' ; do
echo "waiting for db_cassandra to be up..."
sleep .5
done
cqlsh $DB_CONTAINER 9042 -f "${WORKSPACE}/schema.cql"
When I pass the "dd_cassandra" as an argument to ENTRYPOINT, the docker containers are created and nothing happens after that, they keep waiting indefinitely.
However, if I don't pass the argument and simply hardcode it in the cassandra-setup.sh script like this below, then things run smoothly:
#!/bin/bash
#code that creates schema.cql
.
.
.
while ! cqlsh db_cassandra 9042 -e 'describe cluster' ; do
echo "waiting for db_cassandra to be up..."
sleep .5
done
cqlsh db_cassandra 9042 -f "${WORKSPACE}/schema.cql"
I've also tried with:
ENTRYPOINT ["/cassandra-setup.sh"]
CMD ["db_cassandra"]
and it doesn't work too.
- Yes, any node is fine as the driver immediately knows the entire topology of the cluster as soon as it connects to the "contact points" to make the initial handshake
- Connecting to multiple-datacenters via the same client is...
- Yes, any node is fine as the driver immediately knows the entire topology of the cluster as soon as it connects to the "contact points" to make the initial handshake
- Connecting to multiple-datacenters via the same client is always a bad idea. The setup should be to connect the local region/datacenter based application microservices to the same C* region/datacenter for locality purposes. Anyways, during a failover time assuming an entire cloud region goes for a toss, the application services will also be down along with the cluster's datacenter. So, the failover will happen at a layer above these, like a load balancer that will route the traffic to the appropriate region services (app + db). Also, this is the reason we are providing the local datacenter when creating a client. See the below image for a reference (courtesy of DataStax)
- I don't understand what bandwidth we're referring here. If you could update your question and provide clarity, maybe we could try to update our answer accordingly.
I am using node server for the backend. Connection to Cassandra is done using cassandra-driver nodejs.
Connection is done as follows:
const client = new cassandra.Client({
contactPoints: ['h1', 'h2'],
...I am using node server for the backend. Connection to Cassandra is done using cassandra-driver nodejs.
Connection is done as follows:
const client = new cassandra.Client({
contactPoints: ['h1', 'h2'],
localDataCenter: 'datacenter1',
keyspace: 'ks1'
});
- In contactPoints, do I just need to add 'seed' nodes or can I can add any nodes from the datacenter?
- Do I need to run separate backend service for each datacenter? Or is there a way to connect multiple datacenter from the same nodejs backend service?
- Any recommended way for setting backend server such that bandwidth can be minimized between Cassandra nodes and backend server? Should backend server run on the same machine where one of the Cassandra node is running so that data won't need to travel between multiple machines? Or is it fine if backend server runs on a completely separate machine than Cassandra node? Here, for example, if AWS EC2 is used, then data transfer charges might increase due to data flow between Cassandra node and backend server.
commented Pull Request #2852 on apache/cassandra
We should update the .build/README.md as we've removed dtest-offheap and added dtest-latest.
Doing this.
pushed, check new commits.
commented Pull Request #2852 on apache/cassandra
We should update the .build/README.md as we've removed dtest-offheap and added dtest-latest.
Doing this.
It's worth mentioning build-jars.sh as well.
Not doing this (it doesn't add value, it's only used by CI to create the stash)
commented Pull Request #2852 on apache/cassandra
We should update the .build/README.md as we've removed dtest-offheap and added dtest-latest. It's worth mentioning build-jars.sh as well.
opened Pull Request #3215 on apache/cassandra
#3215 CommitlogArchiver only has granularity to seconds for restore_point_in_time
I am working with a K8s environment running application (WEB API/interface) that interacts with a Cassandra database cluster. I need to simulate network latency or introduce delays specifically for responses from the Cassandra cluster to one of...
I am working with a K8s environment running application (WEB API/interface) that interacts with a Cassandra database cluster. I need to simulate network latency or introduce delays specifically for responses from the Cassandra cluster to one of my Kubernetes pods. I cannot touch Cassandra DB cluster or specific apache pods (limitation due to lab usage).
Cassandra version:
$ nodetool version ReleaseVersion: 4.1.1 $
Easiest way would be to use "tc"(traffic control) within K8s POD, but it's not available, and there is no possibility to install it (install package comes from R&D and extra development would be needed for that.
As an alternative approach, I attempted to adjust the "cas-q.request.timeout.ms" parameter to 1ms and introduced extra load to increase the likelihood of timeouts, but no success.
Maybe there is a way to introduce some latency outside of the K8s POD, or some other methods that I did not consider.
It seems that you can only create one Lucene index for one table in Cassandra.
And if you want to add a new field to the index, you need to drop that old Lucene index and reindex.
But reindex for data on one node is time...
It seems that you can only create one Lucene index for one table in Cassandra.
And if you want to add a new field to the index, you need to drop that old Lucene index and reindex.
But reindex for data on one node is time consuming.
Am I right?
I have searched for quite a while. But still not sure about it.
Appreciate your comment.
Thanks!
Mentioned @cassandra
Answered Cassandra OversizedMessageException
Will this impact the integrity of data?
No. This exception was triggered in a ReadStage thread - This type of thread is responsible for local reads, which don't modify the dataset...
Will this impact the integrity of data?
No. This exception was triggered in a ReadStage thread - This type of thread is responsible for local reads, which don't modify the dataset in any way.
And is there something I can do to avoid the error e.g. resize some param on Cassandra.yaml?
Yes. I would start by finding the root cause and addressing it, rather than changing configuration. I can think of likely 2 scenarios where this exception would be triggered:
- The client scanned through a large partition in a single query (exceeding ~128 MiB). To validate this you can verify what's the max partition uncompressed size by running the following:
-
Cassandra 4.1.X and above:
nodetool tablestats -s compacted_partition_maximum_bytes -t 1 -
Previous versions:
nodetool tablestats | grep "Compacted partition maximum bytes" | awk '{print $5}' | sort -n | tail -1
-
If you see a partition over 128MiB, then it may be necessary to check if there is a query reading whole partitions in the correspondent table. And if there is one, rethink the data model in order to control partition size. One common solution to this problem is to bucket partitions by time or other arbitrary fields that can split the partitions in a balanced way.
- A client is issuing a range scan. This includes read queries that read multiple partitions, such as queries that need
ALLOW FILTERINGand don't filter by partition key, and it's usually very expensive in Cassandra. Generally you'll be able to catch those in debug.log through slow query logs. If this is the case, I strongly recommend to consider modeling a table for each of those queries so that all reads are single-partition reads and the database performance scales well with the workload.
Finally, the quick configuration fix (in Cassandra 4.X) is to edit the following parameters in cassandra.yaml and restart nodes to apply changes:
internodeapplicationsendqueuereserveendpointcapacityinbytes - defaults to 134217728
internodeapplicationreceivequeuereserveendpointcapacityinbytes - defaults to 134217728
Feel free to check the official documentation on internode messaging here.
Posted Multi Host Cassandra with Stargate in r/cassandra
Hello, i’m trying to deploy Stargate that gets connected to Cassandra on three different hosts. My issue is that Cassandra manages to communicate with the other hosts that have the db up but when it comes to Stargate it’s just failing. If it s...
Hello, i’m trying to deploy Stargate that gets connected to Cassandra on three different hosts. My issue is that Cassandra manages to communicate with the other hosts that have the db up but when it comes to Stargate it’s just failing. If it s standalone wants a local seed, if i deploy a cassandra on the stargate host it s failing. Same within a docker setup and bare metal setup. Any advice on how to have cassandra on multiple hosts and a stargate in front of them? Stargate documentation is not that great. Thanks