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 EDFD918488 for ; Sun, 4 Oct 2015 23:10:34 +0000 (UTC) Received: (qmail 16299 invoked by uid 500); 4 Oct 2015 23:10:32 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 16257 invoked by uid 500); 4 Oct 2015 23:10:32 -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 16247 invoked by uid 99); 4 Oct 2015 23:10:32 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Oct 2015 23:10:32 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id C0E85C247B for ; Sun, 4 Oct 2015 23:10:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.879 X-Spam-Level: **** X-Spam-Status: No, score=4.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, KAM_BADIPHTTP=2, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Te9b9-UNnX-Z for ; Sun, 4 Oct 2015 23:10:30 +0000 (UTC) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 66901439DF for ; Sun, 4 Oct 2015 23:10:30 +0000 (UTC) Received: by wicge5 with SMTP id ge5so97081456wic.0 for ; Sun, 04 Oct 2015 16:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type; bh=tyVdYTSJFkGmIk3DUtVGXp7vjP4T38FciCQYyNLWSaU=; b=ayNlTGZh5r+5tiyh71ULYowTSjJtp1lZrgI6Fesx/tIrHmHwr9FDTN3tvw4/KXHeAt T2VxdX1dTSV2DWuqzCLs61JMigYGdnIs6RjXJSBqpAMeHfWdkXIHCv4xuxWoD8RNyGdx VZzCBhPFKL65stzM62Dk+BCpwUGFpGnEkSS39GI35IaNI5Mr+Zrw3SAzgz2B7BCGO68H 1+zxpJjVpYXUXwVTuiPWhpIEONMTUv4STqcI/Un4EgSQUuKauFHi9rNO9Rwz7usVBNgg qKu6GWBLNbt3Kq4mZixLk+rPuMcIPe7V3ejwByWq2usw3WFliGfjTWo44o7eD3EO+BQg b1gA== X-Received: by 10.180.8.232 with SMTP id u8mr7830183wia.26.1444000229552; Sun, 04 Oct 2015 16:10:29 -0700 (PDT) Received: from [192.168.43.188] ([151.68.22.247]) by smtp.googlemail.com with ESMTPSA id jj8sm11484924wid.2.2015.10.04.16.10.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Oct 2015 16:10:28 -0700 (PDT) Subject: Re: Cassandra Configuration VS Static IPs. To: user@cassandra.apache.org References: <5611A135.5090200@gmail.com> <5611A997.2050401@gmail.com> From: Renato Perini Message-ID: <5611B1E2.4020601@gmail.com> Date: Mon, 5 Oct 2015 01:10:26 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------030007000000090304030507" This is a multi-part message in MIME format. --------------030007000000090304030507 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Yes, the client uses the same datacenter (us-west-2). Maybe I haven't explained well the situation. I'm not asking to connect to nodes *without* using a static IP address, but allowing Cassandra to determine the current public address at the time of connection. Spark, for example, uses shell scripts for configuration, so the public IP (in AWS) can be assigned using the command `|curl http://169.254.169.254/latest/meta-data/public-ipv4|`, whatever it is at the time of boot. Cassandra uses a yaml file for the main configuration, so this is impossibile to achieve. Basically I would like to make the client connect correctly on all nodes using their public IPs without being required to know them (the client would discover them dynamically while connecting). Il 05/10/2015 00:55, Jonathan Haddad ha scritto: > So you're not running the client in the same DC as your Cassandra > cluster. In that case you'll need to be able to connect to the public > address of all the nodes. Technically you could have a whitelist and > only connect to 1, I wouldn't recommend it. > > This is no different than any other database in that you would need a > public address to be able to connect to the servers from a machine not > in your datacenter. How else would you connect to them if you don't > provide access? > > On Sun, Oct 4, 2015 at 6:35 PM Renato Perini > wrote: > > Seems to be not the case when connecting to my (single) data > center using the java connector with a small client I have > developed for testing. > For the broadcast_rpc_address I have configured the local IP of > the nodes. The cluster works fine and nodes communicates fairly > well using their local IPs. When I connect to a node (let's say > node 1) from the outside using the java driver and the node's > public IP, the cluster discovery uses internal IPs for contacting > other nodes, leading to (obviously) errors. > > As for AWS, Elastic IPs are free as long as they're associated to > an instance and the machines are up 24h/7. I have to shut down the > machines during the night for various reasons, so unfortunately > they're not totally free for my use case. > > > > Il 05/10/2015 00:04, Jonathan Haddad ha scritto: >> Public IP? No, not required unless you're running multiple DCs. >> >> Where are you running a DC that IPs aren't cheap? If you're in >> AWS they're basically free (or at least the cheapest section of >> your bill by far) >> >> >> >> On Sun, Oct 4, 2015 at 5:59 PM Renato Perini >> > wrote: >> >> Is cassandra really supposed to have a static public IP for >> each and >> single node in the cluster? >> This seems to be expensive (static IPs are nor free neither >> cheap), >> still the broadcast_rpc_address expects a static IP for client >> communications (load balancing, contact points, etc.) >> Is there some mechanism to determine a public IP at runtime? >> >> Basically, I have nodes (machines) with dynamic public IPs >> and I cannot >> embed them in the cassandra.yaml file because of their >> dynamic nature >> (they change at each reboot). >> Any solution to this? >> >> Thanks. >> > --------------030007000000090304030507 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Yes, the client uses the same datacenter (us-west-2).
Maybe I haven't explained well the situation. I'm not asking to connect to nodes *without* using a static IP address, but allowing Cassandra to determine the current public address at the time of connection.
Spark, for example, uses shell scripts for configuration, so the public IP (in AWS) can be assigned using the command `curl http://169.254.169.254/latest/meta-data/public-ipv4`, whatever it is at the time of boot.
Cassandra uses a yaml file for the main configuration, so this is impossibile to achieve. Basically I would like to make the client connect correctly on all nodes using their public IPs without being required to know them (the client would discover them dynamically while connecting).

 
Il 05/10/2015 00:55, Jonathan Haddad ha scritto:
So you're not running the client in the same DC as your Cassandra cluster.  In that case you'll need to be able to connect to the public address of all the nodes.  Technically you could have a whitelist and only connect to 1, I wouldn't recommend it.

