From user-return-24557-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Mon Mar 5 17:31:30 2012 Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AEE9D901F for ; Mon, 5 Mar 2012 17:31:30 +0000 (UTC) Received: (qmail 37585 invoked by uid 500); 5 Mar 2012 17:31:28 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 37566 invoked by uid 500); 5 Mar 2012 17:31:28 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 37558 invoked by uid 99); 5 Mar 2012 17:31:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Mar 2012 17:31:28 +0000 X-ASF-Spam-Status: No, hits=3.3 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,TRACKER_ID X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.113.200.5] (HELO homiemail-a57.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Mar 2012 17:31:21 +0000 Received: from homiemail-a57.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a57.g.dreamhost.com (Postfix) with ESMTP id 7E939208065 for ; Mon, 5 Mar 2012 09:30:54 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=thelastpickle.com; h=from :mime-version:content-type:subject:date:in-reply-to:to :references:message-id; q=dns; s=thelastpickle.com; b=R8h9elhnPd pMphgYhCr/v2C4xS5josB0KnWpCXozNw4TJQ46GxrbedibqaJg88Sq3BbtLkg9LY rmfFZNVmEkfJdVuDx37k+bO8t56rsB0pQ/ymnGJCFBBkp3yQE8HYz0N8J6iyamRY OV6n6q/HOL6IwIC5vI2/s4+rFQSZXDvDo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h=from :mime-version:content-type:subject:date:in-reply-to:to :references:message-id; s=thelastpickle.com; bh=maBMN6N0yJZQ3j1o k3eeDhJ0+no=; b=J1IB9d1nsWOsoZAkzUJTsXP8nFhPFQDbcActVVga2HlGVwYE bTmQVmh/vlmE6v+znQONjWPc6A8qIEA2XxhGiaEHofjhI3a628OCFoPKjfF/toom /LjyA7neXioYMQRZU3wEOBSnt/RJGcwvdetScYbtWAiVdh2RhvnnU7YK6YQ= Received: from [172.16.1.3] (125-236-193-159.adsl.xtra.co.nz [125.236.193.159]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a57.g.dreamhost.com (Postfix) with ESMTPSA id BCD5120801C for ; Mon, 5 Mar 2012 09:30:53 -0800 (PST) From: aaron morton Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: multipart/alternative; boundary="Apple-Mail=_D2607936-8742-47C9-9D49-34589FC2C59C" Subject: Re: running two rings on the same subnet Date: Tue, 6 Mar 2012 06:30:50 +1300 In-Reply-To: To: user@cassandra.apache.org References: <4F5497BE.5090001@flyordie.com> <2D29EBE9-C4BA-40DF-8C38-5ED93B5EAA4E@thelastpickle.com> Message-Id: <3B3F7CC8-1393-4E38-A9A0-02511EEE0C72@thelastpickle.com> X-Mailer: Apple Mail (2.1257) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_D2607936-8742-47C9-9D49-34589FC2C59C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Create nodes that do not share seeds, and give the clusters different = names as a safety measure.=20 Cheers ----------------- Aaron Morton Freelance Developer @aaronmorton http://www.thelastpickle.com On 6/03/2012, at 12:04 AM, Tamar Fraenkel wrote: > I want tow separate clusters. > Tamar Fraenkel=20 > Senior Software Engineer, TOK Media=20 >=20 > >=20 > tamar@tok-media.com > Tel: +972 2 6409736=20 > Mob: +972 54 8356490=20 > Fax: +972 2 5612956=20 >=20 >=20 >=20 >=20 >=20 > On Mon, Mar 5, 2012 at 12:48 PM, aaron morton = wrote: > Do you want to create two separate clusters or a single cluster with = two data centres ?=20 >=20 > If it's the later, token selection is discussed here = http://www.datastax.com/docs/1.0/install/cluster_init#token-gen-cassandra > =20 >> Moreover all tokens must be unique (even across datacenters), = although - from pure curiosity - I wonder what is the rationale behind = this. > Otherwise data is not evenly distributed. >=20 >> By the way, can someone enlighten me about the first line in the = output of the nodetool. Obviously it contains a token, but nothing else. = It seems like a formatting glitch, but maybe it has a role.=20 > It's the exclusive lower bound token for the first node in the ring. = This also happens to be the token for the last node in the ring.=20 >=20 > In your setup=20 > 10.0.0.19 "owns" (85070591730234615865843651857942052864+1) to 0 > 10.0.0.28 "owns" (0 + 1) to 85070591730234615865843651857942052864 >=20 > (does not imply primary replica, just used to map keys to nodes.) > =20 >=20 >=20 > ----------------- > Aaron Morton > Freelance Developer > @aaronmorton > http://www.thelastpickle.com >=20 > On 5/03/2012, at 11:38 PM, Hontv=E1ri J=F3zsef Levente wrote: >=20 >> You have to use PropertyFileSnitch and NetworkTopologyStrategy to = create a multi-datacenter setup with two circles. You can start reading = from this page: >> = http://www.datastax.com/docs/1.0/cluster_architecture/replication#about-re= plica-placement-strategy >>=20 >> Moreover all tokens must be unique (even across datacenters), = although - from pure curiosity - I wonder what is the rationale behind = this. >>=20 >> By the way, can someone enlighten me about the first line in the = output of the nodetool. Obviously it contains a token, but nothing else. = It seems like a formatting glitch, but maybe it has a role.=20 >>=20 >> On 2012.03.05. 11:06, Tamar Fraenkel wrote: >>> Hi! >>> I have a Cassandra cluster with two nodes >>>=20 >>> nodetool ring -h localhost >>> Address DC Rack Status State Load = Owns Token >>> = 85070591730234615865843651857942052864 >>> 10.0.0.19 datacenter1 rack1 Up Normal 488.74 KB = 50.00% 0 >>> 10.0.0.28 datacenter1 rack1 Up Normal 504.63 KB = 50.00% 85070591730234615865843651857942052864 >>>=20 >>> I want to create a second ring with the same name but two different = nodes. >>> using tokengentool I get the same tokens as they are affected from = the number of nodes in a ring. >>>=20 >>> My question is like this: >>> Lets say I create two new VMs, with IPs: 10.0.0.31 and 10.0.0.11 >>> In 10.0.0.31 cassandra.yaml I will set >>> initial_token: 0 >>> seeds: "10.0.0.31" >>> listen_address: 10.0.0.31 >>> rpc_address: 0.0.0.0 >>>=20 >>> In 10.0.0.11 cassandra.yaml I will set >>> initial_token: 85070591730234615865843651857942052864 >>> seeds: "10.0.0.31" >>> listen_address: 10.0.0.11 >>> rpc_address: 0.0.0.0=20 >>>=20 >>> Would the rings be separate? >>>=20 >>> Thanks, >>>=20 >>> Tamar Fraenkel=20 >>> Senior Software Engineer, TOK Media=20 >>>=20 >>> >>>=20 >>>=20 >>> tamar@tok-media.com >>> Tel: +972 2 6409736=20 >>> Mob: +972 54 8356490=20 >>> Fax: +972 2 5612956=20 >>>=20 >>>=20 >>>=20 >>=20 >=20 >=20 --Apple-Mail=_D2607936-8742-47C9-9D49-34589FC2C59C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-1
http://www.thelastpickle.com

On 6/03/2012, at 12:04 AM, Tamar Fraenkel wrote:

I want tow separate clusters.
Tamar Fraenkel 
Senior = Software Engineer, TOK Media 

<tokLogo.png>





On Mon, Mar 5, 2012 at 12:48 PM, = aaron morton <aaron@thelastpickle.com> wrote:
Do you want to create two separate = clusters or a single cluster with two data centres = ? 

If it's the later, token selection is = discussed here http://www.datastax.com/docs/1.0/install/cluster_init#to= ken-gen-cassandra
 
Moreover all tokens must be unique = (even across datacenters), although - from pure curiosity - I wonder = what is the rationale behind this.
Otherwise data is not evenly = distributed.

By the way, can = someone enlighten me about the first line in the output of the nodetool. = Obviously it contains a token, but nothing else. It seems like a = formatting glitch, but maybe it has a role. 
It's the exclusive lower bound token for the = first node in the ring. This also happens to be the token for the last = node in the ring. 

In your = setup 
10.0.0.19 = "owns" (85070591730234615865843651857942052864+1) = to 0
10.0.0.28 = "owns"  (0 + 1) = to 85070591730234615865843651857942052864=

(does not imply primary replica, just used to map keys to = nodes.)
 


-----------------
Aaron Morton
Freelance = Developer
@aaronmorton

On 5/03/2012, at 11:38 PM, = Hontv=E1ri J=F3zsef Levente wrote:

=20 =20 =20
You have to use PropertyFileSnitch and NetworkTopologyStrategy to create a multi-datacenter setup with two circles. You can start reading from this page:
http://www.datastax.com/docs/1.0/cluster_architecture/re= plication#about-replica-placement-strategy

Moreover all tokens must be unique (even across datacenters), although - from pure curiosity - I wonder what is the rationale behind this.

By the way, can someone enlighten me about the first line in the output of the nodetool. Obviously it contains a token, but nothing else. It seems like a formatting glitch, but maybe it has a role. =

On 2012.03.05. 11:06, Tamar Fraenkel wrote:
Hi!
I have a Cassandra  cluster with two nodes

nodetool ring -h = localhost
Address       =   DC          Rack        Status State   Load     =        Owns    Token
        =                     =                         =                     =        85070591730234615865843651857942052864
10.0.0.19       = datacenter1 rack1       Up     Normal  488.74 KB =       50.00%  0
10.0.0.28       = datacenter1 rack1       Up     Normal  504.63 KB =       50.00%  85070591730234615865843651857942052864

I want to create a second ring with the same name but two different nodes.
using tokengentool I get the same tokens as they are affected from the number of nodes in a ring.

My question is like this:
Lets say I create two new VMs, with IPs: 10.0.0.31 and 10.0.0.11
In 10.0.0.31 cassandra.yaml I will set
initial_token: 0
seeds: "10.0.0.31"
listen_address: 10.0.0.31
rpc_address: 0.0.0.0

In 10.0.0.11 cassandra.yaml I will = set
=
initial_token: 85070591730234615865843651857942052864
seeds: "10.0.0.31"
listen_address: 10.0.0.11
rpc_address: 0.0.0.0 

Would the rings be separate?

Thanks,

Tamar = Fraenkel 
Senior Software Engineer, TOK Media 

<Mail = Attachment.png>







= --Apple-Mail=_D2607936-8742-47C9-9D49-34589FC2C59C--