RE: Fatal Java error when starting cassandra

2021-03-18 Thread Manu Chadha
Thanks. No success unfortunately

From: Regis Le Bretonnic 
Sent: 18 March 2021 07:13
To: user@cassandra.apache.org
Subject: RE: Fatal Java error when starting cassandra

Probably DLLs that are not registered.
You should cleanly install Cassandra and java... and then copy your keyspaces 
(...\cassandra\data contents)


Fatal Java error when starting cassandra

2021-03-18 Thread Manu Chadha
Hi

Cassandra doesn't start on my PC. I recently changed my machine. I simply 
copied the old Cassandra folder in the new machine. When I start Cassandra, I 
get error. Sorry for dumping the whole thing here but I don't know where to 
look. My preference is not to reinstall Cassandra. I am using 3.11.6 version


#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc005) at pc=0x10014ed4, pid=30524, 
tid=0x6fec
#
# JRE version: Java(TM) SE Runtime Environment (8.0_281-b09) (build 
1.8.0_281-b09)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.281-b09 mixed mode 
windows-amd64 compressed oops)
# Problematic frame:
# C  [sigar-amd64-winnt.dll+0x14ed4]
#
# Failed to write core dump. Minidumps are not enabled by default on client 
versions of Windows
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---  T H R E A D  ---

Current thread (0x01ae87d4fc00):  JavaThread "main" [_thread_in_native, 
id=28652, stack(0x006f9a80,0x006f9a84)]

siginfo: ExceptionCode=0xc005, reading address 0xa8ac1d98

Registers:
RAX=0xa8ac1c60, RBX=0x01aea8c88788, RCX=0x01ae87d4fdf8, 
RDX=0x006f9a83e478
RSP=0x006f9a83e2a0, RBP=0x006f9a83e458, RSI=0x01aea57d0480, 
RDI=0x0011f2d8
R8 =0x0032, R9 =0x0005c822fac0, R10=0x0014, 
R11=0x54708a5c
R12=0x, R13=0x01aea8c88780, R14=0x006f9a83e478, 
R15=0x01ae87d4fc00
RIP=0x10014ed4, EFLAGS=0x00010286

Top of Stack: (sp=0x006f9a83e2a0)
0x006f9a83e2a0:   01ae87d4fdf8 006f9a83e478
0x006f9a83e2b0:   01ae87d4fc00 01aea8c88780
0x006f9a83e2c0:   a8ac1c60 006f9a83e478
0x006f9a83e2d0:   006f9a83e458 10021a81
0x006f9a83e2e0:   01ae87d4fdf8 006f9a83e478
0x006f9a83e2f0:   01aea57d0480 0011f2d8
0x006f9a83e300:   01ae87d4fc00 
0x006f9a83e310:   01ae87d4fc00 01ae87d4fc00
0x006f9a83e320:   01aea60a9d18 
0x006f9a83e330:   01aea8c88788 
0x006f9a83e340:   01ae87d4fc00 006f9a83e478
0x006f9a83e350:   006f9a83e458 53ff2d7b
0x006f9a83e360:   006f9a83e390 
0x006f9a83e370:   01aea8c88788 01ae87d66e50
0x006f9a83e380:   01aea8c88788 01ae87d4fc00
0x006f9a83e390:   01aea8c88788 01ae87d4fc00

Instructions: (pc=0x10014ed4)
0x10014eb4:   7c 24 20 00 75 15 48 8d 15 df 58 04 00 48 8b 4c
0x10014ec4:   24 40 e8 45 00 00 00 33 c0 eb 32 48 8b 44 24 20
0x10014ed4:   83 b8 38 01 00 00 00 74 1f 48 8b 44 24 20 44 8b
0x10014ee4:   80 38 01 00 00 48 8b 54 24 20 48 8b 4c 24 40 e8


Register to memory mapping:

RAX=0xa8ac1c60 is an unknown value
RBX={method} {0x01aea8c88790} 'getFileSystemListNative' 
'()[Lorg/hyperic/sigar/FileSystem;' in 'org/hyperic/sigar/Sigar'
RCX=0x01ae87d4fdf8 is an unknown value
RDX=0x006f9a83e478 is pointing into the stack for thread: 0x01ae87d4fc00
RSP=0x006f9a83e2a0 is pointing into the stack for thread: 0x01ae87d4fc00
RBP=0x006f9a83e458 is pointing into the stack for thread: 0x01ae87d4fc00
RSI={method} {0x01aea57d0488} '' '()V' in 'java/lang/Object'
RDI=0x0011f2d8 is an unknown value
R8 =0x0032 is an unknown value
R9 =
[error occurred during error reporting (printing register info), id 0xc005]