This is no different than any other database in that you would need a public address to be able to connect to the servers from a machine not in your datacenter.  How else would you connect to them if you don't provide access?

On Sun, Oct 4, 2015 at 6:35 PM Renato Perini <renato.perini@gmail.com> wrote:
Seems to be not the case when connecting to my (single) data center using the java connector with a small client I have developed for testing.
For the broadcast_rpc_address I have configured the local IP of the nodes. The cluster works fine and nodes communicates fairly well using their local IPs. When I connect to a node (let's say node 1) from the outside using the java driver and the node's public IP, the cluster discovery uses internal IPs for contacting other nodes, leading to (obviously) errors.

As for AWS, Elastic IPs are free as long as they're associated to an instance and the machines are up 24h/7. I have to shut down the machines during the night for various reasons, so unfortunately they're not totally free for my use case.



Il 05/10/2015 00:04, Jonathan Haddad ha scritto:
Public IP?  No, not required unless you're running multiple DCs.  

Where are you running a DC that IPs aren't cheap?  If you're in AWS they're basically free (or at least the cheapest section of your bill by far)



On Sun, Oct 4, 2015 at 5:59 PM Renato Perini <renato.perini@gmail.com> wrote:
Is cassandra really supposed to have a static public IP for each and
single node in the cluster?
This seems to be expensive (static IPs are nor free neither cheap),
still the broadcast_rpc_address expects a static IP for client
communications (load balancing, contact points, etc.)
Is there some mechanism to determine a public IP at runtime?

Basically, I have nodes (machines) with dynamic public IPs and I cannot
embed them in the cassandra.yaml file because of their dynamic nature
(they change at each reboot).
Any solution to this?

Thanks.


--------------030007000000090304030507--