Google up NetworkTopologyStrategy. This is what you want to use and it's
not configured in cassandra.yaml but when you create the keyspace.

Basically, you define your topology in cassandra-topology.yaml (where you
basically manually set which node is in which DC, which you can really just
see as assigning nodes to named groups) and then you can define the
replication factor for each DC (so if RF=1 on the 1 node group and 0 on the
"other nodes" group, C* will gladly honor it and store no data on node of
the "other nodes" group).

--
Sylvain


On Wed, Dec 18, 2013 at 1:32 PM, Colin MacDonald <colin.macdon...@sas.com>wrote:

> > -----Original Message-----
> > From: Sylvain Lebresne [mailto:sylv...@datastax.com]
> > Sent: 18 December 2013 10:45
> >
> > You seem to be well aware that you're not looking at using Cassandra for
> > what it is designed for (which obviously imply you'll need to expect
> under-
> > optimal behavior), so I'm not going to insist on it.
>
> Very kind of you. ;)
>
> I'm suspect that that this requirement is viscerally horrifying, but as I
> said, it's idiosyncratic, specified by an... idiosyncrat.
>
> It's a pragmatic solution that I'm looking for, just to get a proof of
> concept going, it doesn't have to be elegant at this stage.
>
> > As to how you could achieve that, a relatively simple solution (that do
> not
> > require writing your own partitioner) would consist in using 2
> datacenters
> > (that obviously don't have to be real physical datacenter), to put the
> one that
> > should have it all in one datacenter with RF=1 and to pull all other
> nodes in
> > the other datacenter with RF=0.
> >
> > As Janne said, you could still have hint being written by other nodes if
> the
> > one storage node is dead, but you can use the system property
> > cassandra.maxHintTTL to 0 to disable hints.
>
> Thanks Sylvain, I'll look into that.  I'm coming to Cassandra cold, I
> hadn't even spotted that the replication factor was configurable - I don't
> see an option for in the cassandra.yaml that came with 2.0.2.  I should be
> able to figure it out though, and that's great news, it looks like it takes
> care of one issue.
>
> However, I'm not immediately seeing how to control which node will get the
> single copy of the data.  Won't the partitioner still allocate data around
> the cluster?
>
> Ah, is a "datacentre" a logical group *within* an overall cluster?  So I
> can create a separate "datacentre" for each node, and if I write to that
> node the data will be forced to stay in that datacentre, i.e. that node?
>
> I do apologise for the noobish questions, my attention is currently split
> between investigating several possible solutions.  I rather favour
> Cassandra though, if I can hobble it appropriately.
>
> Kind regards,
>
> -Colin MacDonald-
>
>

Reply via email to