Re: Instaclustr Masters scholarship

2017-02-07 Thread daemeon reiydelle
A bunch more welcome than here in the US, to our deep shame and foolishness.

Sadly while I am actually involved in this area, I am happy in San
Francisco. I would be interested in being part of a pro bono team should
that transpire.

Thanks, D.


*...*



*Daemeon C.M. ReiydelleUSA (+1) 415.501.0198London (+44) (0) 20 8144 9872*

On Tue, Feb 7, 2017 at 7:24 PM, Ben Bromhead  wrote:

> As part of our commitment to contributing back to the Apache Cassandra
> open source project and the wider community we are always looking for ways
> we can foster knowledge sharing and improve usability of Cassandra itself.
> One of the ways we have done so previously was to open up our internal
> builds and versions of Cassandra (https://github.com/instaclustr/cassandra
> ).
>
> We have also been looking at a few novel or outside the box ways we can
> further contribute back to the community. As such, we are sponsoring a
> masters project in conjunction with the Australian based University of
> Canberra. Instaclustr’s staff will be available to provide advice and
> feedback to the successful candidate.
>
> *Scope*
> Distributed database systems are relatively new technology compared to
> traditional relational databases. Distributed advantages provide
> significant advantages in terms of reliability and scalability but often at
> a cost of increased complexity. This complexity presents challenges for
> testing of these systems to prove correct operation across all possible
> system states. The scope of this masters scholarship is to use the Apache
> Cassandra repair process as an example to consider and improve available
> approaches to distributed database systems testing.
>
> The repair process in Cassandra is a scheduled process that runs to ensure
> the multiple copies of each piece of data that is maintained by Cassandra
> are kept synchronised. Correct operation of repairs has been an ongoing
> challenge for the Cassandra project partly due to the difficulty in
> designing and developing  comprehensive automated tests for this
> functionality.
>
> The expected scope of this project is to:
>
>- survey and understand the existing testing framework available as
>part of the Cassandra project, particularly as it pertains to testing
>repairs
>- consider, research and develop enhanced approaches to testing of
>repairs
>- submit any successful approaches to the Apache Cassandra project for
>feedback and inclusion in the project code base
>
> Australia is a pretty great place to advance your education and is
> welcoming of foreign students.
>
> We are also open to sponsoring a PhD project with a more in depth focus
> for the right candidate.
>
> For more details please don't hesitate to get in touch with myself or
> reach out to i...@instaclustr.com.
>
> Cheers
>
> Ben
> --
> Ben Bromhead
> CTO | Instaclustr 
> +1 650 284 9692 <(650)%20284-9692>
> Managed Cassandra / Spark on AWS, Azure and Softlayer
>


Instaclustr Masters scholarship