Stack: [0x006f9a80,0x006f9a84],  sp=0x006f9a83e2a0,  free 
space=248k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [sigar-amd64-winnt.dll+0x14ed4]
C  [sigar-amd64-winnt.dll+0x21a81]
C  0x01ae89b09cee

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  
org.hyperic.sigar.Sigar.getFileSystemListNative()[Lorg/hyperic/sigar/FileSystem;+0
j  org.hyperic.sigar.Sigar.getFileSystemList()[Lorg/hyperic/sigar/FileSystem;+1
j  
org.hyperic.sigar.Sigar.getFileSystemMap()Lorg/hyperic/sigar/FileSystemMap;+19
j  org.apache.cassandra.utils.SigarLibrary.()V+79
j  org.apache.cassandra.utils.SigarLibrary.()V+4
v  ~StubRoutines::call_stub
j  org.apache.cassandra.service.StartupChecks$7.execute()V+0
j  org.apache.cassandra.service.StartupChecks.verify()V+30
j  org.apache.cassandra.service.CassandraDaemon.setup()V+41
j  org.apache.cassandra.service.CassandraDaemon.activate()V+46
j  org.apache.cassandra.service.CassandraDaemon.main([Ljava/lang/String;)V+3
v  ~StubRoutines::call_stub

---  P R O C E S S  ---

Java Threads: ( => current thread )
  0x01aea76205c0 JavaThread "EXPIRING-MAP-REAPER:1" daemon 
[_thread_blocked, id=20336, 

RE: unable to restore data from copied data directory

2021-01-04 Thread Manu Chadha
Thanks for the tip on dsbulk. I’ll check that. I agree that the approach of 
folder copy would work only if the topology is the same.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Durity, Sean R<mailto:sean_r_dur...@homedepot.com>
Sent: 04 January 2021 15:23
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: RE: unable to restore data from copied data directory

This may not answer all your questions, but maybe it will help move you further 
along:
- you could copy the data (not system) folders *IF* the clusters match in 
topology. This would include the clusters having the same token range 
assignment(s). And you would have to copy the folders from one original node to 
the exact matching node in the second cluster. [To learn more, read about how 
Cassandra distributes data across the cluster. It will take effort to have 
exact matching clusters]
- If you cannot make an exact match in topology, investigate something like 
dsbulk for moving data in and out of clusters with whatever topology they have. 
This is a much more portable solution.
- I know that teams also do disk snapshots on cloud platforms as one back-up 
solution. They can attach that disk snapshot to a new VM (configured the same 
as the previous one) as needed. I don’t know all the particulars of this 
approach, though.

Sean Durity – Staff Systems Engineer, Cassandra

From: Manu Chadha 
Sent: Saturday, January 2, 2021 4:54 PM
To: user@cassandra.apache.org
Subject: [EXTERNAL] RE: unable to restore data from copied data directory

Thanks. Shall I copy only system-schema folder? I tried copying all the folders 
and could think of the following issues I encountered


  1.  C* didnt’ start because the Cluster name by default is Test Cluster while 
the tables seem to refer to K8ssandra cluster “Saved cluster name k8ssandra != 
configured name Test Cluster”
  2.  Then I got this error – “Cannot start node if snitch's data center 
(datacenter1) differs from previous data center (dc1). Please fix the snitch 
configuration, decommission and rebootstrap this node or use the flag 
-Dcassandra.ignore_dc=true.”
  3.  At one point I also got error about no. of tokens (cannot change the 
number of tokens from 257 to 256).

It seems it is not straightforward that I just copy the folders. Any advice 
please?

Sent from Mail 
[go.microsoft.com]<https://urldefense.com/v3/__https:/go.microsoft.com/fwlink/?LinkId=550986__;!!M-nmYVHPHQ!ai9gYDQx9GefMy2MFnDQ1M78ESN82mrl5cEUatLFj1tid3lqNHXxRCnk4kKd19RO5AevlM0$>
 for Windows 10

From: Jeff Jirsa<mailto:jji...@gmail.com>
Sent: 02 January 2021 20:57
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: unable to restore data from copied data directory



On Jan 2, 2021, at 7:30 AM, Manu Chadha 
mailto:manu.cha...@hotmail.com>> wrote:

Hi

Can I just copy the keyspace folders into new cassandra installation s backup 
and restore strategy? I am trying to do that but it isn’t working.

I am using `K8ssandra` to run my single node C* cluster. I am experimenting 
with data backup and restore. Though K8ssandra uses medusa for data backup and 
restore, I could use it so I thought to test by simply copying/pasting the data 
directory. But I don’t see my data after restore. There could be mistakes in my 
approach so I am not really sure where to look. For example

  1.  K8ssandra uses Kubernetes’ persistent Volume Claims. Does that mean that 
the data is actually stored somewhere else and not in data directories of 
keyspaces?
  2.  Is there a way to look into the files in data directories of keyspaces to 
check what data is there. Maybe the data isn’t backed up properly.

The steps I did to copy the data are:
GKE cluster-> default-pool  -> found node running k8ssandra-dc1-default-sts-0 
container
Go to VM instances -> SSH to the node which is running 
k8ssandra-dc1-default-sts-0 container
Once SSHed, ran  “docker exec -it 
k8s_cassandra_k8ssandra-dc1-default-sts-0_default_00b0d72a-c124-4b04-b25d-9e0f17edc582_0
 /bin/bash”
I noticed that the container has Cassandra :
/opt/cassandra
./opt/cassandra/bin/cassandra
./opt/cassandra/javadoc/org/apache/cassandra
./var/lib/cassandra
./var/log/cassandra

cd opt/cassandra/data/data. There were directories for each keyspace. I assume 
that when taking backups we can take a copy of this data directory. Then once 
we need to restore, we can simply copy them back to new node’s data directory.

Note that I couldn’t run nodetool inside the container (nodetool flush or 
nodetool refresh) due to JMX issue. I don’t know how important it is to run the 
command. There is no traffic running on the systems though.

I copied data directory from OUTSIDE container (from the node) using “docker cp 
container name:src_path dest_path” (eg. docker cp 
k8s_cassandra_k8ssandra-dc1-default-sts-0_default_00b0d72a-c124-4b04-b25d-9e0f17edc582_0:/opt/cassandra/data/da

RE: unable to restore data from copied data directory

2021-01-02 Thread Manu Chadha
Thanks. Shall I copy only system-schema folder? I tried copying all the folders 
and could think of the following issues I encountered


  1.  C* didnt’ start because the Cluster name by default is Test Cluster while 
the tables seem to refer to K8ssandra cluster “Saved cluster name k8ssandra != 
configured name Test Cluster”
  2.  Then I got this error – “Cannot start node if snitch's data center 
(datacenter1) differs from previous data center (dc1). Please fix the snitch 
configuration, decommission and rebootstrap this node or use the flag 
-Dcassandra.ignore_dc=true.”
  3.  At one point I also got error about no. of tokens (cannot change the 
number of tokens from 257 to 256).

It seems it is not straightforward that I just copy the folders. Any advice 
please?

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Jeff Jirsa<mailto:jji...@gmail.com>
Sent: 02 January 2021 20:57
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: unable to restore data from copied data directory




On Jan 2, 2021, at 7:30 AM, Manu Chadha  wrote:

Hi

Can I just copy the keyspace folders into new cassandra installation s backup 
and restore strategy? I am trying to do that but it isn’t working.

I am using `K8ssandra` to run my single node C* cluster. I am experimenting 
with data backup and restore. Though K8ssandra uses medusa for data backup and 
restore, I could use it so I thought to test by simply copying/pasting the data 
directory. But I don’t see my data after restore. There could be mistakes in my 
approach so I am not really sure where to look. For example

  1.  K8ssandra uses Kubernetes’ persistent Volume Claims. Does that mean that 
the data is actually stored somewhere else and not in data directories of 
keyspaces?
  2.  Is there a way to look into the files in data directories of keyspaces to 
check what data is there. Maybe the data isn’t backed up properly.

The steps I did to copy the data are:
GKE cluster-> default-pool  -> found node running k8ssandra-dc1-default-sts-0 
container
Go to VM instances -> SSH to the node which is running 
k8ssandra-dc1-default-sts-0 container
Once SSHed, ran  “docker exec -it 
k8s_cassandra_k8ssandra-dc1-default-sts-0_default_00b0d72a-c124-4b04-b25d-9e0f17edc582_0
 /bin/bash”
I noticed that the container has Cassandra :
/opt/cassandra
./opt/cassandra/bin/cassandra
./opt/cassandra/javadoc/org/apache/cassandra
./var/lib/cassandra
./var/log/cassandra

cd opt/cassandra/data/data. There were directories for each keyspace. I assume 
that when taking backups we can take a copy of this data directory. Then once 
we need to restore, we can simply copy them back to new node’s data directory.

Note that I couldn’t run nodetool inside the container (nodetool flush or 
nodetool refresh) due to JMX issue. I don’t know how important it is to run the 
command. There is no traffic running on the systems though.

I copied data directory from OUTSIDE container (from the node) using “docker cp 
container name:src_path dest_path” (eg. docker cp 
k8s_cassandra_k8ssandra-dc1-default-sts-0_default_00b0d72a-c124-4b04-b25d-9e0f17edc582_0:/opt/cassandra/data/data
 backup/)

Then to transfer the backup directory to cloudshell (the console on web 
browser), I used “gcloud compute scp --recurse 
gke-k8ssandra-cluster-default-pool-1b1cc22a-rd6t:~/backup/data 
~/K8ssandra_data_backup”
Then I copied from cloudshell to my laptop/workstation, using cloudshell 
editor. This downloaded a tar of the backup (using a download link).

Then I downloaded a new .gz of C*3.11.6  on my laptop. After unzipping it, I 
noticed that it hasn’t got a data directory. I ran C* and noticed that only 
default keyspaces were present. I also noticed that data directory was now 
created. I then stopped C*.

Then I copied contents of backup folder (only keyspace name folders, not all 
folders) in data/data directory of a new Cassandra system which wasn’t running. 
Then I restarted the c* system but I can’t see the data via cqlsh. I can’t see 
the keyspace as well which probably is because I should probably copy system 
and system-* folders. But is it safe to do so? I tried it but landed into 
several issues around cluster name, snitch, data center names etc.

The schemas are stored in system_schema so until / unless you copy that it’s 
not gonna work.

Alternatively you can issue the DDL / CREATE statements on your laptop, it’ll 
make new directories, you can copy the data files into those directories. This 
is your safest and easiest option most of the time



Would the approach of just copy/pasting folder work ?

Thanks
Manu
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10




unable to restore data from copied data directory

2021-01-02 Thread Manu Chadha
Hi

Can I just copy the keyspace folders into new cassandra installation s backup 
and restore strategy? I am trying to do that but it isn’t working.

I am using `K8ssandra` to run my single node C* cluster. I am experimenting 
with data backup and restore. Though K8ssandra uses medusa for data backup and 
restore, I could use it so I thought to test by simply copying/pasting the data 
directory. But I don’t see my data after restore. There could be mistakes in my 
approach so I am not really sure where to look. For example

  1.  K8ssandra uses Kubernetes’ persistent Volume Claims. Does that mean that 
the data is actually stored somewhere else and not in data directories of 
keyspaces?
  2.  Is there a way to look into the files in data directories of keyspaces to 
check what data is there. Maybe the data isn’t backed up properly.

The steps I did to copy the data are:
GKE cluster-> default-pool  -> found node running k8ssandra-dc1-default-sts-0 
container
Go to VM instances -> SSH to the node which is running 
k8ssandra-dc1-default-sts-0 container
Once SSHed, ran  “docker exec -it 
k8s_cassandra_k8ssandra-dc1-default-sts-0_default_00b0d72a-c124-4b04-b25d-9e0f17edc582_0
 /bin/bash”
I noticed that the container has Cassandra :
/opt/cassandra
./opt/cassandra/bin/cassandra
./opt/cassandra/javadoc/org/apache/cassandra
./var/lib/cassandra
./var/log/cassandra

cd opt/cassandra/data/data. There were directories for each keyspace. I assume 
that when taking backups we can take a copy of this data directory. Then once 
we need to restore, we can simply copy them back to new node’s data directory.

Note that I couldn’t run nodetool inside the container (nodetool flush or 
nodetool refresh) due to JMX issue. I don’t know how important it is to run the 
command. There is no traffic running on the systems though.

I copied data directory from OUTSIDE container (from the node) using “docker cp 
container name:src_path dest_path” (eg. docker cp 
k8s_cassandra_k8ssandra-dc1-default-sts-0_default_00b0d72a-c124-4b04-b25d-9e0f17edc582_0:/opt/cassandra/data/data
 backup/)

Then to transfer the backup directory to cloudshell (the console on web 
browser), I used “gcloud compute scp --recurse 
gke-k8ssandra-cluster-default-pool-1b1cc22a-rd6t:~/backup/data 
~/K8ssandra_data_backup”
Then I copied from cloudshell to my laptop/workstation, using cloudshell 
editor. This downloaded a tar of the backup (using a download link).

Then I downloaded a new .gz of C*3.11.6  on my laptop. After unzipping it, I 
noticed that it hasn’t got a data directory. I ran C* and noticed that only 
default keyspaces were present. I also noticed that data directory was now 
created. I then stopped C*.

Then I copied contents of backup folder (only keyspace name folders, not all 
folders) in data/data directory of a new Cassandra system which wasn’t running. 
Then I restarted the c* system but I can’t see the data via cqlsh. I can’t see 
the keyspace as well which probably is because I should probably copy system 
and system-* folders. But is it safe to do so? I tried it but landed into 
several issues around cluster name, snitch, data center names etc.

Would the approach of just copy/pasting folder work ?

Thanks
Manu
Sent from Mail for Windows 10



Re: username/password error when using nodetool flush

2021-01-01 Thread Manu Chadha
Just nodetool doesn't work unfortunately

Sent from my iPhone

On 1 Jan 2021, at 21:28, Paul Chandler  wrote:

 Hi Manu,

nodetool uses the JMX user and password, I think the normal default for that is 
for it not being required, but not sure if that is the case for the setup you 
are using. So just try nodetool flush and see if that works.

Regards

Paul

Sent from my iPhone

On 1 Jan 2021, at 20:41, Manu Chadha  wrote:


In fact, I notice that I can’t run any nodetool command. I get the error even 
when running nodetool status command

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Manu Chadha<mailto:manu.cha...@hotmail.com>
Sent: 01 January 2021 20:36
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: username/password error when using nodetool flush

Hi

Happy New Year.

I am trying to use `nodetool flush -u username` but I get error `nodetool: 
Failed to connect to '127.0.0.1:7199' - FailedLoginException: 'Invalid username 
or password'.`

I am using the same credentials which I use in `cqlsh -u -p`.  As far as I can 
observe, I am using the right values.

I am running `cassandra` using `kubernetes` and `K8ssandra`. I have `SSH`ed  to 
a node and am running `nodetool flush` in the container by getting a shell in 
the container using ` docker exec -it 
k8s_cassandra_k8ssandra-dc1-default-sts-0_default_00b0d72a-c124-4b04-b25d-9e0f17edc582_0
 /bin/bash `.

What mistake I might be making? Is there some other credential I need to use?

Thanks
Manu

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10




RE: username/password error when using nodetool flush

2021-01-01 Thread Manu Chadha
In fact, I notice that I can’t run any nodetool command. I get the error even 
when running nodetool status command

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Manu Chadha<mailto:manu.cha...@hotmail.com>
Sent: 01 January 2021 20:36
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: username/password error when using nodetool flush

Hi

Happy New Year.

I am trying to use `nodetool flush -u username` but I get error `nodetool: 
Failed to connect to '127.0.0.1:7199' - FailedLoginException: 'Invalid username 
or password'.`

I am using the same credentials which I use in `cqlsh -u -p`.  As far as I can 
observe, I am using the right values.

I am running `cassandra` using `kubernetes` and `K8ssandra`. I have `SSH`ed  to 
a node and am running `nodetool flush` in the container by getting a shell in 
the container using ` docker exec -it 
k8s_cassandra_k8ssandra-dc1-default-sts-0_default_00b0d72a-c124-4b04-b25d-9e0f17edc582_0
 /bin/bash `.

What mistake I might be making? Is there some other credential I need to use?

Thanks
Manu

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10




username/password error when using nodetool flush

2021-01-01 Thread Manu Chadha
Hi

Happy New Year.

I am trying to use `nodetool flush -u username` but I get error `nodetool: 
Failed to connect to '127.0.0.1:7199' - FailedLoginException: 'Invalid username 
or password'.`

I am using the same credentials which I use in `cqlsh -u -p`.  As far as I can 
observe, I am using the right values.

I am running `cassandra` using `kubernetes` and `K8ssandra`. I have `SSH`ed  to 
a node and am running `nodetool flush` in the container by getting a shell in 
the container using ` docker exec -it 
k8s_cassandra_k8ssandra-dc1-default-sts-0_default_00b0d72a-c124-4b04-b25d-9e0f17edc582_0
 /bin/bash `.

What mistake I might be making? Is there some other credential I need to use?

Thanks
Manu

Sent from Mail for Windows 10



Why the default value for reclaimPolicy is Delete and not Retain

2020-12-19 Thread Manu Chadha
Hi

In cass-operator, the storage.yaml has reclaim policy Delete. Should it be 
Retain by default to avoid accidental deletion of data?

thanks


Sent from Mail for Windows 10



RE: add javaagent MCAC (metric collector for apache cassandra) using cass-operator

2020-12-19 Thread Manu Chadha
Just checked that JVM options could be added in 
example-cassdc-minimal.yaml<https://github.com/datastax/cass-operator/blob/master/operator/example-cassdc-yaml/cassandra-3.11.x/example-cassdc-minimal.yaml>
 
(https://github.com/datastax/cass-operator/blob/master/operator/example-cassdc-yaml/cassandra-3.11.x/example-cassdc-minimal.yaml).


It seems I could add something like 
“-javaagent:${MCAC_ROOT}/lib/datastax-mcac-agent.jar", but I’ll still have to 
explicitly download MCAC jar on each node. Is that how it is suppose to be done?



If I have to go to each node to download the tar then I could just manually 
change cassandra-env.sh on each node and restart C*. I wouldn’t need to add the 
entry in example-cassdc* in that case.



What is the recommended way to add monitoring support in C* in production using 
cass-operator?


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Manu Chadha<mailto:manu.cha...@hotmail.com>
Sent: 19 December 2020 09:31
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: add javaagent MCAC (metric collector for apache cassandra) using 
cass-operator

I am using cass-operator (https://github.com/datastax/cass-operator)

I want to add MCAC javaagent in my production system to monitor metrics 
(https://github.com/datastax/metric-collector-for-apache-cassandra).

How can I do it? The general way is to add the agent information is to change 
`cassandra-env.sh`. As cass-operator controls downloading the version and 
installation, how do I make the operator change caassandra-env.sh?



Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10




add javaagent MCAC (metric collector for apache cassandra) using cass-operator

2020-12-19 Thread Manu Chadha
I am using cass-operator (https://github.com/datastax/cass-operator)

I want to add MCAC javaagent in my production system to monitor metrics 
(https://github.com/datastax/metric-collector-for-apache-cassandra).

How can I do it? The general way is to add the agent information is to change 
`cassandra-env.sh`. As cass-operator controls downloading the version and 
installation, how do I make the operator change caassandra-env.sh?



Sent from Mail for Windows 10



Use NetworkTopologyStrategy for single data center and add data centers later

2020-12-19 Thread Manu Chadha
Is it possible to use NetworkTopologyStrategy when creating a keyspace and add 
data centers later?

I am just starting with an MVP application and I don't expect much traffic or 
data. Thus I have created only one data center. However, I'll like to add more 
data centers later if needed

I notice that the replication factor for each data center needs to be specified 
at the time of keyspace creation

CREATE KEYSPACE "Excalibur"

  WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'dc1' : 3, 'dc2' : 
2};

As I only have dc1 at the moment, could I just do

CREATE KEYSPACE "Excalibur"

  WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'dc1' : 3};

and when I have another datacenter say dc2, could I edit the Excalibur keyspace?

ALTER KEYSPACE "Excalibur"

  WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'dc2' : 2};



or can I start with SimpleStrategy now and change to NetworkTopologyStrategy 
later? I suspect this might not work as I think this needs changing snitch etc.


Sent from Mail for Windows 10



RE: Cassandra monitoring

2020-12-18 Thread Manu Chadha
Just to try my luck, I added MCAC jar in cassandra.bat in bin directory

set JAVA_OPTS=-ea^
-javaagent:"%CASSANDRA_HOME%\lib\jamm-0.3.0.jar"^
-javaagent:"%CASSANDRA_HOME%\datastax-mcac-agent-0.1.13\lib\datastax-mcac-agent.jar"^
 <-HERE
-Xms2G^
-Xmx2G^
-XX:+HeapDumpOnOutOfMemoryError^
-XX:+UseParNewGC^
-XX:+UseConcMarkSweepGC^
-XX:+CMSParallelRemarkEnabled^
-XX:SurvivorRatio=8^
-XX:MaxTenuringThreshold=1^
-XX:CMSInitiatingOccupancyFraction=75^
-XX:+UseCMSInitiatingOccupancyOnly^
-Dlogback.configurationFile=logback.xml^
-Djava.library.path="%CASSANDRA_HOME%\lib\sigar-bin"^
-Dcassandra.jmx.local.port=7199

But this is now giving error

java.lang.RuntimeException: Cannot locate 
file:\\C:\Users\manuc\Documents\manu\apache-cassandra-3.11.6-for-scalardb\datastax-mcac-agent-0.1.13/config/metric-collector.yaml.

Note the change in path separator from backslash to frontslash at the end.

To be honest, still clueless on how to get metrics on my windows machine.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Manu Chadha<mailto:manu.cha...@hotmail.com>
Sent: 18 December 2020 10:04
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: RE: Cassandra monitoring

Thanks. I tried it but I still don’t see anything on http://localhost:9103/.

My suspicion is that I am not putting the jars or am not setting the JVM_OPTS 
correctly or maybe the path is not being picked correctly considering that I am 
on windows machine and .sh is basically a unix script. I have tried three 
exporters and they all seem to have issues (except for Cassandra exporter 
standalone which works fine - https://github.com/criteo/cassandra_exporter).

So I am getting more certain that I am not putting javaagent correctly.

I downloaded the jar from 
https://github.com/datastax/metric-collector-for-apache-cassandra/releases/tag/v0.1.13
Then unzipped it

I added path like this

MCAC_ROOT="C:\\Users\\manuc\\Documents\\manu\\datastax-mcac-agent-0.1.13"
JVM_OPTS="$JVM_OPTS -javaagent:${MCAC_ROOT}\\lib\\datastax-mcac-agent.jar"

And then restarted Cassandra but no love ☹

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Ahmed Eljami<mailto:ahmed.elj...@gmail.com>
Sent: 18 December 2020 09:21
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: Cassandra monitoring

Hi,

I suggest you try MCAC for DataStax, available here => 
https://github.com/datastax/metric-collector-for-apache-cassandra

Cheers,

Le ven. 18 déc. 2020 à 10:01, Manu Chadha 
mailto:manu.cha...@hotmail.com>> a écrit :
Sorry, clicked send too soon.

I am trying to use Prometheus and followed this tutorial  - 
https://www.robustperception.io/monitoring-cassandra-with-prometheus

I thought I’ll test it on my Windows laptop first but I can’t connect with 
using localhost:7199.


As I am on Windows, instead of echo 'JVM_OPTS="$JVM_OPTS 
-javaagent:'$PWD/jmx_prometheus_javaagent-0.3.0.jar=7070:$PWD/cassandra.yml'"' 
>> conf/cassandra-env.sh, I have added the following line in the 
cassandra-env.ps1 (I don’t know to be honest if I should have)

# Default JMX setup, bound to local loopback address only

$env:JVM_OPTS="$env:JVM_OPTS -Dcassandra.jmx.local.port=$JMX_PORT"

$env:JVM_OPTS="$env:JVM_OPTS 
-javaagent:'$PWD/jmx_prometheus_javaagent-0.3.0.jar=7070:$PWD/cassandra.yml'"' 
<-- HERE



$env:JVM_OPTS="$env:JVM_OPTS $env:JVM_EXTRA_OPTS"

}



but http://localhost:7070/metrics doesn't work

I have also tried to do the original change in cassandar.yaml i.e. 
JVM_OPTS="$JVM_OPTS 
-javaagent:'$PWD/jmx_prometheus_javaagent-0.3.0.jar=7070:$PWD/cassandra.yml

But I still can’t access the metrics.

Any help or other suggestions about monitoring would be welcome.

Thanks
Manu

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Manu Chadha<mailto:manu.cha...@hotmail.com>
Sent: 18 December 2020 08:57
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Cassandra monitoring

Hi

Could the group please suggest options for monitoring Cassandra in production 
(GCP)?

I am trying to use Prometheus and followed this tutorial  - 
https://www.robustperception.io/monitoring-cassandra-with-prometheus

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10




--
Cordialement;
Ahmed ELJAMI




RE: Cassandra monitoring

2020-12-18 Thread Manu Chadha
Thanks. I tried it but I still don’t see anything on http://localhost:9103/.

My suspicion is that I am not putting the jars or am not setting the JVM_OPTS 
correctly or maybe the path is not being picked correctly considering that I am 
on windows machine and .sh is basically a unix script. I have tried three 
exporters and they all seem to have issues (except for Cassandra exporter 
standalone which works fine - https://github.com/criteo/cassandra_exporter).

So I am getting more certain that I am not putting javaagent correctly.

I downloaded the jar from 
https://github.com/datastax/metric-collector-for-apache-cassandra/releases/tag/v0.1.13
Then unzipped it

I added path like this

MCAC_ROOT="C:\\Users\\manuc\\Documents\\manu\\datastax-mcac-agent-0.1.13"
JVM_OPTS="$JVM_OPTS -javaagent:${MCAC_ROOT}\\lib\\datastax-mcac-agent.jar"

And then restarted Cassandra but no love ☹

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Ahmed Eljami<mailto:ahmed.elj...@gmail.com>
Sent: 18 December 2020 09:21
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: Cassandra monitoring

Hi,

I suggest you try MCAC for DataStax, available here => 
https://github.com/datastax/metric-collector-for-apache-cassandra

Cheers,

Le ven. 18 déc. 2020 à 10:01, Manu Chadha 
mailto:manu.cha...@hotmail.com>> a écrit :
Sorry, clicked send too soon.

I am trying to use Prometheus and followed this tutorial  - 
https://www.robustperception.io/monitoring-cassandra-with-prometheus

I thought I’ll test it on my Windows laptop first but I can’t connect with 
using localhost:7199.


As I am on Windows, instead of echo 'JVM_OPTS="$JVM_OPTS 
-javaagent:'$PWD/jmx_prometheus_javaagent-0.3.0.jar=7070:$PWD/cassandra.yml'"' 
>> conf/cassandra-env.sh, I have added the following line in the 
cassandra-env.ps1 (I don’t know to be honest if I should have)

# Default JMX setup, bound to local loopback address only

$env:JVM_OPTS="$env:JVM_OPTS -Dcassandra.jmx.local.port=$JMX_PORT"

$env:JVM_OPTS="$env:JVM_OPTS 
-javaagent:'$PWD/jmx_prometheus_javaagent-0.3.0.jar=7070:$PWD/cassandra.yml'"' 
<-- HERE



$env:JVM_OPTS="$env:JVM_OPTS $env:JVM_EXTRA_OPTS"

}



but http://localhost:7070/metrics doesn't work

I have also tried to do the original change in cassandar.yaml i.e. 
JVM_OPTS="$JVM_OPTS 
-javaagent:'$PWD/jmx_prometheus_javaagent-0.3.0.jar=7070:$PWD/cassandra.yml

But I still can’t access the metrics.

Any help or other suggestions about monitoring would be welcome.

Thanks
Manu

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Manu Chadha<mailto:manu.cha...@hotmail.com>
Sent: 18 December 2020 08:57
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Cassandra monitoring

Hi

Could the group please suggest options for monitoring Cassandra in production 
(GCP)?

I am trying to use Prometheus and followed this tutorial  - 
https://www.robustperception.io/monitoring-cassandra-with-prometheus

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10




--
Cordialement;
Ahmed ELJAMI



RE: Cassandra monitoring

2020-12-18 Thread Manu Chadha
Sorry, clicked send too soon.

I am trying to use Prometheus and followed this tutorial  - 
https://www.robustperception.io/monitoring-cassandra-with-prometheus

I thought I’ll test it on my Windows laptop first but I can’t connect with 
using localhost:7199.


As I am on Windows, instead of echo 'JVM_OPTS="$JVM_OPTS 
-javaagent:'$PWD/jmx_prometheus_javaagent-0.3.0.jar=7070:$PWD/cassandra.yml'"' 
>> conf/cassandra-env.sh, I have added the following line in the 
cassandra-env.ps1 (I don’t know to be honest if I should have)

# Default JMX setup, bound to local loopback address only

$env:JVM_OPTS="$env:JVM_OPTS -Dcassandra.jmx.local.port=$JMX_PORT"

$env:JVM_OPTS="$env:JVM_OPTS 
-javaagent:'$PWD/jmx_prometheus_javaagent-0.3.0.jar=7070:$PWD/cassandra.yml'"' 
<-- HERE



$env:JVM_OPTS="$env:JVM_OPTS $env:JVM_EXTRA_OPTS"

}



but http://localhost:7070/metrics doesn't work

I have also tried to do the original change in cassandar.yaml i.e. 
JVM_OPTS="$JVM_OPTS 
-javaagent:'$PWD/jmx_prometheus_javaagent-0.3.0.jar=7070:$PWD/cassandra.yml

But I still can’t access the metrics.

Any help or other suggestions about monitoring would be welcome.

Thanks
Manu

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Manu Chadha<mailto:manu.cha...@hotmail.com>
Sent: 18 December 2020 08:57
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Cassandra monitoring

Hi

Could the group please suggest options for monitoring Cassandra in production 
(GCP)?

I am trying to use Prometheus and followed this tutorial  - 
https://www.robustperception.io/monitoring-cassandra-with-prometheus

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10




Cassandra monitoring

2020-12-18 Thread Manu Chadha
Hi

Could the group please suggest options for monitoring Cassandra in production 
(GCP)?

I am trying to use Prometheus and followed this tutorial  - 
https://www.robustperception.io/monitoring-cassandra-with-prometheus

Sent from Mail for Windows 10



Cassandra and GCP

2020-12-17 Thread Manu Chadha
Hi

I am moving my MVP application to GCP. It is a general web application with 
standard database workload (CRUD). I am not expecting much traffic to begin 
with.

I don’t have any experience in putting applications in production. Would it be 
possible to change the machine configuration later (CPUs, disk size) for 
Cassandra when the traffic load increases? Would I have to stop the application 
completely when I am upgrading or would I be able to do rolling upgrade?

Any tips on how to approach upgrade later would be most appreciated.

Thanks
Manu


Sent from Mail for Windows 10



ScalarDB

2020-12-10 Thread Manu Chadha
Hi

Has anyone in the group used ScalarDB which adds ACID functionality to 
Cassandra? I am facing couple of issues (which actually might be how ScalarDB 
is suppose to work). I need advice on how to solve the issues

I have created the issues in `SO`


  1.  
https://stackoverflow.com/questions/65226546/how-to-serialise-requests-in-cassandra-using-scalardb
  2.  
https://stackoverflow.com/questions/65225306/what-should-be-the-values-of-tx-fields-if-a-row-is-entered-from-cqlsh-instead-fr

I was able to solve (1) by adding dummy entries for missing fields. It seem to 
work but I am not sure if this is safe.

On (2), the issue seems to related to how ScalarDB works (I could be wrong). 
Say two transactions read the same value from a table and one commits (new 
value) before the other. The other one fails as it notices that its read is 
stale now. While this seems logical, isn’t it a common scenario which might 
happen very frequently in high traffic applications? What is the way to solve 
the problem?

regards
Manu

Sent from Mail for Windows 10



RE: Enable Ttracing

2020-11-30 Thread Manu Chadha
Hi Mick

I just took a cursory look at the presentation and Zipkin.io. Would using 
Zipkin degrade performance? Would it be considerable?

Regards
Manu

Sent from Mail for Windows 10

From: Mick Semb Wever
Sent: 29 November 2020 14:50
To: user@cassandra.apache.org
Subject: Re: Enable Ttracing


I have a feeling that this tool will give me hell. 
I'll just have to wait till they implement it and monitor the clusters, but at 
least I know what to expect.


The tracing implementation is pluggable in 3.11.

For example you can push traces into Zipkin (and a separate C* cluster) using
 https://github.com/thelastpickle/cassandra-zipkin-tracing

Full sampling is possible this way.





Cassandra and Vertica

2020-11-15 Thread Manu Chadha
Has anyone here used Vertica? Out of curiosity, are Cassandra and Vertica 
databases similar? I recently spent time reading about Vertica. It has features 
like columnar data structures called projections which optimise query 
execution. It also has no single point of failure. But it comes out as an RDBMS 
database which supports join. The fact that in Cassandra as well a table is 
created to serve a query, it made me wonder if/how Cassandra and Vertica are 
similar and different?

Sent from Mail for Windows 10



RE: Cassandra in a container - what to do (sequence of events) to snapshot the storage volume?

2020-11-12 Thread Manu Chadha
Hi Jeff

By “dropping” the periodic time, do you mean making it 0 or commenting commit 
log or changing commit log to batch? Referring to the comments in 
Cassandra.yaml, if I use commitlog_sync as batch with 2ms window, does it mean 
that when a write is done on the db, then it is immediately flushed to disk so 
when a snapshot would be taken the disk should have all the data except for any 
new writes which might come within the 2 ms window? I suppose that DB would be 
much slower now compared to 10s periodic window.

# commitlog_sync may be either "periodic" or "batch."
#
# When in batch mode, Cassandra won't ack writes until the commit log
# has been fsynced to disk.  It will wait
# commitlog_sync_batch_window_in_ms milliseconds between fsyncs.
# This window should be kept short because the writer threads will
# be unable to do extra work while waiting.  (You may need to increase
# concurrent_writes for the same reason.)
#
commitlog_sync: batch
commitlog_sync_batch_window_in_ms: 2

thanks
Sent from Mail for Windows 10

From: Jeff Jirsa
Sent: 11 November 2020 00:24
To: cassandra
Subject: Re: Cassandra in a container - what to do (sequence of events) to 
snapshot the storage volume?

The commitlog defaults to periodic mode, which writes a sync marker to the file 
and fsync's the data to disk every 10s by default.

`nodetool flush` will force a sync marker / fsync

Data written since the last fsync will not be replayed on startup and will be 
lost.

If you drop the periodic time, the number of writes you lose on restart 
decreases.

Alternatively, you can switch to group/batch commitlog, and it goes to zero, 
but you'll fsync far more frequently.



On Tue, Nov 10, 2020 at 4:19 PM Florin Andrei 
mailto:flo...@andrei.myip.org>> wrote:
That sounds great! Now here's my question:

I do "nodetool flush", then snapshot the storage. Meanwhile, the DB is
under heavy read/write traffic, with lots of writes per second. What's
the worst that could happen, lose a few writes?


On 2020-11-10 15:59, Jeff Jirsa wrote:
> If you want all of the instances to be consistent with each other,
> this is much harder, but if you only want a container that can stop
> and resume, you don't have to do anything more than flush + snapshot
> the storage. The data files on cassandra should ALWAYS be in a state
> where the database will restart, because they have to be to tolerate
> power outage.
>
> On Tue, Nov 10, 2020 at 3:39 PM Florin Andrei 
> mailto:flo...@andrei.myip.org>>
> wrote:
>
>> Running Apache Cassandra 3 in Docker. I need to snapshot the storage
>>
>> volumes. Obviously, I want to be able to re-launch Cassandra from
>> the
>> snapshots later on. So the snapshots need to be in a consistent
>> state.
>>
>> With most DBs, the sequence of events is this:
>>
>> - flush the DB to disk
>> - "freeze" the DB
>> - snapshot the storage
>> - "unfreeze" the DB
>>
>> What does that sequence translate to, in Cassandra parlance?
>>
>> What is the sequence of events that needs to happen when I bring the
>> DB
>> up from an old snapshot? Will there be a restore procedure, or can I
>>
>> just start it as usual?
>>
>> --
>> Florin Andrei
>> https://florin.myip.org/
>>
>>
> -
>> To unsubscribe, e-mail: 
>> user-unsubscr...@cassandra.apache.org
>> For additional commands, e-mail: 
>> user-h...@cassandra.apache.org

--
Florin Andrei
https://florin.myip.org/

-
To unsubscribe, e-mail: 
user-unsubscr...@cassandra.apache.org
For additional commands, e-mail: 
user-h...@cassandra.apache.org



RE: migrating driver from 3.4 to 4.9

2020-10-27 Thread Manu Chadha
Thanks Johnny

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Johnny Miller<mailto:joh...@digitalis.io>
Sent: 27 October 2020 08:37
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: migrating driver from 3.4 to 4.9

Manu - one thing to make sure your aware of is with the latest driver version 
(4.9) it’s not just about binary compatibility.

There has been a removal of certain core features from the driver which if you 
are using you may find you’ve more work todo then you expected.

The ability to route requests to your non-local DC via driver retry policies 
doesn’t seem to be there anymore. Also changing your choice of consistency on 
driver retries is also gone (not necessarily a bad thing). It’s not possible to 
implement your own retry policy to replicate this as the driver api seems to 
have completely removed the hookins to do this within the driver retry 
mechanism.

The docs say this should be done at the app level and is not the drivers 
responsibility now. However replicating this functionality at the app level is 
not trivial particular when leveraging asynchronous calls and (depending on 
your testing guidelines) probably warrants a lot of testing on the app itself. 
Have a look at resiliance4j retry component if you need to go down that route - 
it’s pretty handy.

Regards,

Johnny


On Tue, 27 Oct 2020 at 08:14, Manu Chadha 
mailto:manu.cha...@hotmail.com>> wrote:
Thanks Erick. I agree that I should considering moving to latest version.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Erick Ramirez<mailto:erick.rami...@datastax.com>
Sent: 26 October 2020 22:55
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: migrating driver from 3.4 to 4.9

Yes, Java driver 4 is not binary-compatible with older versions. Our 
recommendation is that you upgrade to the latest version instead of re-coding 
your app for an older version. If you run into issues with the older version, 
you will have to upgrade anyway to get the fix. Java driver v3.4 was released 
in January 2018 so it's very old.

See the upgrade guide here -- 
https://docs.datastax.com/en/developer/java-driver/4.9/. Cheers!

--
Sent from my iPhone, apologies for any typos



--

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. WARNING: Computer viruses can be transmitted via email. The 
recipient should check this email and any attachments for the presence of 
viruses. The company accepts no liability for any damage caused by any virus 
transmitted by this email. www.digitalis.io<http://www.digitalis.io>



RE: migrating driver from 3.4 to 4.9

2020-10-27 Thread Manu Chadha
Thanks Erick. I agree that I should considering moving to latest version.

Sent from Mail for Windows 10

From: Erick Ramirez
Sent: 26 October 2020 22:55
To: user@cassandra.apache.org
Subject: Re: migrating driver from 3.4 to 4.9

Yes, Java driver 4 is not binary-compatible with older versions. Our 
recommendation is that you upgrade to the latest version instead of re-coding 
your app for an older version. If you run into issues with the older version, 
you will have to upgrade anyway to get the fix. Java driver v3.4 was released 
in January 2018 so it's very old.

See the upgrade guide here -- 
https://docs.datastax.com/en/developer/java-driver/4.9/. Cheers!



RE: reverse paging state

2020-10-26 Thread Manu Chadha
Hi Alex

If I implement pagination as suggested by your answer in 
https://stackoverflow.com/questions/50168236/cassandra-pagination-inside-partition/50172052#50172052,
 would I be able to mix the `doable` approach and standard pagination approach? 
For eg.

Say I have 5 records belonging to the same partition, divided by clustering 
columns

  *   P1,c1
  *   P1,c2
  *   P1,c3
  *   P1,c4
  *   P1,c5

The fetch size is 1 so 1 record is returned per query. Initially, I get P1,c1 
(without using pagination state) (Page1)


session.execute(whereClause




  .setFetchSize(fetchSize)) //get one row from ResultSet. Cassandra might 
return more or less though

I get the pagingstate and pass it to the client which then returns it so taht I 
can get page2



newPagingState:PagingState = resultSet.getExecutionInfo.getPagingState

and then I get P1,c2 using pagination state of P1,c1 (Page2).



session.execute(whereClause




.setFetchSize(1) //TODOM - configure fetch size in config file.




.setPagingState(pagingState)) //get one row from ResultSet. Cassandra might 
return more or less though




}

Now I want to go back to Page1 (P1,c1), so I’ll execute query specifying 
clustering_key >=c1 and fetch size of 1. I suppose I’ll create s Simple 
Statement in Java Driver like



Statement stmt = new SimpleStatement(

  "SELECT * FROM ... where c1 >= some value")



Then I’ll execute the statement

resultSet = session.execute(stmt)




.setFetchSize(1)




}



Could I now get the pagestate of this resultSet and use it to go to page 2



newPagingState:PagingState = resultSet.getExecutionInfo.getPagingState //get 
paging state from result of SELECT * FROM ... where c1 >= some value and pass 
it to client



and when the client returns it, I use it to go to Page 2

session.execute(whereClause




.setFetchSize(1) //TODOM - configure fetch size in config file.




.setPagingState(pagingState)) //get one row from ResultSet. Cassandra might 
return more or less though




}

My reason to ask is that I have read “Note that the paging state can only be 
reused with the exact same statement (same query string, same parameters).” In 
my case, are the query strings are different? To get next/forward records, I 
use whereClause:Where but to go backwards records I use SimpleStatement. So I 
don’t know if I can use the PagingState like the way I have mentioned above.



Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Alex Ott<mailto:alex...@gmail.com>
Sent: 23 October 2020 09:25
To: user<mailto:user@cassandra.apache.org>
Subject: Re: reverse paging state

Hi

for that version of the driver there is no build-in functionality for the 
backward paging, although it's doable: 
https://stackoverflow.com/questions/50168236/cassandra-pagination-inside-partition/50172052#50172052

for driver 4.9.0 there is a wrapper class that emultates random paging, with 
tradeoff for performance: 
https://docs.datastax.com/en/developer/java-driver/4.9/manual/core/paging/#offset-queries

On Fri, Oct 23, 2020 at 10:00 AM Manu Chadha 
mailto:manu.cha...@hotmail.com>> wrote:
In Java driver 3.4.0, how does one revert the order of paging? I want to 
implement a “Back” button but I can’t figure out from the API docs if/how I can 
make Cassandra (via the Java driver) search backwards.

https://docs.datastax.com/en/drivers/java/3.4/

The code I have written currently is


session.execute(whereClause
  .setFetchSize(fetchSize)

  .setPagingState(pagingState))


Thanks
Manu
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10



--
With best wishes,Alex Ott
http://alexott.net/
Twitter: alexott_en (English), alexott (Russian)



migrating driver from 3.4 to 4.9

2020-10-26 Thread Manu Chadha
I am considering migration my application Cassandra Java driver from 3.4 to 
4.9. Are there breaking changes between 3.4 and 4.9 (I expect so to be honest 
but I want to get a feel of how much effort there might be).

I want to implement backward paging feature in my application. I can either 
implement it in the application like Alex Ott mentioned in the Stack Overflow 
link  or I could migrate to 4.9. I am wondering which would be relatively 
easier.

https://stackoverflow.com/questions/50168236/cassandra-pagination-inside-partition/50172052?noredirect=1#comment114079439_50172052

My application doesn’t need random page navigation. It would be linear (1 page 
either ways) so I suppose the performance impact would be negligible.

thanks

Sent from Mail for Windows 10



reverse paging state

2020-10-23 Thread Manu Chadha
In Java driver 3.4.0, how does one revert the order of paging? I want to 
implement a “Back” button but I can’t figure out from the API docs if/how I can 
make Cassandra (via the Java driver) search backwards.

https://docs.datastax.com/en/drivers/java/3.4/

The code I have written currently is


session.execute(whereClause
  .setFetchSize(fetchSize)

  .setPagingState(pagingState))


Thanks
Manu
Sent from Mail for Windows 10



Re: backup data with Cass-operator and Medusa

2020-10-09 Thread Manu Chadha
Thanks John.
On 9 Oct 2020, at 19:41, John Sanda 
mailto:john.sa...@gmail.com>> wrote:

Hi Manu

I have started doing the preliminary work. I have a PR[1] for Medusa that needs 
to be reviewed/merged. I have done some work[2] for initial, low-level 
integration directly against statefulsets. I hope to have medusa integration 
land within the next couple releases of cass-operator.

[1] https://github.com/thelastpickle/cassandra-medusa/pull/141
[2] https://github.com/thelastpickle/medusa-operator

Cheers

John

On Fri, Oct 9, 2020 at 12:04 PM Manu Chadha 
mailto:manu.cha...@hotmail.com>> wrote:
Hi

By when the Medusa integration for backing up C* using Cass-Operator would be 
available? Found this discussion - 
https://community.datastax.com/questions/6364/triggering-consistent-backups.html

Would this be the recommended way? Till the time it becomes available what 
other options could I consider?

Thanks
Manu

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10



--

- John


backup data with Cass-operator and Medusa

2020-10-09 Thread Manu Chadha
Hi

By when the Medusa integration for backing up C* using Cass-Operator would be 
available? Found this discussion - 
https://community.datastax.com/questions/6364/triggering-consistent-backups.html

Would this be the recommended way? Till the time it becomes available what 
other options could I consider?

Thanks
Manu

Sent from Mail for Windows 10



RE: Reducing no. of nodes to 0 without losing data

2020-10-08 Thread Manu Chadha
Tried persistence as well (just table schemas, no data). It works as well 
across restarts. Next challenge for me is to find out how to backup the data in 
case there is a cluster wide data loss.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Manu Chadha<mailto:manu.cha...@hotmail.com>
Sent: 08 October 2020 13:33
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: RE: Reducing no. of nodes to 0 without losing data

Dear Christopher

I tried the answer and it works (at least the stopping bit). I still need to 
test persistence bit which to be honest might take time considering that I am 
more rubbish in K8S than Cassandra.  I had created an question on SO. Please 
feel free to provide your answer there.

https://stackoverflow.com/questions/64253051/temporarily-stopping-k8s-and-cassandra-cluster?noredirect=1#comment113633984_64253051

thanks
Manu

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Christopher Bradford<mailto:bradfor...@gmail.com>
Sent: 08 October 2020 05:47
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: Reducing no. of nodes to 0 without losing data

cass-operator has a parameter spec.stopped (
https://github.com/datastax/cass-operator/blob/master/operator/example-cassdc-yaml/cassandra-3.11.x/example-cassdc-full.yaml#L65)
 when set to true the underlying stateful sets are scaled down to 0 while 
keeping the persistent volumes. This allows you to reduce your k8s cluster size 
while not losing data. When you want to bring the cluster back up change the 
parameter back to false.

On Thu, Oct 8, 2020 at 12:40 AM Oleksandr Shulgin 
mailto:oleksandr.shul...@zalando.de>> wrote:
On Thu, Oct 8, 2020 at 12:21 AM Manu Chadha 
mailto:manu.cha...@hotmail.com>> wrote:
Hi

I have created a Cassandra cluster on Kubernetes using cass-operator on gcp. It 
is for my personal experimentation. To avoid incurring cost, I want to stop the 
cluster when I am not using it and start it when I need it without losing data. 
Is there a way to do so? Would setting number of size to 0 in 
example-cassdc-minimal.yaml stop the compute resources without losing data? If 
I change the size to 3 again later, would the existing data be picked?

Depending if the operator is going to accept the size as 0 at all, but most 
probably not with the following policy in your storage class, as in the 
example[1]:

reclaimPolicy: Delete

You need some persistent storage and a suitable reclaim policy.

[1]: 
https://docs.datastax.com/en/cass-operator/doc/cass-operator/cassOperatorCloserLookConfiguration.html#CreateandapplyaStorageClass

Regards,
--
Alex
--

Christopher Bradford





RE: Reducing no. of nodes to 0 without losing data

2020-10-08 Thread Manu Chadha
Dear Christopher

I tried the answer and it works (at least the stopping bit). I still need to 
test persistence bit which to be honest might take time considering that I am 
more rubbish in K8S than Cassandra.  I had created an question on SO. Please 
feel free to provide your answer there.

https://stackoverflow.com/questions/64253051/temporarily-stopping-k8s-and-cassandra-cluster?noredirect=1#comment113633984_64253051

thanks
Manu

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Christopher Bradford<mailto:bradfor...@gmail.com>
Sent: 08 October 2020 05:47
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: Reducing no. of nodes to 0 without losing data

cass-operator has a parameter spec.stopped (
https://github.com/datastax/cass-operator/blob/master/operator/example-cassdc-yaml/cassandra-3.11.x/example-cassdc-full.yaml#L65)
 when set to true the underlying stateful sets are scaled down to 0 while 
keeping the persistent volumes. This allows you to reduce your k8s cluster size 
while not losing data. When you want to bring the cluster back up change the 
parameter back to false.

On Thu, Oct 8, 2020 at 12:40 AM Oleksandr Shulgin 
mailto:oleksandr.shul...@zalando.de>> wrote:
On Thu, Oct 8, 2020 at 12:21 AM Manu Chadha 
mailto:manu.cha...@hotmail.com>> wrote:
Hi

I have created a Cassandra cluster on Kubernetes using cass-operator on gcp. It 
is for my personal experimentation. To avoid incurring cost, I want to stop the 
cluster when I am not using it and start it when I need it without losing data. 
Is there a way to do so? Would setting number of size to 0 in 
example-cassdc-minimal.yaml stop the compute resources without losing data? If 
I change the size to 3 again later, would the existing data be picked?

Depending if the operator is going to accept the size as 0 at all, but most 
probably not with the following policy in your storage class, as in the 
example[1]:

reclaimPolicy: Delete

You need some persistent storage and a suitable reclaim policy.

[1]: 
https://docs.datastax.com/en/cass-operator/doc/cass-operator/cassOperatorCloserLookConfiguration.html#CreateandapplyaStorageClass

Regards,
--
Alex
--

Christopher Bradford




RE: Reducing no. of nodes to 0 without losing data

2020-10-08 Thread Manu Chadha
The operator doesn’t accept 0. Changing the size in 
example-cass-dc-minimal.yaml doesn't work as I get error `The 
CassandraDatacenter "dc1" is invalid: spec.size: Invalid value: 1: spec.size in 
body should be greater than or equal to 1`

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Oleksandr Shulgin<mailto:oleksandr.shul...@zalando.de>
Sent: 08 October 2020 05:40
To: User<mailto:user@cassandra.apache.org>
Subject: Re: Reducing no. of nodes to 0 without losing data

On Thu, Oct 8, 2020 at 12:21 AM Manu Chadha 
mailto:manu.cha...@hotmail.com>> wrote:
Hi

I have created a Cassandra cluster on Kubernetes using cass-operator on gcp. It 
is for my personal experimentation. To avoid incurring cost, I want to stop the 
cluster when I am not using it and start it when I need it without losing data. 
Is there a way to do so? Would setting number of size to 0 in 
example-cassdc-minimal.yaml stop the compute resources without losing data? If 
I change the size to 3 again later, would the existing data be picked?

Depending if the operator is going to accept the size as 0 at all, but most 
probably not with the following policy in your storage class, as in the 
example[1]:

reclaimPolicy: Delete

You need some persistent storage and a suitable reclaim policy.

[1]: 
https://docs.datastax.com/en/cass-operator/doc/cass-operator/cassOperatorCloserLookConfiguration.html#CreateandapplyaStorageClass

Regards,
--
Alex



Reducing no. of nodes to 0 without losing data

2020-10-07 Thread Manu Chadha
Hi

I have created a Cassandra cluster on Kubernetes using cass-operator on gcp. It 
is for my personal experimentation. To avoid incurring cost, I want to stop the 
cluster when I am not using it and start it when I need it without losing data. 
Is there a way to do so? Would setting number of size to 0 in 
example-cassdc-minimal.yaml stop the compute resources without losing data? If 
I change the size to 3 again later, would the existing data be picked?

Thanks
Manu

Sent from Mail for Windows 10



Is there a cqlsh method which could tell me if a column is empty or not?

2020-08-02 Thread Manu Chadha
Hi

I am storing image data as `base64` in rows of my table. If I query all records 
then the image data (which is large text) makes it difficult to read results in 
cqlsh. Is there a `cqlsh` method which can just tell me if the column is empty 
or not?

Something like

select isPresent(image), other_columns from table where ;

thanks
Manu



Application level pagination in Cassandra

2020-07-30 Thread Manu Chadha
Hi

This question is part-Cassandra and part ScalarDB. I am using ScalarDB which 
provide ACID support on top of `Cassandra`. The library seem to be working 
well! Unfortunately, ScalarDB doesn't support pagination though so I have to 
implement it in the application.

Consider this scenario in which `P` is primary key, `C` is clustering key and 
`E` is other data within the partition

Partition => { P,C1,E1
P,C2,E1
P,C2,E2
P,C2,E3
P,C2,E4
P,C3,E1
...
P,Cm,En
}

In ScalarDB, I can specify start and end values of keys so I suppose ScalarDB 
will get data only from the specified rows. I can also limit the no. of entries 
fetched.

https://scalar-labs.github.io/scalardb/javadoc/com/scalar/db/api/Scan.html

Say I want to get entries `E3` and `E4` from `P,C2`. For smaller values, I can 
specify start and end clustering keys as C2 and set fetch limit to say 4 and 
ignore `E1` and `E2`. But if there are several hundred records then this method 
will not scale.

For example say `P,C1` has 10 records, `P,C2` has 100 records and I want to 
implement pagination of 20 records per query. Then to implement this, I'll have 
to
Query 1 – Scan – primary key will be P, clustering start will be C1, clustering 
end will be Cn as I don’t know how many records are there.
- get `P,C1`. This will give 10 records
- get `P,C2`. This will give me 20 records. I'll ignore last 10 and combine 
`P,C1`'s 10 with `P,C2`'s first 10 and return the result.

I'll also have to maintain that the last cluster key queried was `C2` and also 
that 10 records were fetched from it.

Query 2 (for next pagination request) - Scan – primary key will be P, 
clustering start will be C2, clustering end will be Cn as I don’t know how many 
records are there.
Now I'll fetch `P,C2` and get 20, ignore 1st 10 (as they were sent last time), 
take the remaining 10, do another fetch using same Scan and take first 10 from 
that.

Is this how it should be done or is there a better way? My concern with above 
implementation is that every time I'll have to fetch loads of records and dump 
them. For example, say I want to get records 70-90 from `P,C2` then I'll  still 
query up to record 60 and dump the result!

Thanks
Manu

Sent from Mail for Windows 10



RE: How to specify a configuration in cass-operator for Cassandra.yaml

2020-07-27 Thread Manu Chadha
Thanks. I am making a personal project so stopping K8S isn’t an issue for me 
personally.

The reason I asked about stopping K8S is because I could run the `kubectl edit` 
command on the cass-operator...yaml file but not on example..yaml file. As the 
configuration is in the example...yaml file, I do not know if the changes will 
be applied on the running cluster.



$ kubectl edit -f example-cassdc-minimal.yaml

Error from server (NotFound): cassandradatacenters.cassandra.datastax.com "dc1" 
not found



Sent from Mail for Windows 10

From: Erick Ramirez
Sent: 27 July 2020 12:51
To: user@cassandra.apache.org
Subject: Re: How to specify a configuration in cass-operator for Cassandra.yaml

Is it possible you don't have the k8s cluster running?

To answer your question, you can edit your k8s cluster configuration with the 
new settings and the cass-operator will apply the changes then it will perform 
a rolling restart of the pods for the changes to take effect. Cheers!



RE: How to specify a configuration in cass-operator for Cassandra.yaml

2020-07-27 Thread Manu Chadha
Thanks. Would I need to delete and restart the Kubernetes cluster for the 
configurations to apply?

Sorry, new to K8S as well so not sure how to go about doing it. It seems I can 
edit the cass-oprator-manifests yaml but that is not the file which needs 
editing. When I edit the example-cassdc file then I am getting error


$ kubectl edit -f example-cassdc-minimal.yaml

Error from server (NotFound): cassandradatacenters.cassandra.datastax.com "dc1" 
not found

I can delete the cluster and start it again with new file but I’ll prefer to 
understand how to make changes when the system is running (if possible).

thanks
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Erick Ramirez<mailto:erick.rami...@datastax.com>
Sent: 27 July 2020 03:00
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: How to specify a configuration in cass-operator for Cassandra.yaml

Yes, you're right -- you need to override the defaults by specifying the 
configuration in the operator yaml spec:

spec:
  ...
  config:
cassandra-yaml:
  ...
  commitlog_sync: batch
  ...

Cheers!


On Mon, 27 Jul 2020 at 03:08, Manu Chadha 
mailto:manu.cha...@hotmail.com>> wrote:
Hi

I am using cass-operator to run Cassandra in Kubernetes. I am also using 
ScalarDB to provide ACID support in Cassandra.

One pre-requisite for ScalarDB is to change the commitlog_sync to batch.

“Change commitlog_sync from periodic to batch in cassandra.yaml not to lose 
data when quorum of replica nodes go down”

What is the way to set this value in Cassandra using Cass-Operator?

I note that in example-cassdc-minimal.yaml, certain properties are defined 
which seem to be values for Cassandra.yaml.


authenticator: org.apache.cassandra.auth.PasswordAuthenticator
authorizer: org.apache.cassandra.auth.CassandraAuthorizer
role_manager: org.apache.cassandra.auth.CassandraRoleManager

I suppose the default value for commitlog_sync is periodic

commitlog_sync: periodic
commitlog_sync_period_in_ms: 1

Do I just add the commitlog_sync property in this list like the following to 
override the default value?


commitlog_sync: batch
commitlog_sync_batch_window_in_ms: 2

thanks
Sent from 
Mail<https://urldefense.proofpoint.com/v2/url?u=https-3A__go.microsoft.com_fwlink_-3FLinkId-3D550986=DwMF-g=adz96Xi0w1RHqtPMowiL2g=DPfYm4e7OLSdVEGyWr82F_m1fTjoAHtX5mdHEINlrQw=_UAyEIS0iYVbcNS7XQbGxHBojQXEuwvA-4uhHB1x-Wo=ayrp92NOkuxRVDbxHBun-SmW8P1fgkRcPqcIqRnzNA4=>
 for Windows 10




How to specify a configuration in cass-operator for Cassandra.yaml

2020-07-26 Thread Manu Chadha
Hi

I am using cass-operator to run Cassandra in Kubernetes. I am also using 
ScalarDB to provide ACID support in Cassandra.

One pre-requisite for ScalarDB is to change the commitlog_sync to batch.

“Change commitlog_sync from periodic to batch in cassandra.yaml not to lose 
data when quorum of replica nodes go down”

What is the way to set this value in Cassandra using Cass-Operator?

I note that in example-cassdc-minimal.yaml, certain properties are defined 
which seem to be values for Cassandra.yaml.


authenticator: org.apache.cassandra.auth.PasswordAuthenticator
authorizer: org.apache.cassandra.auth.CassandraAuthorizer
role_manager: org.apache.cassandra.auth.CassandraRoleManager

I suppose the default value for commitlog_sync is periodic

commitlog_sync: periodic
commitlog_sync_period_in_ms: 1

Do I just add the commitlog_sync property in this list like the following to 
override the default value?


commitlog_sync: batch
commitlog_sync_batch_window_in_ms: 2

thanks
Sent from Mail for Windows 10



what is allowed and not allowed w.r.t altering cassandra table schema

2020-07-15 Thread Manu Chadha
Hi

What is allowed and not allowed w.r.t altering Cassandra table schema?

Creating the right schema seems like the most step w.r.t using Cassandra. 
Coming from relational background, I still struggle to create schema which 
leverages duplication and per-query table (I end up creating relationships 
between tables).

Even if I am able to create a schema which doesn’t have relationship between 
tables for now, my application will evolve in future and I might then have to 
change the schema to avoid creating relationships.

In that respect, what would I be able to change and not change in a schema? If 
I add a new field (non-key), then for existing values I suppose the value of 
that new field will be null/empty. But if I am allowed to make the new field an 
additional key then what will be the value of this key for existing data?

Thanks
Manu

Sent from Mail for Windows 10



RE: design principle to manage roll back

2020-07-14 Thread Manu Chadha
Thanks. Will check Scalar DB.

I avoid batch because I read that it isn’t perfect. Regarding Idempotent, my 
apprehension is that if the write is failing then subsequent attempts might 
also fail. Sorry, I am not trying to find issues in your suggestions (it might 
sound like I am). I am just discussing to come up with new ideas and sort out 
my doubts.


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Manu Chadha<mailto:manu.cha...@hotmail.com>
Sent: 14 July 2020 09:32
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: RE: design principle to manage roll back

Thanks. Will check Scalar DB.

I avoid b

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Hiroyuki Yamada<mailto:mogwa...@gmail.com>
Sent: 14 July 2020 09:26
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: design principle to manage roll back

As one of the options, you can use (Logged) batch for kind of atomic mutations.
I said, "kind of" because it is not really atomic when mutations span
multiple partitions.
More specifically, the mutations go to all the nodes eventually so
intermediate states can be observed and there is no rollback.
https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useBatch.html

You can do similar things by applications' side by making write
operations idempotent and
retry them until they are all succeeded.

As a last resort, you can use Scalar DB.
https://github.com/scalar-labs/scalardb
When you do operations through Scalar DB to Cassandra,
you can achieve ACID transactions on Cassandra.
If there is a failure during a transaction, it will be properly
rollbacked or rollforwarded based on the transaction states.

Hope it helps.

Thanks,
Hiro

On Tue, Jul 14, 2020 at 4:55 PM Manu Chadha  wrote:
>
> Thanks. Actually none of my data is big data. I just thought not to use 
> traditional RDBMS for my project. Features like replication, fast read and 
> write, always ON, scalability appealed well to me. I am also happy with 
> eventual consistency.
>
>
>
> To be honest, I feel there has to be a way because if Cassandra promotes data 
> duplication by creating a table for each query then there should be a way to 
> keep duplicate copies consistent.
>
>
>
>
>
> Sent from Mail for Windows 10
>
>
>
> From: onmstester onmstester
> Sent: 14 July 2020 08:04
> To: user
> Subject: Re: design principle to manage roll back
>
>
>
> Hi,
>
>
>
> I think that Cassandra alone is not suitable for your use case. You can use a 
> mix of Distributed/NoSQL (to storing single records of whatever makes your 
> input the big data) & Relational/Single Database (for transactional non-big 
> data part)
>
>
>
> Sent using Zoho Mail
>
>
>
>
>
>  On Tue, 14 Jul 2020 10:47:33 +0430 Manu Chadha  
> wrote 
>
>
>
>
>
> Hi
>
>
>
> What are the design approaches I can follow to ensure that data is consistent 
> from an application perspective (not from individual tables perspective). I 
> am thinking of issues which arise due to unavailability of rollback or 
> executing atomic transactions in Cassandra. Is Cassandra not suitable for my 
> project?
>
>
>
> Cassandra recommends creating a new table for each query. This results in 
> data duplication (which doesn’t bother me). Take the following scenario. An 
> application which allows users to create, share and manage food recipes. Each 
> of the function below adds records in a separate database
>
>
>
> for {savedRecipe <- saveInRecipeRepository(...)
>
>recipeTagRepository <- saveRecipeTag(...)
>partitionInfoOfRecipes <- savePartitionOfTheTag(...)
>updatedUserProfile <- updateInUserProfile(...)
>recipesByUser <- saveRecipesCreatedByUser(...)
>supportedRecipes <- updateSupportedRecipesInformation(tag)}
>
>
>
> If say updateInUserProfile fails, then I'll have to manage rollback in the 
> application itself as Cassandra doesn’t do it. My concerns is that the 
> rollback process could itself fail due to network issues say.
>
>
>
> Is there a recommended way or a design principle I can follow to keep data 
> consistent?
>
>
>
> Thanks
>
> Manu
>
>
>
> Sent from Mail for Windows 10
>
>
>
>
>
>
>
>

-
To unsubscribe, e-mail: user-unsubscr...@cassandra.apache.org
For additional commands, e-mail: user-h...@cassandra.apache.org




RE: design principle to manage roll back

2020-07-14 Thread Manu Chadha
Thanks. Will check Scalar DB.

I avoid b

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Hiroyuki Yamada<mailto:mogwa...@gmail.com>
Sent: 14 July 2020 09:26
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: design principle to manage roll back

As one of the options, you can use (Logged) batch for kind of atomic mutations.
I said, "kind of" because it is not really atomic when mutations span
multiple partitions.
More specifically, the mutations go to all the nodes eventually so
intermediate states can be observed and there is no rollback.
https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useBatch.html

You can do similar things by applications' side by making write
operations idempotent and
retry them until they are all succeeded.

As a last resort, you can use Scalar DB.
https://github.com/scalar-labs/scalardb
When you do operations through Scalar DB to Cassandra,
you can achieve ACID transactions on Cassandra.
If there is a failure during a transaction, it will be properly
rollbacked or rollforwarded based on the transaction states.

Hope it helps.

Thanks,
Hiro

On Tue, Jul 14, 2020 at 4:55 PM Manu Chadha  wrote:
>
> Thanks. Actually none of my data is big data. I just thought not to use 
> traditional RDBMS for my project. Features like replication, fast read and 
> write, always ON, scalability appealed well to me. I am also happy with 
> eventual consistency.
>
>
>
> To be honest, I feel there has to be a way because if Cassandra promotes data 
> duplication by creating a table for each query then there should be a way to 
> keep duplicate copies consistent.
>
>
>
>
>
> Sent from Mail for Windows 10
>
>
>
> From: onmstester onmstester
> Sent: 14 July 2020 08:04
> To: user
> Subject: Re: design principle to manage roll back
>
>
>
> Hi,
>
>
>
> I think that Cassandra alone is not suitable for your use case. You can use a 
> mix of Distributed/NoSQL (to storing single records of whatever makes your 
> input the big data) & Relational/Single Database (for transactional non-big 
> data part)
>
>
>
> Sent using Zoho Mail
>
>
>
>
>
>  On Tue, 14 Jul 2020 10:47:33 +0430 Manu Chadha  
> wrote 
>
>
>
>
>
> Hi
>
>
>
> What are the design approaches I can follow to ensure that data is consistent 
> from an application perspective (not from individual tables perspective). I 
> am thinking of issues which arise due to unavailability of rollback or 
> executing atomic transactions in Cassandra. Is Cassandra not suitable for my 
> project?
>
>
>
> Cassandra recommends creating a new table for each query. This results in 
> data duplication (which doesn’t bother me). Take the following scenario. An 
> application which allows users to create, share and manage food recipes. Each 
> of the function below adds records in a separate database
>
>
>
> for {savedRecipe <- saveInRecipeRepository(...)
>
>recipeTagRepository <- saveRecipeTag(...)
>partitionInfoOfRecipes <- savePartitionOfTheTag(...)
>updatedUserProfile <- updateInUserProfile(...)
>recipesByUser <- saveRecipesCreatedByUser(...)
>supportedRecipes <- updateSupportedRecipesInformation(tag)}
>
>
>
> If say updateInUserProfile fails, then I'll have to manage rollback in the 
> application itself as Cassandra doesn’t do it. My concerns is that the 
> rollback process could itself fail due to network issues say.
>
>
>
> Is there a recommended way or a design principle I can follow to keep data 
> consistent?
>
>
>
> Thanks
>
> Manu
>
>
>
> Sent from Mail for Windows 10
>
>
>
>
>
>
>
>

-
To unsubscribe, e-mail: user-unsubscr...@cassandra.apache.org
For additional commands, e-mail: user-h...@cassandra.apache.org



RE: design principle to manage roll back

2020-07-14 Thread Manu Chadha
Thanks. Actually none of my data is big data. I just thought not to use 
traditional RDBMS for my project. Features like replication, fast read and 
write, always ON, scalability appealed well to me. I am also happy with 
eventual consistency.

To be honest, I feel there has to be a way because if Cassandra promotes data 
duplication by creating a table for each query then there should be a way to 
keep duplicate copies consistent.


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: onmstester onmstester<mailto:onmstes...@zoho.com.INVALID>
Sent: 14 July 2020 08:04
To: user<mailto:user@cassandra.apache.org>
Subject: Re: design principle to manage roll back

Hi,

I think that Cassandra alone is not suitable for your use case. You can use a 
mix of Distributed/NoSQL (to storing single records of whatever makes your 
input the big data) & Relational/Single Database (for transactional non-big 
data part)


Sent using Zoho Mail<https://www.zoho.com/mail/>


 On Tue, 14 Jul 2020 10:47:33 +0430 Manu Chadha  
wrote 


Hi

What are the design approaches I can follow to ensure that data is consistent 
from an application perspective (not from individual tables perspective). I am 
thinking of issues which arise due to unavailability of rollback or executing 
atomic transactions in Cassandra. Is Cassandra not suitable for my project?

Cassandra recommends creating a new table for each query. This results in data 
duplication (which doesn’t bother me). Take the following scenario. An 
application which allows users to create, share and manage food recipes. Each 
of the function below adds records in a separate database


for {savedRecipe <- saveInRecipeRepository(...)

   recipeTagRepository <- saveRecipeTag(...)
   partitionInfoOfRecipes <- savePartitionOfTheTag(...)
   updatedUserProfile <- updateInUserProfile(...)
   recipesByUser <- saveRecipesCreatedByUser(...)
   supportedRecipes <- updateSupportedRecipesInformation(tag)}

If say updateInUserProfile fails, then I'll have to manage rollback in the 
application itself as Cassandra doesn’t do it. My concerns is that the rollback 
process could itself fail due to network issues say.

Is there a recommended way or a design principle I can follow to keep data 
consistent?

Thanks
Manu

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10






design principle to manage roll back

2020-07-14 Thread Manu Chadha
Hi

What are the design approaches I can follow to ensure that data is consistent 
from an application perspective (not from individual tables perspective). I am 
thinking of issues which arise due to unavailability of rollback or executing 
atomic transactions in Cassandra. Is Cassandra not suitable for my project?

Cassandra recommends creating a new table for each query. This results in data 
duplication (which doesn’t bother me). Take the following scenario. An 
application which allows users to create, share and manage food recipes. Each 
of the function below adds records in a separate database


for {savedRecipe <- saveInRecipeRepository(...)

   recipeTagRepository <- saveRecipeTag(...)
   partitionInfoOfRecipes <- savePartitionOfTheTag(...)
   updatedUserProfile <- updateInUserProfile(...)
   recipesByUser <- saveRecipesCreatedByUser(...)
   supportedRecipes <- updateSupportedRecipesInformation(tag)}

If say updateInUserProfile fails, then I'll have to manage rollback in the 
application itself as Cassandra doesn’t do it. My concerns is that the rollback 
process could itself fail due to network issues say.

Is there a recommended way or a design principle I can follow to keep data 
consistent?

Thanks
Manu

Sent from Mail for Windows 10



Question on cass-operator

2020-07-03 Thread Manu Chadha
Hi

I have a 3 node Kubernetes cluster and I have set up Cassandra on it using 
Cass-Operator.

What does the 2/2 mean in the output of the following command


kubectl get all -n cass-operator

NAMEREADY   STATUSRESTARTS   AGE

pod/cass-operator-78c6469c6-6qhsb   1/1 Running   0  139m

pod/cluster1-dc1-default-sts-0  2/2 Running   0  138m

pod/cluster1-dc1-default-sts-1  2/2 Running   0  138m

pod/cluster1-dc1-default-sts-2  2/2 Running   0  138m

Does it mean that there are 3 data centres each running 2 cassandra nodes? It 
should be because my K8S cluster has only 3 nodes.


manuchadha25@cloudshell:~ (copper-frame-262317)$ gcloud compute instances list

NAME  ZONEMACHINE_TYPE  
 PREEMPTIBLE  INTERNAL_IP  EXTERNAL_IPSTATUS

gke-cassandra-cluster-default-pool-92d544da-6fq8  europe-west4-a  n1-standard-1 
  10.164.0.26  34.91.214.233  RUNNING

gke-cassandra-cluster-default-pool-92d544da-g0b5  europe-west4-a  n1-standard-1 
  10.164.0.25  34.91.101.218  RUNNING

gke-cassandra-cluster-default-pool-92d544da-l87v  europe-west4-a  n1-standard-1 
  10.164.0.27  34.91.86.10RUNNING

Or is Cassandra-operator running two containers per K8S Node?

thanks
Manu



RE: What is the way to scale down Cassandra/Kubernetes cluster from 3 to 1 nodes using cass-operator

2020-07-02 Thread Manu Chadha
Hi

I changed the file and applied it but the new configuration hasn’t got applied.



metadata:

  name: dc1

spec:

  clusterName: cluster1

  serverType: cassandra

  serverVersion: "3.11.6"

  managementApiAuth:

insecure: {}

  size: 1 <-- made change here

  storageConfig:
...


kubectl apply -n cass-operator -f ./cass-dc-2-nodes.yaml


manuchadha25@cloudshell:~ (copper-frame-262317)$ kubectl get all -n 
cass-operator

NAME READY   STATUSRESTARTS   AGE

pod/cass-operator-5f8cdf99fc-9c5g4   1/1 Running   0  2d20h

pod/cluster1-dc1-default-sts-0   2/2 Running   0  2d20h

pod/cluster1-dc1-default-sts-1   2/2 Running   0  9h

pod/cluster1-dc1-default-sts-2   2/2 Running   0  9h



NAME  TYPE   CLUSTER-IP  
EXTERNAL-IP PORT(S) AGE

service/cass-operator-metrics ClusterIP  10.51.243.147   
  8383/TCP,8686/TCP   2d20h

service/cassandra-loadbalancerLoadBalancer   10.51.240.24
34.91.214.233   9042:30870/TCP  2d

service/cassandradatacenter-webhook-service   ClusterIP  10.51.243.86
  443/TCP 2d20h

service/cluster1-dc1-all-pods-service ClusterIP  None
2d20h

service/cluster1-dc1-service  ClusterIP  None
  9042/TCP,8080/TCP   2d20h

service/cluster1-seed-service ClusterIP  None
2d20h



NAMEREADY   UP-TO-DATE   AVAILABLE   AGE

deployment.apps/cass-operator   1/1 11   2d20h



NAME   DESIRED   CURRENT   READY   AGE

replicaset.apps/cass-operator-5f8cdf99fc   1 1 1   2d20h



NAMEREADY   AGE

statefulset.apps/cluster1-dc1-default-sts   3/3 2d20h <-- still 3/3

manuchadha25@cloudshell:~ (copper-frame-262317)$

thanks
Manu
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: vishal kharjul<mailto:kharjul.vis...@gmail.com>
Sent: 02 July 2020 12:46
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: What is the way to scale down Cassandra/Kubernetes cluster from 3 
to 1 nodes using cass-operator

Hello Many,

I tried scale up and it's just need size parameter change . So try same for 
scale down. Just change the size parameter of CassandraDatacenter CRD and apply 
it again. Basically same step which you took to spinoff 3 node with just the 
size parameter changed. Operator will bring down Cassandra nodes accordingly.  
No need to shut down or restart.

Thanks and Regards,
Vishal
On Thu, Jul 2, 2020, 3:41 AM Oleksandr Shulgin 
mailto:oleksandr.shul...@zalando.de>> wrote:
On Thu, Jul 2, 2020 at 9:29 AM Manu Chadha 
mailto:manu.cha...@hotmail.com>> wrote:
Thanks Alex. Will give this a try. So I just change the yaml file and hot-patch 
it or would I need to stop the cluster, delete it and make a new one?

I've no experience with this specific operator, but I expect that editing the 
file and applying it using kubectl is the way to go, especially if you don't 
want to lose your data.

--
Alex




RE: What is the way to scale down Cassandra/Kubernetes cluster from 3 to 1 nodes using cass-operator

2020-07-02 Thread Manu Chadha
Thanks Alex. Will give this a try. So I just change the yaml file and hot-patch 
it or would I need to stop the cluster, delete it and make a new one?

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Oleksandr Shulgin<mailto:oleksandr.shul...@zalando.de>
Sent: 02 July 2020 08:27
To: User<mailto:user@cassandra.apache.org>
Subject: Re: What is the way to scale down Cassandra/Kubernetes cluster from 3 
to 1 nodes using cass-operator

On Thu, Jul 2, 2020 at 9:21 AM Manu Chadha 
mailto:manu.cha...@hotmail.com>> wrote:
Hi

I have created a cluster using cass-operator - 
https://github.com/datastax/cass-operator. I suppose by default 3 replicas (3 
node cluster) are created.

I want to scale down the cluster from 3 to 1 nodes? I executed


kubectl scale sts cluster1-dc1-default-sts --replicas=1 -n cass-operator

statefulset.apps/cluster1-dc1-default-sts scaled
I think that you should be editing the spec.size attribute of your 
CassandraDatacenter resource, instead of modifying the Statefulset directly.

--
Alex




RE: What is the way to scale down Cassandra/Kubernetes cluster from 3 to 1 nodes using cass-operator

2020-07-02 Thread Manu Chadha
Re-edited as code and my notes are mixed up. Changed color of code to red

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Manu Chadha<mailto:manu.cha...@hotmail.com>
Sent: 02 July 2020 08:21
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: What is the way to scale down Cassandra/Kubernetes cluster from 3 to 1 
nodes using cass-operator

Hi

I have created a cluster using cass-operator - 
https://github.com/datastax/cass-operator. I suppose by default 3 replicas (3 
node cluster) are created.

I want to scale down the cluster from 3 to 1 nodes? I executed


kubectl scale sts cluster1-dc1-default-sts --replicas=1 -n cass-operator

statefulset.apps/cluster1-dc1-default-sts scaled

which brought down the no of nodes to 1


kubectl get all -n cass-operator

NAME READY   STATUSRESTARTS   AGE

pod/cass-operator-5f8cdf99fc-9c5g4   1/1 Running   0  2d10h

pod/cluster1-dc1-default-sts-0   2/2 Running   0  2d10h

pod/cluster1-dc1-default-sts-1   1/2 Running   0  48s

pod/cluster1-dc1-default-sts-2   1/2 Running   0  52s



NAME  TYPE   CLUSTER-IP  
EXTERNAL-IP PORT(S) AGE

service/cass-operator-metrics ClusterIP  10.51.243.147   
  8383/TCP,8686/TCP   2d10h

service/cassandra-loadbalancerLoadBalancer   10.51.240.24
34.91.214.233   9042:30870/TCP  38h

service/cassandradatacenter-webhook-service   ClusterIP  10.51.243.86
  443/TCP 2d10h

service/cluster1-dc1-all-pods-service ClusterIP  None
2d10h

service/cluster1-dc1-service  ClusterIP  None
  9042/TCP,8080/TCP   2d10h

service/cluster1-seed-service ClusterIP  None
2d10h



NAMEREADY   UP-TO-DATE   AVAILABLE   AGE

deployment.apps/cass-operator   1/1 11   2d10h



NAME   DESIRED   CURRENT   READY   AGE

replicaset.apps/cass-operator-5f8cdf99fc   1 1 1   2d10h



NAMEREADY   AGE

statefulset.apps/cluster1-dc1-default-sts   1/3 2d10h <-- REDUCTION AS 
DESIRED



But after few minutes, the nodes got scaled up again



kubectl get all -n cass-operator

NAME READY   STATUSRESTARTS   AGE

pod/cass-operator-5f8cdf99fc-9c5g4   1/1 Running   0  2d10h

pod/cluster1-dc1-default-sts-0   2/2 Running   0  2d10h

pod/cluster1-dc1-default-sts-1   2/2 Running   0  2m46s

pod/cluster1-dc1-default-sts-2   2/2 Running   0  2m50s



NAME  TYPE   CLUSTER-IP  
EXTERNAL-IP PORT(S) AGE

service/cass-operator-metrics ClusterIP  10.51.243.147   
  8383/TCP,8686/TCP   2d10h

service/cassandra-loadbalancerLoadBalancer   10.51.240.24
34.91.214.233   9042:30870/TCP  38h

service/cassandradatacenter-webhook-service   ClusterIP  10.51.243.86
  443/TCP 2d10h

service/cluster1-dc1-all-pods-service ClusterIP  None
2d10h

service/cluster1-dc1-service  ClusterIP  None
  9042/TCP,8080/TCP   2d10h

service/cluster1-seed-service ClusterIP  None
2d10h



NAMEREADY   UP-TO-DATE   AVAILABLE   AGE

deployment.apps/cass-operator   1/1 11   2d10h



NAME   DESIRED   CURRENT   READY   AGE

replicaset.apps/cass-operator-5f8cdf99fc   1 1 1   2d10h



NAMEREADY   AGE

statefulset.apps/cluster1-dc1-default-sts   3/3 2d10h <-- back to 3







Clearly I am not doing something right as the stateful set should say 1/1 
instead of 1/3 or 3/3. What configuration do I need to change to create a 1 or 
2 node cluster?




Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10




What is the way to scale down Cassandra/Kubernetes cluster from 3 to 1 nodes using cass-operator

2020-07-02 Thread Manu Chadha
Hi

I have created a cluster using cass-operator - 
https://github.com/datastax/cass-operator. I suppose by default 3 replicas (3 
node cluster) are created.

I want to scale down the cluster from 3 to 1 nodes? I executed


kubectl scale sts cluster1-dc1-default-sts --replicas=1 -n cass-operator

statefulset.apps/cluster1-dc1-default-sts scaled

which brought down the no of nodes to 1


kubectl get all -n cass-operator

NAME READY   STATUSRESTARTS   AGE

pod/cass-operator-5f8cdf99fc-9c5g4   1/1 Running   0  2d10h

pod/cluster1-dc1-default-sts-0   2/2 Running   0  2d10h

pod/cluster1-dc1-default-sts-1   1/2 Running   0  48s

pod/cluster1-dc1-default-sts-2   1/2 Running   0  52s



NAME  TYPE   CLUSTER-IP  
EXTERNAL-IP PORT(S) AGE

service/cass-operator-metrics ClusterIP  10.51.243.147   
  8383/TCP,8686/TCP   2d10h

service/cassandra-loadbalancerLoadBalancer   10.51.240.24
34.91.214.233   9042:30870/TCP  38h

service/cassandradatacenter-webhook-service   ClusterIP  10.51.243.86
  443/TCP 2d10h

service/cluster1-dc1-all-pods-service ClusterIP  None
2d10h

service/cluster1-dc1-service  ClusterIP  None
  9042/TCP,8080/TCP   2d10h

service/cluster1-seed-service ClusterIP  None
2d10h



NAMEREADY   UP-TO-DATE   AVAILABLE   AGE

deployment.apps/cass-operator   1/1 11   2d10h



NAME   DESIRED   CURRENT   READY   AGE

replicaset.apps/cass-operator-5f8cdf99fc   1 1 1   2d10h



NAMEREADY   AGE

statefulset.apps/cluster1-dc1-default-sts   1/3 2d10h <-- REDUCTION AS 
DESIRED



But after few minutes, the nodes got scaled up again



kubectl get all -n cass-operator

NAME READY   STATUSRESTARTS   AGE

pod/cass-operator-5f8cdf99fc-9c5g4   1/1 Running   0  2d10h

pod/cluster1-dc1-default-sts-0   2/2 Running   0  2d10h

pod/cluster1-dc1-default-sts-1   2/2 Running   0  2m46s

pod/cluster1-dc1-default-sts-2   2/2 Running   0  2m50s



NAME  TYPE   CLUSTER-IP  
EXTERNAL-IP PORT(S) AGE

service/cass-operator-metrics ClusterIP  10.51.243.147   
  8383/TCP,8686/TCP   2d10h

service/cassandra-loadbalancerLoadBalancer   10.51.240.24
34.91.214.233   9042:30870/TCP  38h

service/cassandradatacenter-webhook-service   ClusterIP  10.51.243.86
  443/TCP 2d10h

service/cluster1-dc1-all-pods-service ClusterIP  None
2d10h

service/cluster1-dc1-service  ClusterIP  None
  9042/TCP,8080/TCP   2d10h

service/cluster1-seed-service ClusterIP  None
2d10h



NAMEREADY   UP-TO-DATE   AVAILABLE   AGE

deployment.apps/cass-operator   1/1 11   2d10h



NAME   DESIRED   CURRENT   READY   AGE

replicaset.apps/cass-operator-5f8cdf99fc   1 1 1   2d10h



NAMEREADY   AGE

statefulset.apps/cluster1-dc1-default-sts   3/3 2d10h <-- back to 3







Clearly I am not doing something right as the stateful set should say 1/1 
instead of 1/3 or 3/3. What configuration do I need to change to create a 1 or 
2 node cluster?




Sent from Mail for Windows 10



RE: Cassandra container, Google Cloud and Kubernetes

2020-06-30 Thread Manu Chadha
Hi Erick

It might be useful if the answer from Willrof is added to your Wiki. It solved 
my problem and could be very useful to people wanting to run Cass-Operator. 
Please check - 
https://stackoverflow.com/questions/62651374/how-do-i-access-my-cassandra-kubernetes-cluster-from-outside-the-cluster

Thanks
manu

Sent from Mail for Windows 10

From: Erick Ramirez
Sent: 30 June 2020 01:29
To: user@cassandra.apache.org
Subject: Re: Cassandra container, Google Cloud and Kubernetes

It's really a Kubernetes question but the TL;DR is you need to expose the 
services of your k8s cluster to the outside world.

Have a look at this blog post to get you started -- 
http://alesnosek.com/blog/2017/02/14/accessing-kubernetes-pods-from-outside-of-the-cluster/.
 Cheers!



RE: Cassandra container, Google Cloud and Kubernetes

2020-06-29 Thread Manu Chadha
In continuation to my previous message, I can see the nodes are up on the GCP 
dashboard. I can ping the external IP from my laptop but when I run `cqlsh 
external_ip 9042` then the connection fails.

How do I go about connecting the K8s/Cassandra cluster to outside work so that 
my web application can access it.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Manu Chadha<mailto:manu.cha...@hotmail.com>
Sent: 29 June 2020 22:02
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Cc: christopher.bradf...@datastax.com<mailto:christopher.bradf...@datastax.com>
Subject: RE: Cassandra container, Google Cloud and Kubernetes

Hi

I have started using Cass-Operator and the setup worked like a charm! 
https://github.com/datastax/cass-operator

I have an issue though. My cluster is up and running on GCP. But how do I 
access it from my laptop? Sorry, new to Kubernetes so do not know how to access 
the cluster from outside?

Thanks
Manu

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Manu Chadha<mailto:manu.cha...@hotmail.com>
Sent: 25 June 2020 07:48
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Cc: christopher.bradf...@datastax.com<mailto:christopher.bradf...@datastax.com>
Subject: RE: Cassandra container, Google Cloud and Kubernetes

Thanks Chris. This is useful.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Christopher Bradford<mailto:bradfor...@gmail.com>
Sent: 25 June 2020 07:46
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Cc: christopher.bradf...@datastax.com<mailto:christopher.bradf...@datastax.com>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

Hi Manu,

OSS Cassandra support in cass-operator is marked as a Technology Preview as 
there is no integrated solution for repairs or backup / restore functionality 
at this time. If you are comfortable managing these operational tasks either 
manually or through other complementary tools (Reaper and Medusa come to mind) 
then there should not be anything blocking you from using this operator. As 
Erick mentioned there are other operators available that may or may not handle 
these tasks for you and should be considered.

~Chris

Christopher Bradford



On Thu, Jun 25, 2020 at 2:39 AM Manu Chadha 
mailto:manu.cha...@hotmail.com>> wrote:
Thanks. One more concern popped up. It seems Cass is not recommended for 
production. However, I need this specifically for production. What is your take 
on this?

“
The use of Cass Operator with Cassandra 3.11.6 is intended as a Technology 
Preview only. Using Cass Operator with Cassandra is not recommended at this 
time for production environments.
“

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Erick Ramirez<mailto:erick.rami...@datastax.com>
Sent: 25 June 2020 07:25
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

It seems that 3.11.4 is not supported. I am happy to move up to 3.11.6 but is 
3.11.6 backward compatible with 3.11.4? I don’t want start changing my driver 
code in the application.

There isn't a breaking change from a driver perspective between 3.11.4 and 
3.11.6 so you don't need to rewrite your code. Cheers!






RE: Cassandra container, Google Cloud and Kubernetes

2020-06-29 Thread Manu Chadha
Hi

I have started using Cass-Operator and the setup worked like a charm! 
https://github.com/datastax/cass-operator

I have an issue though. My cluster is up and running on GCP. But how do I 
access it from my laptop? Sorry, new to Kubernetes so do not know how to access 
the cluster from outside?

Thanks
Manu

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Manu Chadha<mailto:manu.cha...@hotmail.com>
Sent: 25 June 2020 07:48
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Cc: christopher.bradf...@datastax.com<mailto:christopher.bradf...@datastax.com>
Subject: RE: Cassandra container, Google Cloud and Kubernetes

Thanks Chris. This is useful.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Christopher Bradford<mailto:bradfor...@gmail.com>
Sent: 25 June 2020 07:46
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Cc: christopher.bradf...@datastax.com<mailto:christopher.bradf...@datastax.com>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

Hi Manu,

OSS Cassandra support in cass-operator is marked as a Technology Preview as 
there is no integrated solution for repairs or backup / restore functionality 
at this time. If you are comfortable managing these operational tasks either 
manually or through other complementary tools (Reaper and Medusa come to mind) 
then there should not be anything blocking you from using this operator. As 
Erick mentioned there are other operators available that may or may not handle 
these tasks for you and should be considered.

~Chris

Christopher Bradford



On Thu, Jun 25, 2020 at 2:39 AM Manu Chadha 
mailto:manu.cha...@hotmail.com>> wrote:
Thanks. One more concern popped up. It seems Cass is not recommended for 
production. However, I need this specifically for production. What is your take 
on this?

“
The use of Cass Operator with Cassandra 3.11.6 is intended as a Technology 
Preview only. Using Cass Operator with Cassandra is not recommended at this 
time for production environments.
“

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Erick Ramirez<mailto:erick.rami...@datastax.com>
Sent: 25 June 2020 07:25
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

It seems that 3.11.4 is not supported. I am happy to move up to 3.11.6 but is 
3.11.6 backward compatible with 3.11.4? I don’t want start changing my driver 
code in the application.

There isn't a breaking change from a driver perspective between 3.11.4 and 
3.11.6 so you don't need to rewrite your code. Cheers!





Can cassandra pick configuration from environment variables

2020-06-28 Thread Manu Chadha
Hi

Cassandra pick configuration from Cassandra.yaml (eg. Listen_address). Can I 
set the values of listen_address, rpc_address etc. from environment variables?

Thanks
Manu

Sent from Mail for Windows 10



RE: Cassandra container, Google Cloud and Kubernetes

2020-06-25 Thread Manu Chadha
Thanks Chris. This is useful.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Christopher Bradford<mailto:bradfor...@gmail.com>
Sent: 25 June 2020 07:46
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Cc: christopher.bradf...@datastax.com<mailto:christopher.bradf...@datastax.com>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

Hi Manu,

OSS Cassandra support in cass-operator is marked as a Technology Preview as 
there is no integrated solution for repairs or backup / restore functionality 
at this time. If you are comfortable managing these operational tasks either 
manually or through other complementary tools (Reaper and Medusa come to mind) 
then there should not be anything blocking you from using this operator. As 
Erick mentioned there are other operators available that may or may not handle 
these tasks for you and should be considered.

~Chris

Christopher Bradford



On Thu, Jun 25, 2020 at 2:39 AM Manu Chadha 
mailto:manu.cha...@hotmail.com>> wrote:
Thanks. One more concern popped up. It seems Cass is not recommended for 
production. However, I need this specifically for production. What is your take 
on this?

“
The use of Cass Operator with Cassandra 3.11.6 is intended as a Technology 
Preview only. Using Cass Operator with Cassandra is not recommended at this 
time for production environments.
“

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Erick Ramirez<mailto:erick.rami...@datastax.com>
Sent: 25 June 2020 07:25
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

It seems that 3.11.4 is not supported. I am happy to move up to 3.11.6 but is 
3.11.6 backward compatible with 3.11.4? I don’t want start changing my driver 
code in the application.

There isn't a breaking change from a driver perspective between 3.11.4 and 
3.11.6 so you don't need to rewrite your code. Cheers!




RE: Cassandra container, Google Cloud and Kubernetes

2020-06-25 Thread Manu Chadha
Thanks. One more concern popped up. It seems Cass is not recommended for 
production. However, I need this specifically for production. What is your take 
on this?

“
The use of Cass Operator with Cassandra 3.11.6 is intended as a Technology 
Preview only. Using Cass Operator with Cassandra is not recommended at this 
time for production environments.
“

Sent from Mail for Windows 10

From: Erick Ramirez
Sent: 25 June 2020 07:25
To: user@cassandra.apache.org
Subject: Re: Cassandra container, Google Cloud and Kubernetes

It seems that 3.11.4 is not supported. I am happy to move up to 3.11.6 but is 
3.11.6 backward compatible with 3.11.4? I don’t want start changing my driver 
code in the application.

There isn't a breaking change from a driver perspective between 3.11.4 and 
3.11.6 so you don't need to rewrite your code. Cheers!



RE: Cassandra container, Google Cloud and Kubernetes

2020-06-25 Thread Manu Chadha
Hi Erick

It seems that 3.11.4 is not supported. I am happy to move up to 3.11.6 but is 
3.11.6 backward compatible with 3.11.4? I don’t want start changing my driver 
code in the application.

“
Cass Operator release 1.2.0 is compatible with Apache Cassandra 3.11.6 and DSE 
6.8.0+. Cass Operator is not supported and will not function with prior 
releases of Cassandra or DSE. Furthermore, this release of Cass Operator is 
compatible only with specific Cassandra and DSE docker images that are hosted 
in the DataStax Docker Hub repository. Prior (pre-release) DataStax Labs 
releases of DSE 6.8.0 will not function with the current Cass Operator.”

Thanks
Manu


From: Manu Chadha<mailto:manu.cha...@hotmail.com>
Sent: 25 June 2020 07:12
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: RE: Cassandra container, Google Cloud and Kubernetes

Dear Erick

I have started looking at Cass. Referring to the release notes, does Cass 
support 3.11.4?

https://docs.datastax.com/en/cass-operator/doc/cass-operator/cassOperatorReleaseNotes.html

regards
Manu



Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Erick Ramirez<mailto:erick.rami...@datastax.com>
Sent: 24 June 2020 12:37
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

This isn't a direct answer to your questions but you might be interested in the 
Kubernetes operator for Apache Cassandra [1] from DataStax. You can use the 
cass-operator to deploy a C* 3.11.6 image to your Kubernetes cluster. The docs 
are available here [2].

FWIW there are several other published operators from the likes of Orange [3] 
and Instaclustr [4]. The authors have come together in the community to 
contribute their work and "combine" them into an "official" operator for 
Cassandra. (I'm sure someone will correct me if I've made any 
misrepresentation). Cheers!

[1] https://github.com/datastax/cass-operator
[2] https://docs.datastax.com/en/cass-operator/doc/
[3] https://github.com/Orange-OpenSource/casskop
[4] https://github.com/instaclustr/cassandra-operator




RE: Cassandra container, Google Cloud and Kubernetes

2020-06-25 Thread Manu Chadha
Dear Erick

I have started looking at Cass. Referring to the release notes, does Cass 
support 3.11.4?

https://docs.datastax.com/en/cass-operator/doc/cass-operator/cassOperatorReleaseNotes.html

regards
Manu



Sent from Mail for Windows 10

From: Erick Ramirez
Sent: 24 June 2020 12:37
To: user@cassandra.apache.org
Subject: Re: Cassandra container, Google Cloud and Kubernetes

This isn't a direct answer to your questions but you might be interested in the 
Kubernetes operator for Apache Cassandra [1] from DataStax. You can use the 
cass-operator to deploy a C* 3.11.6 image to your Kubernetes cluster. The docs 
are available here [2].

FWIW there are several other published operators from the likes of Orange [3] 
and Instaclustr [4]. The authors have come together in the community to 
contribute their work and "combine" them into an "official" operator for 
Cassandra. (I'm sure someone will correct me if I've made any 
misrepresentation). Cheers!

[1] https://github.com/datastax/cass-operator
[2] https://docs.datastax.com/en/cass-operator/doc/
[3] https://github.com/Orange-OpenSource/casskop
[4] https://github.com/instaclustr/cassandra-operator



Cassandra container, Google Cloud and Kubernetes

2020-06-24 Thread Manu Chadha
Hi

I want to run Cassandra container in GCP and want to orchestrate the containers 
using Kubernetes.

I have a Cassandra image in my Docker Registry. Following the steps from the 
following tutorial, I have created a cluster and have Cassandra running on it. 
https://cloud.google.com/kubernetes-engine/docs/tutorials/hello-app#step_4_create_a_cluster

These are the steps I executed

  *   get cassandra image - docker pull manuchadha25/codingjedi:3.11.4
  *   check that the images exists locally- docker images. Also check that the 
image runs - docker run manuchadha25/cassandra:3.11.4
  *   run on GCP console - export PROJECT_ID=project-id of google project
  *   run on GCP console - gcloud auth configure-docker - maybe not required as 
I want to skip putting the image in container registry.
  *   gcloud config set project $PROJECT_ID
  *   gcloud config set compute/zone compute-zone --num-nodes 2
  *   gcloud container clusters create codingjedi-cassandra-cluster 
--num-nodes=2
  *   check cluster is up - gcloud compute instances list
  *   kubectl create deployment codingjedi-cassandra-app 
--image=docker.io/manuchadha25/cassandra:3.11.4
  *   kubectl scale deployment codingjedi-cassandra-app --replicas=3
  *   kubectl autoscale deployment codingjedi-cassandra-app --cpu-percent=80 
--min=3 --max=5
  *   check all is fine- kubectl get pods
  *   kubectl expose deployment codingjedi-cassandra-app 
--name=codingjedi-cassandra-app-service --type=LoadBalancer --port 9042 
--target-port 9042
  *   check service is running - kubectl get service
  *   copy external ip address and from laptop run cqlsh external-ip 9042. This 
should start cqlsh. I am able to connect with the cluster from my laptop using 
the external IP. – cqlsh external-ip 9042

My concern is that I have not provided any configuration anywhere which would 
make the different Cassandra nodes work together. So while I have created a 
Kubernetes cluster, I have not created a Cassandra cluster. Am I correct? I 
suppose I need to do more to make the nodes work as Cassandra cluster. How do I 
do that? I mean specify SEED_ADDRESS, LISTENING address, set an external data 
volume so that the data persists etc.?

Regards
Manu


Sent from Mail for Windows 10



persist data such that a new container can reuse existing schema and data

2020-06-13 Thread Manu Chadha
Hi

I create a Cassandra Container, run it, create schema and add data to it. When 
I later stop the Container and delete it and create a new one from the image, 
the previously created schema and data is lost.

Can I/How can I persist data and schema such that whenever a container is 
created from an image, it picks existing schema and data?

Do would I have to recreate the schema and add data?

Thanks
Sent from Mail for Windows 10



ServerError: java.lang.AssertionError on running Docker container with mounted data directory

2020-06-13 Thread Manu Chadha
I am running Cassandra Docker image on my Windows 10 following the steps here 
-https://hub.docker.com/_/cassandra

Specifically about the section - Where to store data - I have started the 
Images as follows


container 1

docker run  -v 
C:\Users\manuc\Documents\manu\dockertest\dockerdata:/var/lib/cassandra 
--network cassandra-net -p 9042:9042 --name cassandra1 cassandra_image_id

container 2

 docker run  -v 
C:\Users\manuc\Documents\manu\dockertest\dockerdata:/var/lib/cassandra 
--network cassandra-net --name cassandra2  -e CASSANDRA_SEEDS=cassandra1 
cassandra_image_id

Then I start Bash and cqlsh to container 1 to create keyspace and tables -

docker exec -it container-id  bash

CREATE KEYSPACE myKS WITH replication = {'class': 'SimpleStrategy', 
'replication_factor': '3'} ;

cqlsh> CREATE TABLE myKS.users (
   ... bucket int,
   ... email text,
   ... authprovider text,
   ... firstname text,
   ... lastname text,
   ... confirmed boolean,
   ... hasher text,
   ... id uuid,
   ... password text,
   ... salt text,
   ... PRIMARY KEY ((bucket, email), authprovider, firstname, lastname)
   ... );
cqlsh>
cqlsh> use myKS;
cqlsh:codingjedi> insert into users (bucket, email,authprovider, firstname, 
lastname, confirmed, hasher,id,password, salt) values 
(1,'m...@m.com','ap','fn','ln',false,'h',uuid(),'p','s');

When I run the Insert query, I get error `java.lang.AssertionError`

The error on `Cassandra` console is

ERROR [Native-Transport-Requests-2] 2020-06-13 16:06:46,704 
Message.java:693 - Unexpected exception during request; channel = [id: 
0x60052791, L:/127.0.0.1:9042 - R:/127.0.0.1:34818]
java.lang.AssertionError: null
at 
org.apache.cassandra.locator.TokenMetadata.firstTokenIndex(TokenMetadata.java:1065)
 ~[apache-cassandra-3.11.4.jar:3.11.4]
at 
org.apache.cassandra.locator.TokenMetadata.firstToken(TokenMetadata.java:1079) 
~[apache-cassandra-3.11.4.jar:3.11.4]
at 
org.apache.cassandra.locator.AbstractReplicationStrategy.getNaturalEndpoints(AbstractReplicationStrategy.java:107)
 ~[apache-cassandra-3.11.4.jar:3.11.4]
at 
org.apache.cassandra.service.StorageService.getNaturalEndpoints(StorageService.java:3825)
 ~[apache-cassandra-3.11.4.jar:3.11.4]
at 
org.apache.cassandra.service.StorageProxy.performWrite(StorageProxy.java:1074) 
~[apache-cassandra-3.11.4.jar:3.11.4]
at 
org.apache.cassandra.service.StorageProxy.mutate(StorageProxy.java:621) 
~[apache-cassandra-3.11.4.jar:3.11.4]
at 
org.apache.cassandra.service.StorageProxy.mutateWithTriggers(StorageProxy.java:851)
 ~[apache-cassandra-3.11.4.jar:3.11.4]
at 
org.apache.cassandra.cql3.statements.ModificationStatement.executeWithoutCondition(ModificationStatement.java:439)
 ~[apache-cassandra-3.11.4.jar:3.11.4]
at 
org.apache.cassandra.cql3.statements.ModificationStatement.execute(ModificationStatement.java:425)
 ~[apache-cassandra-3.11.4.jar:3.11.4]
at 
org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:225)
 ~[apache-cassandra-3.11.4.jar:3.11.4]
at 
org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:256) 
~[apache-cassandra-3.11.4.jar:3.11.4]
at 
org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:241) 
~[apache-cassandra-3.11.4.jar:3.11.4]
at 
org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:116)
 ~[apache-cassandra-3.11.4.jar:3.11.4]
at 
org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:566)
 [apache-cassandra-3.11.4.jar:3.11.4]
at 
org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:410)
 [apache-cassandra-3.11.4.jar:3.11.4]
at 
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
 [netty-all-4.0.44.Final.jar:4.0.44.Final]
at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
 [netty-all-4.0.44.Final.jar:4.0.44.Final]
at 
io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:35)
 [netty-all-4.0.44.Final.jar:4.0.44.Final]
at 
io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:348)
 [netty-all-4.0.44.Final.jar:4.0.44.Final]
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
[na:1.8.0_222]
at 
org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:162)
 [apache-cassandra-3.11.4.jar:3.11.4]
at 
org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:114) 
[apache-cassandra-3.11.4.jar:3.11.4]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_222]

What is causing this error and how can I solve this error?

Do I understand the working of RF and CL correctly?

2020-06-12 Thread Manu Chadha
Hi

Just want to confirm whether I understand RF and CL correctly.


I have got 2 Cassandra nodes up

C:\Users\manuc\Documents\manu\codingjedi>docker container ps -a

CONTAINER IDIMAGE COMMAND  CREATED  
   STATUSPORTS  
 NAMES

1923093e84f3app:30may2020   "/bin/sh -c 'codingj…"   21 hours ago   
 Up 22 minutes 0.0.0.0:9000->9000/tcp   
   hardcore_bardeen

381fd5996008app:30may2020   "/bin/sh -c 'codingj…"   21 hours ago   
 Exited (255) 24 minutes ago
   stupefied_wozniak

85dd140e19ddca795bbd8fd7  "docker-entrypoint.s…"   21 hours 
agoUp 24 minutes 7000-7001/tcp, 7199/tcp, 9042/tcp, 
9160/tcp cassandra2

f70caa70fe81ca795bbd8fd7  "docker-entrypoint.s…"   21 hours 
agoUp 25 minutes 7000-7001/tcp, 7199/tcp, 9160/tcp, 
0.0.0.0:9042->9042/tcp   cassandra1



The Replication Factor for my Keyspace is 3

cqlsh> describe keyspace mykeyspace;



CREATE KEYSPACE mykeyspace WITH replication = {'class': 'SimpleStrategy', 
'replication_factor': '3'}  AND durable_writes = true;



But when I run a query to add in the database, it successfully gets executed. I 
thought that the query will fail as RF is 3.

I suppose I am getting confused between Replication Factor (RF) and Consistency 
Level (CL). If less no. of nodes are up then the query will still work as long 
as Consistency Level is satisfied. The Consistency Level is one (by default) so 
the code works. If I change CL to 3 then the query fails. Regarding RF, when 
the 3rd node comes up then it gets the data from other 2 nodes.

Thanks

Sent from Mail for Windows 10



Consistency level shows as null in Java driver

2020-06-12 Thread Manu Chadha
Hi

In my Cassandra Java driver code, I am creating a query and then I print the 
consistency level of the query

val whereClause = whereConditions(tablename, id); 
cassandraRepositoryLogger.trace("getRowsByPartitionKeyId: looking in table 
"+tablename+" with partition key  "+partitionKeyColumns +" and values 
"+whereClause +" fetch size "+fetchSize)



cassandraRepositoryLogger.trace("where clause is "+whereClause)

cassandraRepositoryLogger.trace(s"consistency level 
${whereClause.getConsistencyLevel}")



But the print shows taht consistency level is null. Why? Shouldn't it be One by 
default?

2020-06-10 07:16:44,146 [TRACE] from repository.UsersRepository in 
scala-execution-context-global-115 - where clause is SELECT * FROM users WHERE 
bucket=109 AND email='manu.cha...@hotmail.com';

2020-06-10 07:16:44,146 [TRACE] from repository.UsersRepository in 
scala-execution-context-global-115 - getOneRowByPartitionKeyId: looking in 
table users with partition key  List(bucket, email) and values SELECT * FROM 
users WHERE bucket=109 AND email='manu.cha...@hotmail.com';

2020-06-10 07:16:44,146 [TRACE] from repository.UsersRepository in 
scala-execution-context-global-115 - consistency level null <-- Why is this 
null?



The query if build like follows

def whereConditions(tableName:String,id: UserKeys):Where= {

QueryBuilder.select().from(tableName).where(QueryBuilder.eq("bucket", 
id.bucket))

  .and(QueryBuilder.eq("email", id.email))

  }

Thanks
Manu
Sent from Mail for Windows 10



Unable to connect with Cassandra Docker image from outside

2020-06-04 Thread Manu Chadha
Hi



I want to run cassandra docker image and want to connect it with my application 
running in another container. I am on Windows10 and both containers are running 
on same Windows10 Home machine. I also have Cassandra installed on the machine 
as standalone application (without Docker).



I thought to use host.docker.internal as domain name in both the applications. 
But when I start cassandra image, I get error

org.apache.cassandra.exceptions.ConfigurationException: Unable to bind to 
address host.docker.internal/192.168.65.2:7000. Set listen_address in 
cassandra.yaml to an interface you can bind to, e.g., your private IP address 
on EC2



Question 1) Why is host.docker.internal resolving to 192.168.65.2/7000?. 
Shouldn't it be 192.168.1.12 as that is what is configured in my etc/hosts file 
on Windows 10

C:\Users\manuc>ping host.docker.internal



Pinging host.docker.internal [192.168.1.12] with 32 bytes of data:

Reply from 192.168.1.12: bytes=32 time<1ms TTL=128

Reply from 192.168.1.12: bytes=32 time=1ms TTL=128

Reply from 192.168.1.12: bytes=32 time<1ms TTL=128

Reply from 192.168.1.12: bytes=32 time<1ms TTL=128



I also tried explicitly specifying 192.168.1.12 when starting cassandra images 
but I get similar error.



The only way I am able to start the container is by running docker run 
ca795bbd8fd7 but in this case, cassandra listens at address 0.0.0.0 for cqlsh



Starting listening for CQL clients on /0.0.0.0:9042 (unencrypted)..



But in this case, my other docker application or cqlsh of the standalone 
CasSandra is unable to connect with it (running on the same windows machine)



C:\Users\manuc>cqlsh host.docker.internal 9042

Connection error: ('Unable to connect to any servers', {'192.168.1.12': 
error(10061, "Tried connecting to [('192.168.1.12', 9042)]. Last error: No 
connection could be made because the target machine actively refused it")})

C:\Users\manuc>cqlsh 0.0.0.0 9042

Connection error: ('Unable to connect to any servers', {'0.0.0.0': error(10049, 
"Tried connecting to [('0.0.0.0', 9042)]. Last error: The requested address is 
not valid in its context")})



C:\Users\manuc>docker run .. my_other_docker_application

[trace] s.d.c.CassandraConnectionManagementService - creating session with uri 
CassandraConnectionUri(cassandra://host.docker.internal:9042/myKeyspace) and 
cluster name Test Cluster

[trace] s.d.c.CassandraConnectionManagementService - exception in connecting 
with database com.datastax.driver.core.exceptions.NoHostAvailableException: All 
host(s) tried for query failed (tried: host.docker.internal/192.168.65.2:9042 
(com.datastax.driver.core.exceptions.TransportException: 
[host.docker.internal/192.168.65.2:9042] Cannot connect))

Oops, cannot start the server.

play.api.libs.json.JsResult$Exception: {"obj":[{"msg":["Unable to connect with 
database"],"args":[]}]}


Question 2) How can I make Cassandra container connect with my other 
application container or cqlsh of my standalone Cassandra installation?

Thanks

Sent from Mail for Windows 10



RE: Cassandra and Docker

2020-06-03 Thread Manu Chadha
I forgot to mention, I am on Windows 10

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10


From: Manu Chadha 
Sent: Wednesday, June 3, 2020 7:04:03 AM
To: user@cassandra.apache.org 
Subject: Cassandra and Docker


Hi



I want to run Cassandra within Docker. I am new to both to be honest.



  1.  Is it better to use Cassandra within Docker or is it better to 
install/run Cassandra directly on a VM in the cloud?
  2.  Is there a Docker image for Cassandra (for 3.11.4) which I can pull/use?
  3.  How will data be stored if I use Docker/Cassandra? If the container 
stops, then would re-running the image use existing data or would I use lose 
data?
  4.  How would I configure a DC if I use Docker/Cassandra? Say I run 3 
containers on 3 VMs for RF=3, how would I provide this configuration through 
Docker?



Thanks

Manu



Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10




Cassandra and Docker

2020-06-03 Thread Manu Chadha
Hi

I want to run Cassandra within Docker. I am new to both to be honest.


  1.  Is it better to use Cassandra within Docker or is it better to 
install/run Cassandra directly on a VM in the cloud?
  2.  Is there a Docker image for Cassandra (for 3.11.4) which I can pull/use?
  3.  How will data be stored if I use Docker/Cassandra? If the container 
stops, then would re-running the image use existing data or would I use lose 
data?
  4.  How would I configure a DC if I use Docker/Cassandra? Say I run 3 
containers on 3 VMs for RF=3, how would I provide this configuration through 
Docker?

Thanks
Manu

Sent from Mail for Windows 10



Unable to start cassandra on GCP (Google cloud) using public email address

2019-12-18 Thread Manu Chadha
Hi

Apologies if this isn’t the right group to ask questions. If it isn’t, please 
let me know wehre I should send such messages.

I am trying to run cassandra on google cloud and want to use external IP to run 
cassandra. I specified the external address in rpc_address in but got error 
when trying to start cassandra- INFO [main] 2019-12-17 19:00:37,251 
Server.java:159 - Starting listening for CQL clients on /xx.xx.xxx.xx:9042 
(unencrypted)... Exception (java.lang.IllegalStateException) encountered during 
startup: Failed to bind port 9042 on xx.xx.x.xx. 
java.lang.IllegalStateException: Failed to bind port 9042 on x.x.x.x.x..


Would you know what I might be doing wrong?

Thanks
Manu

Sent from Mail for Windows 10