You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by "Richard L. Burton III" <mr...@gmail.com> on 2016/02/02 16:47:32 UTC

Java Driver Question

In the case of adding more nodes to the cluster, would my application have
to be restarted to detect the new nodes (as opposed to a node acting like a
coordinator).

e.g., Having the Java code connect using 3 known contact points and when a
4th and 5th node are added, the driver will become aware of these nodes
without havng to be restarted?

-- 
-Richard L. Burton III
@rburton

Re: Java Driver Question

Posted by "Richard L. Burton III" <mr...@gmail.com>.
Awesome! I love that.

:)

On Tue, Feb 2, 2016 at 11:14 AM, Alex Popescu <al...@datastax.com> wrote:

>
> On Tue, Feb 2, 2016 at 8:12 AM, Richard L. Burton III <mr...@gmail.com>
> wrote:
>
>> is this behavior only related to the Java Drivers?
>
>
> All DataStax drivers for Cassandra provide the node discovery feature and
> are aware of the cluster topology.
>
>
> --
> Bests,
>
> Alex Popescu | @al3xandru
> Sen. Product Manager @ DataStax
>
>


-- 
-Richard L. Burton III
@rburton

Re: Java Driver Question

Posted by Alex Popescu <al...@datastax.com>.
On Tue, Feb 2, 2016 at 8:12 AM, Richard L. Burton III <mr...@gmail.com>
wrote:

> is this behavior only related to the Java Drivers?


All DataStax drivers for Cassandra provide the node discovery feature and
are aware of the cluster topology.


-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax

Re: Java Driver Question

Posted by "Richard L. Burton III" <mr...@gmail.com>.
I wasn't aware there was another mailing list specifically for this.
Another question, is this behavior only related to the Java Drivers?

On Tue, Feb 2, 2016 at 11:05 AM, Sylvain Lebresne <sy...@datastax.com>
wrote:

> As a side note, if your email subject is "Java Driver Question", then this
> almost surely belong to the java driver mailing list. Please try to respect
> other subscribers by using the most appropriate mailing list when possible.
>
> On Tue, Feb 2, 2016 at 5:01 PM, Richard L. Burton III <mr...@gmail.com>
> wrote:
>
>> Very nice - Thanks Jack. I was looking at the docs and Contact Points but
>> didn't see this. I'll use DNS records to manage the main contact points and
>> update the DNS when those servers change.
>>
>> We should catch up again soon. Last time was a few years ago at the bar
>> with Jake.
>>
>> On Tue, Feb 2, 2016 at 10:58 AM, Jack Krupansky <jack.krupansky@gmail.com
>> > wrote:
>>
>>> No need to restart. As per the doc for Node Discovery:
>>> "The driver discovers the nodes that constitute a cluster by querying
>>> the contact points used in building the cluster object. After this it is up
>>> to the cluster's load balancing policy to keep track of node events (that
>>> is add, down, remove, or up) by its implementation of the
>>> Host.StateListener interface."
>>>
>>> See:
>>>
>>> http://docs.datastax.com/en/developer/java-driver/3.0/common/drivers/reference/nodeDiscovery_r.html
>>>
>>> That said, your client would need to be modified/reconfigured and
>>> restarted if the contact points changed enough that none were accessible.
>>>
>>>
>>> -- Jack Krupansky
>>>
>>> On Tue, Feb 2, 2016 at 10:47 AM, Richard L. Burton III <
>>> mrburton@gmail.com> wrote:
>>>
>>>> In the case of adding more nodes to the cluster, would my application
>>>> have to be restarted to detect the new nodes (as opposed to a node acting
>>>> like a coordinator).
>>>>
>>>> e.g., Having the Java code connect using 3 known contact points and
>>>> when a 4th and 5th node are added, the driver will become aware of these
>>>> nodes without havng to be restarted?
>>>>
>>>> --
>>>> -Richard L. Burton III
>>>> @rburton
>>>>
>>>
>>>
>>
>>
>> --
>> -Richard L. Burton III
>> @rburton
>>
>
>


-- 
-Richard L. Burton III
@rburton

Re: Java Driver Question

Posted by Sylvain Lebresne <sy...@datastax.com>.
As a side note, if your email subject is "Java Driver Question", then this
almost surely belong to the java driver mailing list. Please try to respect
other subscribers by using the most appropriate mailing list when possible.

On Tue, Feb 2, 2016 at 5:01 PM, Richard L. Burton III <mr...@gmail.com>
wrote:

> Very nice - Thanks Jack. I was looking at the docs and Contact Points but
> didn't see this. I'll use DNS records to manage the main contact points and
> update the DNS when those servers change.
>
> We should catch up again soon. Last time was a few years ago at the bar
> with Jake.
>
> On Tue, Feb 2, 2016 at 10:58 AM, Jack Krupansky <ja...@gmail.com>
> wrote:
>
>> No need to restart. As per the doc for Node Discovery:
>> "The driver discovers the nodes that constitute a cluster by querying
>> the contact points used in building the cluster object. After this it is up
>> to the cluster's load balancing policy to keep track of node events (that
>> is add, down, remove, or up) by its implementation of the
>> Host.StateListener interface."
>>
>> See:
>>
>> http://docs.datastax.com/en/developer/java-driver/3.0/common/drivers/reference/nodeDiscovery_r.html
>>
>> That said, your client would need to be modified/reconfigured and
>> restarted if the contact points changed enough that none were accessible.
>>
>>
>> -- Jack Krupansky
>>
>> On Tue, Feb 2, 2016 at 10:47 AM, Richard L. Burton III <
>> mrburton@gmail.com> wrote:
>>
>>> In the case of adding more nodes to the cluster, would my application
>>> have to be restarted to detect the new nodes (as opposed to a node acting
>>> like a coordinator).
>>>
>>> e.g., Having the Java code connect using 3 known contact points and when
>>> a 4th and 5th node are added, the driver will become aware of these nodes
>>> without havng to be restarted?
>>>
>>> --
>>> -Richard L. Burton III
>>> @rburton
>>>
>>
>>
>
>
> --
> -Richard L. Burton III
> @rburton
>

Re: Java Driver Question

Posted by "Richard L. Burton III" <mr...@gmail.com>.
Very nice - Thanks Jack. I was looking at the docs and Contact Points but
didn't see this. I'll use DNS records to manage the main contact points and
update the DNS when those servers change.

We should catch up again soon. Last time was a few years ago at the bar
with Jake.

On Tue, Feb 2, 2016 at 10:58 AM, Jack Krupansky <ja...@gmail.com>
wrote:

> No need to restart. As per the doc for Node Discovery:
> "The driver discovers the nodes that constitute a cluster by querying the
> contact points used in building the cluster object. After this it is up to
> the cluster's load balancing policy to keep track of node events (that is
> add, down, remove, or up) by its implementation of the Host.StateListener
> interface."
>
> See:
>
> http://docs.datastax.com/en/developer/java-driver/3.0/common/drivers/reference/nodeDiscovery_r.html
>
> That said, your client would need to be modified/reconfigured and
> restarted if the contact points changed enough that none were accessible.
>
>
> -- Jack Krupansky
>
> On Tue, Feb 2, 2016 at 10:47 AM, Richard L. Burton III <mrburton@gmail.com
> > wrote:
>
>> In the case of adding more nodes to the cluster, would my application
>> have to be restarted to detect the new nodes (as opposed to a node acting
>> like a coordinator).
>>
>> e.g., Having the Java code connect using 3 known contact points and when
>> a 4th and 5th node are added, the driver will become aware of these nodes
>> without havng to be restarted?
>>
>> --
>> -Richard L. Burton III
>> @rburton
>>
>
>


-- 
-Richard L. Burton III
@rburton

Re: Java Driver Question

Posted by Jack Krupansky <ja...@gmail.com>.
No need to restart. As per the doc for Node Discovery:
"The driver discovers the nodes that constitute a cluster by querying the
contact points used in building the cluster object. After this it is up to
the cluster's load balancing policy to keep track of node events (that is
add, down, remove, or up) by its implementation of the Host.StateListener
interface."

See:
http://docs.datastax.com/en/developer/java-driver/3.0/common/drivers/reference/nodeDiscovery_r.html

That said, your client would need to be modified/reconfigured and restarted
if the contact points changed enough that none were accessible.


-- Jack Krupansky

On Tue, Feb 2, 2016 at 10:47 AM, Richard L. Burton III <mr...@gmail.com>
wrote:

> In the case of adding more nodes to the cluster, would my application have
> to be restarted to detect the new nodes (as opposed to a node acting like a
> coordinator).
>
> e.g., Having the Java code connect using 3 known contact points and when a
> 4th and 5th node are added, the driver will become aware of these nodes
> without havng to be restarted?
>
> --
> -Richard L. Burton III
> @rburton
>

Re: Java Driver Question

Posted by Sebastian Estevez <se...@datastax.com>.
Yes, topology changes get pushed to the client via the control connection:

https://github.com/datastax/java-driver/blob/2.1/driver-core/src/main/java/com/datastax/driver/core/Cluster.java#L61

all the best,

Sebastián
On Feb 2, 2016 10:47 AM, "Richard L. Burton III" <mr...@gmail.com> wrote:

> In the case of adding more nodes to the cluster, would my application have
> to be restarted to detect the new nodes (as opposed to a node acting like a
> coordinator).
>
> e.g., Having the Java code connect using 3 known contact points and when a
> 4th and 5th node are added, the driver will become aware of these nodes
> without havng to be restarted?
>
> --
> -Richard L. Burton III
> @rburton
>