2017-02-07 Thread Ben Bromhead
As part of our commitment to contributing back to the Apache Cassandra open
source project and the wider community we are always looking for ways we
can foster knowledge sharing and improve usability of Cassandra itself. One
of the ways we have done so previously was to open up our internal builds
and versions of Cassandra (https://github.com/instaclustr/cassandra).

We have also been looking at a few novel or outside the box ways we can
further contribute back to the community. As such, we are sponsoring a
masters project in conjunction with the Australian based University of
Canberra. Instaclustr’s staff will be available to provide advice and
feedback to the successful candidate.

*Scope*
Distributed database systems are relatively new technology compared to
traditional relational databases. Distributed advantages provide
significant advantages in terms of reliability and scalability but often at
a cost of increased complexity. This complexity presents challenges for
testing of these systems to prove correct operation across all possible
system states. The scope of this masters scholarship is to use the Apache
Cassandra repair process as an example to consider and improve available
approaches to distributed database systems testing.

The repair process in Cassandra is a scheduled process that runs to ensure
the multiple copies of each piece of data that is maintained by Cassandra
are kept synchronised. Correct operation of repairs has been an ongoing
challenge for the Cassandra project partly due to the difficulty in
designing and developing  comprehensive automated tests for this
functionality.

The expected scope of this project is to:

   - survey and understand the existing testing framework available as part
   of the Cassandra project, particularly as it pertains to testing repairs
   - consider, research and develop enhanced approaches to testing of
   repairs
   - submit any successful approaches to the Apache Cassandra project for
   feedback and inclusion in the project code base

Australia is a pretty great place to advance your education and is
welcoming of foreign students.

We are also open to sponsoring a PhD project with a more in depth focus for
the right candidate.

For more details please don't hesitate to get in touch with myself or reach
out to i...@instaclustr.com.

Cheers

Ben
-- 
Ben Bromhead
CTO | Instaclustr 
+1 650 284 9692
Managed Cassandra / Spark on AWS, Azure and Softlayer


Re: Authentication with Java driver

2017-02-07 Thread Ben Bromhead
On Tue, 7 Feb 2017 at 17:52 Yuji Ito  wrote:

Thanks Andrew, Ben,

My application creates a lot of instances connecting to Cassandra with
basically the same set of credentials.

Do you mean lots of instances of the process or lots of instances of the
cluster/session object?


After an instance connects to Cassandra with the credentials, can any
instance connect to Cassandra without credentials?

As long as you don't share the session or cluster objects. Each new
cluster/session will need to reauthenticate.


== example ==
A first = new A("database", "user", "password");  // proper credentials
r = first.get();
...
A other = new A("database", "user", "pass"); // wrong password
r = other.get();
== example ==

I want to refuse the `other` instance with improper credentials.


This looks like you are creating new cluster/session objects (filling in
the blanks for your pseudocode here). So "other" will not authenticate to
Cassandra.

This brings up a wider point of why you are doing this? Generally most
applications will create a single longed lived session object that lasts
the life of the application process.

I would not rely on Cassandra auth to authenticate downstream actors, not
because it's bad, just its generally inefficient to create lots of session
objects. The session object maintains a connection pool, pipelines
requests, is thread safe and generally pretty solid.




Yuji


On Wed, Feb 8, 2017 at 4:11 AM, Ben Bromhead  wrote:

What are you specifically trying to achieve? Are you trying to authenticate
multiple Cassandra users from a single application instance? Or will your
have lot's of application instances connecting to Cassandra using the same
set of credentials? Or a combination of both? Multiple application
instances with different credentials?

On Tue, 7 Feb 2017 at 06:19 Andrew Tolbert 
wrote:

Hello,

The API seems kind of not correct because credentials should be
usually set with a session but actually they are set with a cluster.


With the datastax driver, Session is what manages connection pools to each
node.  Cluster manages configuration and a separate connection ('control
connection') to subscribe to state changes (schema changes, node topology
changes, node up/down events).


So, if there are 1000 clients, then with this API it has to create
1000 cluster instances ?


I'm unsure how common it is for per-user authentication to be done when
connecting to the database.  I think an application would normally
authenticate with one set of credentials instead of multiple.  The protocol
Cassandra uses does authentication at the connection level instead of at
the request level, so that is currently a limitation to support something
like reusing Sessions for authenticating multiple users.

Thanks,
Andy


On Tue, Feb 7, 2017 at 7:19 AM Hiroyuki Yamada  wrote:

Hi,

The API seems kind of not correct because credentials should be
usually set with a session but actually they are set with a cluster.

So, if there are 1000 clients, then with this API it has to create
1000 cluster instances ?
1000 clients seems usual if there are many nodes (say 20) and each
node has some concurrency (say 50),
but 1000 cluster instances seems too many.

Is this an expected way to do this ? or
Is there any way to authenticate per session ?

Thanks,
Hiro

On Tue, Feb 7, 2017 at 11:38 AM, Yuji Ito  wrote:
> Hi all,
>
> I want to know how to authenticate Cassandra users for multiple instances
> with Java driver.
> For instance, each thread creates a instance to access Cassandra with
> authentication.
>
> As the implementation example, only the first constructor builds a cluster
> and a session.
> Other constructors use them.
> This example is implemented according to the datastax document: "Basically
> you will want to share the same cluster and session instances across your
> application".
>
http://www.datastax.com/dev/blog/4-simple-rules-when-using-the-datastax-drivers-for-cassandra
>
> However, other constructors don't authenticate the user and the password.
> That's because they don't need to build a cluster and a session.
>
> So, should I create a cluster and a session per instance for the
> authentication?
> If yes, can I create a lot of instances(clusters and sessions) to access
C*
> concurrently?
>
> == example ==
> public class A {
>   private static Cluster cluster = null;
>   private static Map sessions = null;
>   private Session session;
>
>   public A (String keyspace, String user, String password) {
> if (cluster == null) {
> builder = Cluster.builder();
> ...
> builder = builder.withCredentials(user, password);
> cluster = builder.build();
> }
> session = sessions.get(keyspace);
> if (session == null) {
> session = cluster.connection(keyspace);
> sessions.put(keyspace, session)
> }
> ...
>   }
>   ...
> 

Re: Authentication with Java driver

2017-02-07 Thread Yuji Ito
Thanks Andrew, Ben,

My application creates a lot of instances connecting to Cassandra with
basically the same set of credentials.
After an instance connects to Cassandra with the credentials, can any
instance connect to Cassandra without credentials?

== example ==
A first = new A("database", "user", "password");  // proper credentials
r = first.get();
...
A other = new A("database", "user", "pass"); // wrong password
r = other.get();
== example ==

I want to refuse the `other` instance with improper credentials.

Yuji


On Wed, Feb 8, 2017 at 4:11 AM, Ben Bromhead  wrote:

> What are you specifically trying to achieve? Are you trying to
> authenticate multiple Cassandra users from a single application instance?
> Or will your have lot's of application instances connecting to Cassandra
> using the same set of credentials? Or a combination of both? Multiple
> application instances with different credentials?
>
> On Tue, 7 Feb 2017 at 06:19 Andrew Tolbert 
> wrote:
>
>> Hello,
>>
>> The API seems kind of not correct because credentials should be
>> usually set with a session but actually they are set with a cluster.
>>
>>
>> With the datastax driver, Session is what manages connection pools to
>> each node.  Cluster manages configuration and a separate connection
>> ('control connection') to subscribe to state changes (schema changes, node
>> topology changes, node up/down events).
>>
>>
>> So, if there are 1000 clients, then with this API it has to create
>> 1000 cluster instances ?
>>
>>
>> I'm unsure how common it is for per-user authentication to be done when
>> connecting to the database.  I think an application would normally
>> authenticate with one set of credentials instead of multiple.  The protocol
>> Cassandra uses does authentication at the connection level instead of at
>> the request level, so that is currently a limitation to support something
>> like reusing Sessions for authenticating multiple users.
>>
>> Thanks,
>> Andy
>>
>>
>> On Tue, Feb 7, 2017 at 7:19 AM Hiroyuki Yamada 
>> wrote:
>>
>> Hi,
>>
>> The API seems kind of not correct because credentials should be
>> usually set with a session but actually they are set with a cluster.
>>
>> So, if there are 1000 clients, then with this API it has to create
>> 1000 cluster instances ?
>> 1000 clients seems usual if there are many nodes (say 20) and each
>> node has some concurrency (say 50),
>> but 1000 cluster instances seems too many.
>>
>> Is this an expected way to do this ? or
>> Is there any way to authenticate per session ?
>>
>> Thanks,
>> Hiro
>>
>> On Tue, Feb 7, 2017 at 11:38 AM, Yuji Ito  wrote:
>> > Hi all,
>> >
>> > I want to know how to authenticate Cassandra users for multiple
>> instances
>> > with Java driver.
>> > For instance, each thread creates a instance to access Cassandra with
>> > authentication.
>> >
>> > As the implementation example, only the first constructor builds a
>> cluster
>> > and a session.
>> > Other constructors use them.
>> > This example is implemented according to the datastax document:
>> "Basically
>> > you will want to share the same cluster and session instances across
>> your
>> > application".
>> > http://www.datastax.com/dev/blog/4-simple-rules-when-
>> using-the-datastax-drivers-for-cassandra
>> >
>> > However, other constructors don't authenticate the user and the
>> password.
>> > That's because they don't need to build a cluster and a session.
>> >
>> > So, should I create a cluster and a session per instance for the
>> > authentication?
>> > If yes, can I create a lot of instances(clusters and sessions) to
>> access C*
>> > concurrently?
>> >
>> > == example ==
>> > public class A {
>> >   private static Cluster cluster = null;
>> >   private static Map sessions = null;
>> >   private Session session;
>> >
>> >   public A (String keyspace, String user, String password) {
>> > if (cluster == null) {
>> > builder = Cluster.builder();
>> > ...
>> > builder = builder.withCredentials(user, password);
>> > cluster = builder.build();
>> > }
>> > session = sessions.get(keyspace);
>> > if (session == null) {
>> > session = cluster.connection(keyspace);
>> > sessions.put(keyspace, session)
>> > }
>> > ...
>> >   }
>> >   ...
>> >   public ResultSet update(...) {
>> >   ...
>> >   public ResultSet get(...) {
>> >   ...
>> > }
>> > == example ==
>> >
>> > Thanks,
>> > Yuji
>>
>> --
> Ben Bromhead
> CTO | Instaclustr 
> +1 650 284 9692 <(650)%20284-9692>
> Managed Cassandra / Spark on AWS, Azure and Softlayer
>


Re: AW: Why does CockroachDB github website say Cassandra has noAvailability on datacenter failure?

2017-02-07 Thread Kant Kodali
https://github.com/cockroachdb/cockroach/commit/f46a547827d3439b57baa5c3a11f8f9ad2d8b153

On Tue, Feb 7, 2017 at 3:20 PM, Kant Kodali  wrote:

> LOL They took down that image finally!! But I would still keep an eye on
> what kind of fake benchmarks they might come up with.
>
> On Tue, Feb 7, 2017 at 7:11 AM, Amit Trivedi  wrote:
>
>> It indeed is a marketing gimmick. By clubbing Cassandra with likes of
>> HBase that favors consistency over availability, points under cons section
>> are all true, just not true when applied to any one database from that
>> group.
>>
>> Thanks and Regards
>>
>> Amit Trivedi
>>
>> On Feb 7, 2017, 7:32 AM -0500, j.kes...@enercast.de, wrote:
>>
>> Deeper inside there is a diagram:
>>
>>
>>
>> https://raw.githubusercontent.com/cockroachdb/cockroach/mast
>> er/docs/media/sql-nosql-newsql.png
>>
>>
>>
>> They compare to NoSQL along with Riak, HBase and Cassandra.
>>
>>
>>
>> Of course you CAN have a Cassandra cluster which is not fully available
>> with loss of a dc nor consistent.
>>
>>
>>
>> Marketing 
>>
>>
>>
>> Gesendet von meinem Windows 10 Phone
>>
>>
>>
>> *Von:* DuyHai Doan 
>> *Gesendet:* Dienstag, 7. Februar 2017 11:53
>> *An:* d...@cassandra.apache.org
>> *Cc:* user@cassandra.apache.org
>> *Betreff:* Re: Why does CockroachDB github website say Cassandra has
>> noAvailability on datacenter failure?
>>
>>
>>
>> The link you posted doesn't say anything about Cassandra
>>
>> Le 7 févr. 2017 11:41, "Kant Kodali"  a écrit :
>>
>> Why does CockroachDB github website say Cassandra has no Availability on
>> datacenter failure?
>>
>> https://github.com/cockroachdb/cockroach
>>
>>
>>
>>
>


Re: Authentication with Java driver

2017-02-07 Thread Ben Bromhead
What are you specifically trying to achieve? Are you trying to authenticate
multiple Cassandra users from a single application instance? Or will your
have lot's of application instances connecting to Cassandra using the same
set of credentials? Or a combination of both? Multiple application
instances with different credentials?

On Tue, 7 Feb 2017 at 06:19 Andrew Tolbert 
wrote:

> Hello,
>
> The API seems kind of not correct because credentials should be
> usually set with a session but actually they are set with a cluster.
>
>
> With the datastax driver, Session is what manages connection pools to
> each node.  Cluster manages configuration and a separate connection
> ('control connection') to subscribe to state changes (schema changes, node
> topology changes, node up/down events).
>
>
> So, if there are 1000 clients, then with this API it has to create
> 1000 cluster instances ?
>
>
> I'm unsure how common it is for per-user authentication to be done when
> connecting to the database.  I think an application would normally
> authenticate with one set of credentials instead of multiple.  The protocol
> Cassandra uses does authentication at the connection level instead of at
> the request level, so that is currently a limitation to support something
> like reusing Sessions for authenticating multiple users.
>
> Thanks,
> Andy
>
>
> On Tue, Feb 7, 2017 at 7:19 AM Hiroyuki Yamada  wrote:
>
> Hi,
>
> The API seems kind of not correct because credentials should be
> usually set with a session but actually they are set with a cluster.
>
> So, if there are 1000 clients, then with this API it has to create
> 1000 cluster instances ?
> 1000 clients seems usual if there are many nodes (say 20) and each
> node has some concurrency (say 50),
> but 1000 cluster instances seems too many.
>
> Is this an expected way to do this ? or
> Is there any way to authenticate per session ?
>
> Thanks,
> Hiro
>
> On Tue, Feb 7, 2017 at 11:38 AM, Yuji Ito  wrote:
> > Hi all,
> >
> > I want to know how to authenticate Cassandra users for multiple instances
> > with Java driver.
> > For instance, each thread creates a instance to access Cassandra with
> > authentication.
> >
> > As the implementation example, only the first constructor builds a
> cluster
> > and a session.
> > Other constructors use them.
> > This example is implemented according to the datastax document:
> "Basically
> > you will want to share the same cluster and session instances across your
> > application".
> >
> http://www.datastax.com/dev/blog/4-simple-rules-when-using-the-datastax-drivers-for-cassandra
> >
> > However, other constructors don't authenticate the user and the password.
> > That's because they don't need to build a cluster and a session.
> >
> > So, should I create a cluster and a session per instance for the
> > authentication?
> > If yes, can I create a lot of instances(clusters and sessions) to access
> C*
> > concurrently?
> >
> > == example ==
> > public class A {
> >   private static Cluster cluster = null;
> >   private static Map sessions = null;
> >   private Session session;
> >
> >   public A (String keyspace, String user, String password) {
> > if (cluster == null) {
> > builder = Cluster.builder();
> > ...
> > builder = builder.withCredentials(user, password);
> > cluster = builder.build();
> > }
> > session = sessions.get(keyspace);
> > if (session == null) {
> > session = cluster.connection(keyspace);
> > sessions.put(keyspace, session)
> > }
> > ...
> >   }
> >   ...
> >   public ResultSet update(...) {
> >   ...
> >   public ResultSet get(...) {
> >   ...
> > }
> > == example ==
> >
> > Thanks,
> > Yuji
>
> --
Ben Bromhead
CTO | Instaclustr 
+1 650 284 9692
Managed Cassandra / Spark on AWS, Azure and Softlayer


Re: UnknownColumnFamilyException after removing all Cassandra data

2017-02-07 Thread Simone Franzini
To further add to my previous answer, the node in question is a seed node,
so it did not bootstrap.
Should I remove it from the list of seed nodes and then try to restart it?

Simone Franzini, PhD

http://www.linkedin.com/in/simonefranzini

On Tue, Feb 7, 2017 at 9:43 AM, Simone Franzini 
wrote:

> This is exactly what I did on the second node. If this is not the correct
> / best procedure to adopt in these cases, please advise:
>
> 1. Removed all the data, including the system table (rm -rf data/
> commitlog/ saved_caches).
> 2. Configured the node to replace itself, by adding the following line to
> cassandra-env.sh: JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address= own IP address>"
> 3. Start the node.
>
> Noticeably, I did not do nodetool decommission or removenode. Is that the
> recommended approach?
>
> Given what I did, I am mystified as to what the problem is. If I query the
> system.schema_columnfamilies on the affected node, all CF IDs are there.
> Same goes for the only other node that is currently up. Also, the other
> node that is currently up has data for all those CF IDs in the data folder.
>
>
> Simone Franzini, PhD
>
> http://www.linkedin.com/in/simonefranzini
>
> On Tue, Feb 7, 2017 at 5:39 AM, kurt greaves  wrote:
>
>> The node is trying to communicate with another node, potentially
>> streaming data, and is receiving files/data for an "unknown column family".
>> That is, it doesn't know about the CF with the id
>> e36415b6-95a7-368c-9ac0-ae0ac774863d.
>> If you deleted some columnfamilies but not all the system keyspace and
>> restarted the node I'd expect this error to occur. Or I suppose if you
>> didn't decommission the node properly before blowing the data away and
>> restarting.
>>
>> You'll have to give us more information on what your exact steps were on
>> this 2nd node:
>>
>> When you say deleted all Cassandra data, did this include the system
>> tables? Were your steps to delete all the data and then just restart the
>> node? Did you remove the node from the cluster prior to deleting the data
>> and restarting it (nodetool decommission/removenode? Did the node rejoin
>> the cluster or did it have to bootstrap?
>>
>>
>>
>


Re: UnknownColumnFamilyException after removing all Cassandra data

2017-02-07 Thread Simone Franzini
This is exactly what I did on the second node. If this is not the correct /
best procedure to adopt in these cases, please advise:

1. Removed all the data, including the system table (rm -rf data/
commitlog/ saved_caches).
2. Configured the node to replace itself, by adding the following line to
cassandra-env.sh: JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address="
3. Start the node.

Noticeably, I did not do nodetool decommission or removenode. Is that the
recommended approach?

Given what I did, I am mystified as to what the problem is. If I query the
system.schema_columnfamilies on the affected node, all CF IDs are there.
Same goes for the only other node that is currently up. Also, the other
node that is currently up has data for all those CF IDs in the data folder.


Simone Franzini, PhD

http://www.linkedin.com/in/simonefranzini

On Tue, Feb 7, 2017 at 5:39 AM, kurt greaves  wrote:

> The node is trying to communicate with another node, potentially streaming
> data, and is receiving files/data for an "unknown column family". That is,
> it doesn't know about the CF with the id e36415b6-95a7-368c-9ac0-ae0ac7
> 74863d.
> If you deleted some columnfamilies but not all the system keyspace and
> restarted the node I'd expect this error to occur. Or I suppose if you
> didn't decommission the node properly before blowing the data away and
> restarting.
>
> You'll have to give us more information on what your exact steps were on
> this 2nd node:
>
> When you say deleted all Cassandra data, did this include the system
> tables? Were your steps to delete all the data and then just restart the
> node? Did you remove the node from the cluster prior to deleting the data
> and restarting it (nodetool decommission/removenode? Did the node rejoin
> the cluster or did it have to bootstrap?
>
>
>


Re: AW: Why does CockroachDB github website say Cassandra has noAvailability on datacenter failure?

2017-02-07 Thread Amit Trivedi
It indeed is a marketing gimmick. By clubbing Cassandra with likes of HBase 
that favors consistency over availability, points under cons section are all 
true, just not true when applied to any one database from that group.

Thanks and Regards

Amit Trivedi

On Feb 7, 2017, 7:32 AM -0500, j.kes...@enercast.de, wrote:
> Deeper inside there is a diagram:
>
> https://raw.githubusercontent.com/cockroachdb/cockroach/master/docs/media/sql-nosql-newsql.png
>
> They compare to NoSQL along with Riak, HBase and Cassandra.
>
> Of course you CAN have a Cassandra cluster which is not fully available with 
> loss of a dc nor consistent.
>
> Marketing 
>
> Gesendet von meinem Windows 10 Phone
>
> Von: DuyHai Doan
> Gesendet: Dienstag, 7. Februar 2017 11:53
> An: d...@cassandra.apache.org
> Cc: user@cassandra.apache.org
> Betreff: Re: Why does CockroachDB github website say Cassandra has 
> noAvailability on datacenter failure?
>
> The link you posted doesn't say anything about Cassandra
> Le 7 févr. 2017 11:41, "Kant Kodali"  a écrit :
> Why does CockroachDB github website say Cassandra has no Availability on
> datacenter failure?
>
> https://github.com/cockroachdb/cockroach
>


Re: Authentication with Java driver

2017-02-07 Thread Andrew Tolbert
Hello,

The API seems kind of not correct because credentials should be
> usually set with a session but actually they are set with a cluster.
>

With the datastax driver, Session is what manages connection pools to each
node.  Cluster manages configuration and a separate connection ('control
connection') to subscribe to state changes (schema changes, node topology
changes, node up/down events).

So, if there are 1000 clients, then with this API it has to create
> 1000 cluster instances ?


I'm unsure how common it is for per-user authentication to be done when
connecting to the database.  I think an application would normally
authenticate with one set of credentials instead of multiple.  The protocol
Cassandra uses does authentication at the connection level instead of at
the request level, so that is currently a limitation to support something
like reusing Sessions for authenticating multiple users.

Thanks,
Andy


On Tue, Feb 7, 2017 at 7:19 AM Hiroyuki Yamada  wrote:

> Hi,
>
> The API seems kind of not correct because credentials should be
> usually set with a session but actually they are set with a cluster.
>
> So, if there are 1000 clients, then with this API it has to create
> 1000 cluster instances ?
> 1000 clients seems usual if there are many nodes (say 20) and each
> node has some concurrency (say 50),
> but 1000 cluster instances seems too many.
>
> Is this an expected way to do this ? or
> Is there any way to authenticate per session ?
>
> Thanks,
> Hiro
>
> On Tue, Feb 7, 2017 at 11:38 AM, Yuji Ito  wrote:
> > Hi all,
> >
> > I want to know how to authenticate Cassandra users for multiple instances
> > with Java driver.
> > For instance, each thread creates a instance to access Cassandra with
> > authentication.
> >
> > As the implementation example, only the first constructor builds a
> cluster
> > and a session.
> > Other constructors use them.
> > This example is implemented according to the datastax document:
> "Basically
> > you will want to share the same cluster and session instances across your
> > application".
> > http://www.datastax.com/dev/blog/4-simple-rules-when-
> using-the-datastax-drivers-for-cassandra
> >
> > However, other constructors don't authenticate the user and the password.
> > That's because they don't need to build a cluster and a session.
> >
> > So, should I create a cluster and a session per instance for the
> > authentication?
> > If yes, can I create a lot of instances(clusters and sessions) to access
> C*
> > concurrently?
> >
> > == example ==
> > public class A {
> >   private static Cluster cluster = null;
> >   private static Map sessions = null;
> >   private Session session;
> >
> >   public A (String keyspace, String user, String password) {
> > if (cluster == null) {
> > builder = Cluster.builder();
> > ...
> > builder = builder.withCredentials(user, password);
> > cluster = builder.build();
> > }
> > session = sessions.get(keyspace);
> > if (session == null) {
> > session = cluster.connection(keyspace);
> > sessions.put(keyspace, session)
> > }
> > ...
> >   }
> >   ...
> >   public ResultSet update(...) {
> >   ...
> >   public ResultSet get(...) {
> >   ...
> > }
> > == example ==
> >
> > Thanks,
> > Yuji
>


Re: Authentication with Java driver

2017-02-07 Thread Hiroyuki Yamada
Hi,

The API seems kind of not correct because credentials should be
usually set with a session but actually they are set with a cluster.

So, if there are 1000 clients, then with this API it has to create
1000 cluster instances ?
1000 clients seems usual if there are many nodes (say 20) and each
node has some concurrency (say 50),
but 1000 cluster instances seems too many.

Is this an expected way to do this ? or
Is there any way to authenticate per session ?

Thanks,
Hiro

On Tue, Feb 7, 2017 at 11:38 AM, Yuji Ito  wrote:
> Hi all,
>
> I want to know how to authenticate Cassandra users for multiple instances
> with Java driver.
> For instance, each thread creates a instance to access Cassandra with
> authentication.
>
> As the implementation example, only the first constructor builds a cluster
> and a session.
> Other constructors use them.
> This example is implemented according to the datastax document: "Basically
> you will want to share the same cluster and session instances across your
> application".
> http://www.datastax.com/dev/blog/4-simple-rules-when-using-the-datastax-drivers-for-cassandra
>
> However, other constructors don't authenticate the user and the password.
> That's because they don't need to build a cluster and a session.
>
> So, should I create a cluster and a session per instance for the
> authentication?
> If yes, can I create a lot of instances(clusters and sessions) to access C*
> concurrently?
>
> == example ==
> public class A {
>   private static Cluster cluster = null;
>   private static Map sessions = null;
>   private Session session;
>
>   public A (String keyspace, String user, String password) {
> if (cluster == null) {
> builder = Cluster.builder();
> ...
> builder = builder.withCredentials(user, password);
> cluster = builder.build();
> }
> session = sessions.get(keyspace);
> if (session == null) {
> session = cluster.connection(keyspace);
> sessions.put(keyspace, session)
> }
> ...
>   }
>   ...
>   public ResultSet update(...) {
>   ...
>   public ResultSet get(...) {
>   ...
> }
> == example ==
>
> Thanks,
> Yuji


AW: Why does CockroachDB github website say Cassandra has noAvailability on datacenter failure?

2017-02-07 Thread j.kesten
Deeper inside there is a diagram:

https://raw.githubusercontent.com/cockroachdb/cockroach/master/docs/media/sql-nosql-newsql.png

They compare to NoSQL along with Riak, HBase and Cassandra. 

Of course you CAN have a Cassandra cluster which is not fully available with 
loss of a dc nor consistent. 

Marketing 

Gesendet von meinem Windows 10 Phone

Von: DuyHai Doan
Gesendet: Dienstag, 7. Februar 2017 11:53
An: d...@cassandra.apache.org
Cc: user@cassandra.apache.org
Betreff: Re: Why does CockroachDB github website say Cassandra has 
noAvailability on datacenter failure?

The link you posted doesn't say anything about Cassandra 
Le 7 févr. 2017 11:41, "Kant Kodali"  a écrit :
Why does CockroachDB github website say Cassandra has no Availability on
datacenter failure?

https://github.com/cockroachdb/cockroach



Re: Why does CockroachDB github website say Cassandra has no Availability on datacenter failure?

2017-02-07 Thread Benjamin Roth
Ask for forgiveness not for permission if you do marketing ;)

Am 07.02.2017 13:11 schrieb "Kant Kodali" :

> lol. But seriously are they even allowed to say something that is not true
> about another product ?
>
> On Tue, Feb 7, 2017 at 4:05 AM, kurt greaves  wrote:
>
>> Marketing never lies. Ever
>>
>
>


Re: Why does CockroachDB github website say Cassandra has no Availability on datacenter failure?

2017-02-07 Thread Kant Kodali
lol. But seriously are they even allowed to say something that is not true
about another product ?

On Tue, Feb 7, 2017 at 4:05 AM, kurt greaves  wrote:

> Marketing never lies. Ever
>


Re: Why does CockroachDB github website say Cassandra has no Availability on datacenter failure?

2017-02-07 Thread kurt greaves
Marketing never lies. Ever


Re: UnknownColumnFamilyException after removing all Cassandra data

2017-02-07 Thread kurt greaves
The node is trying to communicate with another node, potentially streaming
data, and is receiving files/data for an "unknown column family". That is,
it doesn't know about the CF with the id e36415b6-95a7-368c-9ac0-
ae0ac774863d.
If you deleted some columnfamilies but not all the system keyspace and
restarted the node I'd expect this error to occur. Or I suppose if you
didn't decommission the node properly before blowing the data away and
restarting.

You'll have to give us more information on what your exact steps were on
this 2nd node:

When you say deleted all Cassandra data, did this include the system
tables? Were your steps to delete all the data and then just restart the
node? Did you remove the node from the cluster prior to deleting the data
and restarting it (nodetool decommission/removenode? Did the node rejoin
the cluster or did it have to bootstrap?


Re: Why does CockroachDB github website say Cassandra has no Availability on datacenter failure?

2017-02-07 Thread DuyHai Doan
The link you posted doesn't say anything about Cassandra
Le 7 févr. 2017 11:41, "Kant Kodali"  a écrit :

> Why does CockroachDB github website say Cassandra has no Availability on
> datacenter failure?
>
> https://github.com/cockroachdb/cockroach
>


Why does CockroachDB github website say Cassandra has no Availability on datacenter failure?

2017-02-07 Thread Kant Kodali
Why does CockroachDB github website say Cassandra has no Availability on
datacenter failure?

https://github.com/cockroachdb/cockroach