You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Boris Solovyov <bo...@gmail.com> on 2013/02/12 20:56:02 UTC

Nodetool doesn't shows two nodes

I've configured 2-node cluster in EC2, key settings as follows:

cluster_name: 'TS'
num_tokens: 256
seed_provider:
    - class_name: org.apache.cassandra.locator.SimpleSeedProvider
      parameters:
          - seeds: "ec2-23-21-11-193.compute-1.amazonaws.com,
ec2-107-22-114-19.compute-1.amazonaws.com"
listen_address: 10.145.232.190
broadcast_address: ec2-23-21-11-193.compute-1.amazonaws.com
rpc_address: 0.0.0.0
endpoint_snitch: Ec2MultiRegionSnitch

On other node, it is similar, but of course the listen and broadcast
address are different. Now, when I start Cassandra, I see in the logs

INFO 19:35:32,348 JOINING: waiting for ring information

And then after 30 seconds, it says a bunch of things like this:

JOINING: schema complete, ready to bootstrap
JOINING: getting bootstrap token
Enqueuing flush of Memtable...
JOINING: sleeping 30000 ms for pending range setup
JOINING: Starting to bootstrap...
Bootstrap completed! for the tokens [....]

Finally, after some more memtable flushing,

INFO 19:36:32,710 Node /107.22.114.19 state jump to normal
INFO 19:36:32,722 Startup completed! Now serving reads.

Now, I start the other node, and I see basically the same thing in the logs.

Running nodetool status, I see what looks like two single-node clusters!

[root@ip-10-147-171-160 ~]# nodetool status
Datacenter: us-east
===================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address           Load       Tokens  Owns   Host ID
          Rack
UN  107.22.114.19     21 KB      256     100.0%
 f7a24bd2-8cb9-499d-806c-d9e548f34b8d  1a

[root@ip-10-145-232-190 ~]# nodetool status
Datacenter: us-east
===================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address           Load       Tokens  Owns   Host ID
          Rack
UN  23.21.11.193      21 KB      256     100.0%
 9d70f022-03cf-488a-807d-22e991761483  1a

It looks to me like nodes didn't communicate with each other like I thought
they would, and timed out waiting for gossip to tell them which nodes are
in the ring (I'm new to Cassandra, but this is my guess... certainly
30-second timeouts look suspicious). I checked with telnet, and from each
node I can connect to port 7000 on the other node (both on internal and
public IP). I feel like I have made a beginner's mistake. Anyone has a
suggestion where to look next?

- Boris

Re: Nodetool doesn't shows two nodes

Posted by Boris Solovyov <bo...@gmail.com>.
I don't think it is cloud at all, and I am no newcomer to sysadmin (though
am relative new to AWS cloud). The mistake is clearly mine, but also
clearly easy to make -- so I assume a lot of other people must make it too.
But the logs don't provide any guidance. Or is this another mistake I make,
which preventes the logs helping me?

Another thing I saw, by the way, the docs say you can clear out your
Cassandra data by "rm -rf /var/lib/cassandra/*" but actually it should be
/var/lib/cassandra/*/*. In RHEL setup, /var/lib/cassandra has root
ownership, so if you remove the 3 subdirectory  under it, Cassandra can't
create directories it needs to run. (I guess the docs assume you are
starting Cassandra by executing the binary, running it as root.) In any
case, if you then start the service, and the directories doesn't exists,
Cassandra dies. But what is the log message? Something totally obscure that
has nothing to do with "my data directory doesn't exists and I can't make
it" :-D

Dont' get me wrong, I am not complaining, so far things are going as well
as I expect from learning complex new opensource software! But just to
point out although all software cannot be perfect documented and have
perfect log messages, there probably 5% of problems/mistakes that made 95%
of time, and "firewall not open on port 7000" or "data directory not there"
seems in those, good idea to have helpful specific log messages. Now, that
my opinion, what is yours, should I file feature requests? As newcomer to
Cassandra I don't want to just walk in like bull in china shop and start
telling everyone what is wrong they should fix. To MAKE ME HAPPY :-D


On Mon, Feb 18, 2013 at 9:44 AM, Edward Capriolo <ed...@gmail.com>wrote:

> These issues are more cloud specific then they are cassandra specific.
> Cloud executives tell me in white papers that cloud is awesome and you
> can fire all your sysadmins and network people and save money.
>
> This is what happens when you believe cloud executives and their white
> papers, you spend 10+ hours troubleshooting cloud networking problems.
>
> On Mon, Feb 18, 2013 at 9:12 AM, Boris Solovyov
> <bo...@gmail.com> wrote:
> > I think it is actually more of a problem that there were no error
> messages
> > or other indication of what went wrong in the setup where the nodes
> couldn't
> > contact. Should I file issue report on this? Clearly Cassandra must have
> > tried to contact some IP on port 7000 and failed. Why didn't it log? That
> > would have saved me about 10 hours :-P
> >
> >
> > On Sun, Feb 17, 2013 at 11:54 PM, Jared Biel <
> jared.biel@bolderthinking.com>
> > wrote:
> >>
> >> This is something that I found while using the multi-region snitch -
> >> it uses public IPs for communication. See the original ticket here:
> >> https://issues.apache.org/jira/browse/CASSANDRA-2452. It'd be nice if
> >> it used the private IPs to communicate with nodes that are in the same
> >> region as itself, but I do not believe this is the case. Be aware that
> >> you will be charged for external data transfer even for nodes in the
> >> same region because the traffic will not fall under their free (for
> >> same AZ) or reduced (for intra-AZ) tiers.
> >>
> >> If you continue using this snitch in the mean time, it is not
> >> necessary (or recommended) to have those ports open to 0.0.0.0/0.
> >> You'll simply need to add the public IPs of your C* servers to the
> >> correct security group(s) to allow access.
> >>
> >> There's something else that's a little strange about the EC2 snitches:
> >> "us-east-1" is (incorrectly) represented as the datacenter "us-east".
> >> Other regions are recognized and named properly (us-west-2 for
> >> example) This is kind-of covered in the ticket here:
> >> https://issues.apache.org/jira/browse/CASSANDRA-4026 I wish it could
> >> be fixed properly.
> >>
> >> Good luck!
> >>
> >>
> >> On 17 February 2013 16:16, Boris Solovyov <bo...@gmail.com>
> >> wrote:
> >> > OK. I got it. I realized that storage_port wasn't actually open
> between
> >> > the
> >> > nodes, because it is using the public IP. (I did find this information
> >> > in
> >> > the docs, after looking more... it is in section on "Types of
> snitches."
> >> > It
> >> > explains everything I found by try and error.)
> >> >
> >> > After opening this port 7000 to all IP addresses, the cluster boots OK
> >> > and
> >> > the two nodes see each other. Now I have the happy result. But my
> nodes
> >> > are
> >> > wide open to the entire internet on port 7000. This is a serious
> >> > problem.
> >> > This obviously can't be put into production.
> >> >
> >> > I definitely need cross-continent deployment. Single AZ or single
> region
> >> > deployment is not going to be enough. How do people solve this in
> >> > practice?
> >
> >
>

Re: Nodetool doesn't shows two nodes

Posted by Edward Capriolo <ed...@gmail.com>.
These issues are more cloud specific then they are cassandra specific.
Cloud executives tell me in white papers that cloud is awesome and you
can fire all your sysadmins and network people and save money.

This is what happens when you believe cloud executives and their white
papers, you spend 10+ hours troubleshooting cloud networking problems.

On Mon, Feb 18, 2013 at 9:12 AM, Boris Solovyov
<bo...@gmail.com> wrote:
> I think it is actually more of a problem that there were no error messages
> or other indication of what went wrong in the setup where the nodes couldn't
> contact. Should I file issue report on this? Clearly Cassandra must have
> tried to contact some IP on port 7000 and failed. Why didn't it log? That
> would have saved me about 10 hours :-P
>
>
> On Sun, Feb 17, 2013 at 11:54 PM, Jared Biel <ja...@bolderthinking.com>
> wrote:
>>
>> This is something that I found while using the multi-region snitch -
>> it uses public IPs for communication. See the original ticket here:
>> https://issues.apache.org/jira/browse/CASSANDRA-2452. It'd be nice if
>> it used the private IPs to communicate with nodes that are in the same
>> region as itself, but I do not believe this is the case. Be aware that
>> you will be charged for external data transfer even for nodes in the
>> same region because the traffic will not fall under their free (for
>> same AZ) or reduced (for intra-AZ) tiers.
>>
>> If you continue using this snitch in the mean time, it is not
>> necessary (or recommended) to have those ports open to 0.0.0.0/0.
>> You'll simply need to add the public IPs of your C* servers to the
>> correct security group(s) to allow access.
>>
>> There's something else that's a little strange about the EC2 snitches:
>> "us-east-1" is (incorrectly) represented as the datacenter "us-east".
>> Other regions are recognized and named properly (us-west-2 for
>> example) This is kind-of covered in the ticket here:
>> https://issues.apache.org/jira/browse/CASSANDRA-4026 I wish it could
>> be fixed properly.
>>
>> Good luck!
>>
>>
>> On 17 February 2013 16:16, Boris Solovyov <bo...@gmail.com>
>> wrote:
>> > OK. I got it. I realized that storage_port wasn't actually open between
>> > the
>> > nodes, because it is using the public IP. (I did find this information
>> > in
>> > the docs, after looking more... it is in section on "Types of snitches."
>> > It
>> > explains everything I found by try and error.)
>> >
>> > After opening this port 7000 to all IP addresses, the cluster boots OK
>> > and
>> > the two nodes see each other. Now I have the happy result. But my nodes
>> > are
>> > wide open to the entire internet on port 7000. This is a serious
>> > problem.
>> > This obviously can't be put into production.
>> >
>> > I definitely need cross-continent deployment. Single AZ or single region
>> > deployment is not going to be enough. How do people solve this in
>> > practice?
>
>

Re: Nodetool doesn't shows two nodes

Posted by Boris Solovyov <bo...@gmail.com>.
I think it is actually more of a problem that there were no error messages
or other indication of what went wrong in the setup where the nodes
couldn't contact. Should I file issue report on this? Clearly Cassandra
must have tried to contact some IP on port 7000 and failed. Why didn't it
log? That would have saved me about 10 hours :-P


On Sun, Feb 17, 2013 at 11:54 PM, Jared Biel
<ja...@bolderthinking.com>wrote:

> This is something that I found while using the multi-region snitch -
> it uses public IPs for communication. See the original ticket here:
> https://issues.apache.org/jira/browse/CASSANDRA-2452. It'd be nice if
> it used the private IPs to communicate with nodes that are in the same
> region as itself, but I do not believe this is the case. Be aware that
> you will be charged for external data transfer even for nodes in the
> same region because the traffic will not fall under their free (for
> same AZ) or reduced (for intra-AZ) tiers.
>
> If you continue using this snitch in the mean time, it is not
> necessary (or recommended) to have those ports open to 0.0.0.0/0.
> You'll simply need to add the public IPs of your C* servers to the
> correct security group(s) to allow access.
>
> There's something else that's a little strange about the EC2 snitches:
> "us-east-1" is (incorrectly) represented as the datacenter "us-east".
> Other regions are recognized and named properly (us-west-2 for
> example) This is kind-of covered in the ticket here:
> https://issues.apache.org/jira/browse/CASSANDRA-4026 I wish it could
> be fixed properly.
>
> Good luck!
>
>
> On 17 February 2013 16:16, Boris Solovyov <bo...@gmail.com>
> wrote:
> > OK. I got it. I realized that storage_port wasn't actually open between
> the
> > nodes, because it is using the public IP. (I did find this information in
> > the docs, after looking more... it is in section on "Types of snitches."
> It
> > explains everything I found by try and error.)
> >
> > After opening this port 7000 to all IP addresses, the cluster boots OK
> and
> > the two nodes see each other. Now I have the happy result. But my nodes
> are
> > wide open to the entire internet on port 7000. This is a serious problem.
> > This obviously can't be put into production.
> >
> > I definitely need cross-continent deployment. Single AZ or single region
> > deployment is not going to be enough. How do people solve this in
> practice?
>

Re: Nodetool doesn't shows two nodes

Posted by Jared Biel <ja...@bolderthinking.com>.
This is something that I found while using the multi-region snitch -
it uses public IPs for communication. See the original ticket here:
https://issues.apache.org/jira/browse/CASSANDRA-2452. It'd be nice if
it used the private IPs to communicate with nodes that are in the same
region as itself, but I do not believe this is the case. Be aware that
you will be charged for external data transfer even for nodes in the
same region because the traffic will not fall under their free (for
same AZ) or reduced (for intra-AZ) tiers.

If you continue using this snitch in the mean time, it is not
necessary (or recommended) to have those ports open to 0.0.0.0/0.
You'll simply need to add the public IPs of your C* servers to the
correct security group(s) to allow access.

There's something else that's a little strange about the EC2 snitches:
"us-east-1" is (incorrectly) represented as the datacenter "us-east".
Other regions are recognized and named properly (us-west-2 for
example) This is kind-of covered in the ticket here:
https://issues.apache.org/jira/browse/CASSANDRA-4026 I wish it could
be fixed properly.

Good luck!


On 17 February 2013 16:16, Boris Solovyov <bo...@gmail.com> wrote:
> OK. I got it. I realized that storage_port wasn't actually open between the
> nodes, because it is using the public IP. (I did find this information in
> the docs, after looking more... it is in section on "Types of snitches." It
> explains everything I found by try and error.)
>
> After opening this port 7000 to all IP addresses, the cluster boots OK and
> the two nodes see each other. Now I have the happy result. But my nodes are
> wide open to the entire internet on port 7000. This is a serious problem.
> This obviously can't be put into production.
>
> I definitely need cross-continent deployment. Single AZ or single region
> deployment is not going to be enough. How do people solve this in practice?

Re: Nodetool doesn't shows two nodes

Posted by Boris Solovyov <bo...@gmail.com>.
OK. I got it. I realized that storage_port wasn't actually open between the
nodes, because it is using the public IP. (I did find this information in
the docs, after looking more... it is in section on "Types of snitches." It
explains everything I found by try and error.)

After opening this port 7000 to all IP addresses, the cluster boots OK and
the two nodes see each other. Now I have the happy result. But my nodes are
wide open to the entire internet on port 7000. This is a serious problem.
This obviously can't be put into production.

I definitely need cross-continent deployment. Single AZ or single region
deployment is not going to be enough. How do people solve this in practice?

Re: Nodetool doesn't shows two nodes

Posted by Boris Solovyov <bo...@gmail.com>.
No, it doesn't works, same thing: both nodes seems to just exist solo and I
have 2 single-node clusters :-( OK, so now I am confused, and hope list
will help me out. To understand what wrong, I think I need to know what
happens in node bootstrap, and in node join ring. Who does node
communicate, on which address? What information it exchanges? What happens
then? What this process looks like normally?

I have read all docs, several time, don't think I missed it, so it might
not be explain there clearly. I will look again, and look to source code
next.

- Boris


On Sun, Feb 17, 2013 at 4:48 PM, Boris Solovyov <bo...@gmail.com>wrote:

> Aha! I think I might have something breakthrough. I tried setting public
> IP in listen_address (and therefore in broadcast_address, because as I
> understand it inherits if it is commented out), and in seeds list.  Node
> fails to start, because Cassandra cannot bind to public IP address: it does
> not exists on box. Of course! This is why I cannot see it in ifconfig.
>
> SO, my next theory,
>
>    - set listen_address to private IP
>    - set broadcast_address to public IP, tells other nodes how to connect
>    - set seeds to public IP
>
> I will try this next and continue flood your inbox with stream of
> consciousness try-and-error ;-)
>

Re: Nodetool doesn't shows two nodes

Posted by Boris Solovyov <bo...@gmail.com>.
Aha! I think I might have something breakthrough. I tried setting public IP
in listen_address (and therefore in broadcast_address, because as I
understand it inherits if it is commented out), and in seeds list.  Node
fails to start, because Cassandra cannot bind to public IP address: it does
not exists on box. Of course! This is why I cannot see it in ifconfig.

SO, my next theory,

   - set listen_address to private IP
   - set broadcast_address to public IP, tells other nodes how to connect
   - set seeds to public IP

I will try this next and continue flood your inbox with stream of
consciousness try-and-error ;-)

Re: Nodetool doesn't shows two nodes

Posted by Boris Solovyov <bo...@gmail.com>.
Hi,

I've checked all things Alain suggested and set up a fresh 2-node cluster,
and I still get the same result: each node lists itself as only one.

This time I made the following changes:

   - I set listen_address to the public DNS name. Internally, AWS's DNS
   will map this to the 10.x IP, so this should work correctlly if I
   understand right. These are new EC2 instances, and I did not trust
   configured hostname or so on.
   - I opened all ports between nodes in security group.
   - I kept the snitch at Ec2MultiRegionSnitch. This cluster is small now
   but it will be very large and nationwide if I succeed and choose Cassandra
   for this purpose. Do I right understand that it is not possible to change
   this later, or at least is not easy?
   - I ensured all Alain suggestions, for example cluster_name is same with
   all nodes.
   - I set seed list to public DNS name of first node. This is identical on
   both node.
   - I checked Alain's suggest about auto_bootstrap. Docs say this is not
   needed to set. Is this docs wrong? (I look at DataStax 1.2 PDF docs)

Here is some more debugging evidence. On node 1, the seed,

[root@ip-10-113-19-24 ~]# ifconfig | grep inet.addr
          inet addr:10.113.19.24  Bcast:10.113.19.255  Mask:255.255.254.0
[root@ip-10-113-19-24 ~]# nodetool status
Datacenter: us-east
===================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address           Load       Tokens  Owns   Host ID
          Rack
UN  23.22.204.201     20.97 KB   256     100.0%
 4fadd4fd-c57c-4172-95aa-092368ba5743  1a
[root@ip-10-113-19-24 ~]# netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address
State       PID/Program name
tcp        0      0 0.0.0.0:7199                0.0.0.0:*
LISTEN      1910/java
tcp        0      0 0.0.0.0:47298               0.0.0.0:*
LISTEN      1910/java
tcp        0      0 0.0.0.0:57030               0.0.0.0:*
LISTEN      1910/java
tcp        0      0 0.0.0.0:9160                0.0.0.0:*
LISTEN      1910/java
tcp        0      0 0.0.0.0:9042                0.0.0.0:*
LISTEN      1910/java
tcp        0      0 0.0.0.0:22                  0.0.0.0:*
LISTEN      1231/sshd
tcp        0      0 10.113.19.24:7000           0.0.0.0:*
LISTEN      1910/java
tcp        0      1 10.113.19.24:38948          54.234.147.60:7000
 SYN_SENT    1910/java
tcp        0      0 10.113.19.24:7000           10.113.19.24:45328
 ESTABLISHED 1910/java
tcp        0      0 10.113.19.24:7000           10.114.205.157:47713
 ESTABLISHED 1910/java
tcp        0      1 10.113.19.24:45597          23.22.204.201:7000
 SYN_SENT    1910/java
tcp        0      0 10.113.19.24:45328          10.113.19.24:7000
ESTABLISHED 1910/java

And in the log,

 INFO 20:58:12,472 Node /23.22.204.201 state jump to normal
 INFO 20:58:12,482 Startup completed! Now serving reads.

Now, this looks similar to the problem before with the private IP addresses
being used some times, public other times. By the way, the other node,
whose internal IP address is 10.114.205.157, is connected to this seed node
as you can see.

I think I could understand this problem if I understand which types of
network connections I should expect to see in the netstat, and what output
I should expect to see in the log. Can someone with more experience tell me
what is wrong/unexpected above? And am I working against Amazon's
architecture by using IPs the way I do?

While I wait for answer, I will shut down, delete all data, and reconfigure
with public IP addresses explicitly and not use DNS names :-) I have a
feeling this is the problem. From within Amazon EC2 server, requesting DNS
for a public DNS name returns the private IP address. (However, I still
feel unsure about what is right way to do this, because I do not know if
Cassandra will use DNS resolve and end up trying to connect to a private IP
that Cassandra is not listening.)

Thanks,
- Boris



On Wed, Feb 13, 2013 at 10:37 AM, Boris Solovyov
<bo...@gmail.com>wrote:

> Thank you Alain. I will check the things you suggest and report my results.
>
> - Boris
>
>
> On Wed, Feb 13, 2013 at 7:54 AM, Alain RODRIGUEZ <ar...@gmail.com>wrote:
>
>> Hi Boris.
>>
>> "I feel like I have made a beginner's mistake"
>> That's an horrible feeling :D. I'll try to help ;)
>>
>> "cluster_name: 'TS'"
>> Are you sure you used the same name for both node ?
>>
>> "I can connect to port 7000"
>> You can check all the ports needed there
>> http://www.datastax.com/docs/1.2/install/install_ami and open them in
>> security group once and for all so you won't be wondering this anymore.
>>
>> "listen_address: 10.145.232.190"
>> "INFO 19:36:32,710 Node /107.22.114.19 state jump to normal"
>> There is "10.145.232.190" defined as listen address and you logs says
>> that 107.22.114.19 joined the ring and your second ip seems to be
>> 23.21.11.193... When you stop an EC2 server, its internal ip may change.
>> So I recommend you not to do so, but restart them instead. Anyway you
>> should use instance stores and not EBS, and Instance Store can't be stopped
>> so you won't have this issue anymore. Don't trust ip-10-145-232-190
>> which is configured at first start in /etc/hostname.
>>
>> "endpoint_snitch: Ec2MultiRegionSnitch"
>> Maybe should you use endpoint_snitch: Ec2Snitch since all your servers
>> are in the same zone. You will have to use privates ip everywhere and
>> comment the broadcast_address if you do so.
>>
>>
>> The first node has to start with auto_bootsrap: false, while the 2nd one
>> could use auto_bootsrap: true. Seeds node must be your first node only, a
>> bootstrapping node mustn't be defined as a seed.
>>
>> "my guess... certainly 30-second timeouts look suspicious"
>> This is not a timeout but rather a sleep and it is a normal wait while
>> adding a node.
>>
>> Since your a new user, I guess you have no data. If you want to try some
>> conf you can always "reset" your cassandra node by removing .../cassandra/*
>> (commitlog, data and saved_caches) after stopping Cassandra.
>>
>> Good luck with this.
>>
>>  Alain
>>
>>
>> 2013/2/12 Boris Solovyov <bo...@gmail.com>
>>
>>> I've configured 2-node cluster in EC2, key settings as follows:
>>>
>>> cluster_name: 'TS'
>>> num_tokens: 256
>>> seed_provider:
>>>     - class_name: org.apache.cassandra.locator.SimpleSeedProvider
>>>       parameters:
>>>           - seeds: "ec2-23-21-11-193.compute-1.amazonaws.com,
>>> ec2-107-22-114-19.compute-1.amazonaws.com"
>>> listen_address: 10.145.232.190
>>> broadcast_address: ec2-23-21-11-193.compute-1.amazonaws.com
>>> rpc_address: 0.0.0.0
>>>  endpoint_snitch: Ec2MultiRegionSnitch
>>>
>>> On other node, it is similar, but of course the listen and broadcast
>>> address are different. Now, when I start Cassandra, I see in the logs
>>>
>>> INFO 19:35:32,348 JOINING: waiting for ring information
>>>
>>> And then after 30 seconds, it says a bunch of things like this:
>>>
>>> JOINING: schema complete, ready to bootstrap
>>> JOINING: getting bootstrap token
>>> Enqueuing flush of Memtable...
>>> JOINING: sleeping 30000 ms for pending range setup
>>> JOINING: Starting to bootstrap...
>>> Bootstrap completed! for the tokens [....]
>>>
>>> Finally, after some more memtable flushing,
>>>
>>> INFO 19:36:32,710 Node /107.22.114.19 state jump to normal
>>> INFO 19:36:32,722 Startup completed! Now serving reads.
>>>
>>> Now, I start the other node, and I see basically the same thing in the
>>> logs.
>>>
>>> Running nodetool status, I see what looks like two single-node clusters!
>>>
>>> [root@ip-10-147-171-160 ~]# nodetool status
>>> Datacenter: us-east
>>> ===================
>>> Status=Up/Down
>>> |/ State=Normal/Leaving/Joining/Moving
>>> --  Address           Load       Tokens  Owns   Host ID
>>>               Rack
>>> UN  107.22.114.19     21 KB      256     100.0%
>>>  f7a24bd2-8cb9-499d-806c-d9e548f34b8d  1a
>>>
>>> [root@ip-10-145-232-190 ~]# nodetool status
>>> Datacenter: us-east
>>> ===================
>>> Status=Up/Down
>>> |/ State=Normal/Leaving/Joining/Moving
>>> --  Address           Load       Tokens  Owns   Host ID
>>>               Rack
>>> UN  23.21.11.193      21 KB      256     100.0%
>>>  9d70f022-03cf-488a-807d-22e991761483  1a
>>>
>>> It looks to me like nodes didn't communicate with each other like I
>>> thought they would, and timed out waiting for gossip to tell them which
>>> nodes are in the ring (I'm new to Cassandra, but this is my guess...
>>> certainly 30-second timeouts look suspicious). I checked with telnet, and
>>> from each node I can connect to port 7000 on the other node (both on
>>> internal and public IP). I feel like I have made a beginner's mistake.
>>> Anyone has a suggestion where to look next?
>>>
>>> - Boris
>>>
>>
>>
>

Re: Nodetool doesn't shows two nodes

Posted by Boris Solovyov <bo...@gmail.com>.
Thank you Alain. I will check the things you suggest and report my results.

- Boris


On Wed, Feb 13, 2013 at 7:54 AM, Alain RODRIGUEZ <ar...@gmail.com> wrote:

> Hi Boris.
>
> "I feel like I have made a beginner's mistake"
> That's an horrible feeling :D. I'll try to help ;)
>
> "cluster_name: 'TS'"
> Are you sure you used the same name for both node ?
>
> "I can connect to port 7000"
> You can check all the ports needed there
> http://www.datastax.com/docs/1.2/install/install_ami and open them in
> security group once and for all so you won't be wondering this anymore.
>
> "listen_address: 10.145.232.190"
> "INFO 19:36:32,710 Node /107.22.114.19 state jump to normal"
> There is "10.145.232.190" defined as listen address and you logs says
> that 107.22.114.19 joined the ring and your second ip seems to be
> 23.21.11.193... When you stop an EC2 server, its internal ip may change.
> So I recommend you not to do so, but restart them instead. Anyway you
> should use instance stores and not EBS, and Instance Store can't be stopped
> so you won't have this issue anymore. Don't trust ip-10-145-232-190 which
> is configured at first start in /etc/hostname.
>
> "endpoint_snitch: Ec2MultiRegionSnitch"
> Maybe should you use endpoint_snitch: Ec2Snitch since all your servers are
> in the same zone. You will have to use privates ip everywhere and comment
> the broadcast_address if you do so.
>
>
> The first node has to start with auto_bootsrap: false, while the 2nd one
> could use auto_bootsrap: true. Seeds node must be your first node only, a
> bootstrapping node mustn't be defined as a seed.
>
> "my guess... certainly 30-second timeouts look suspicious"
> This is not a timeout but rather a sleep and it is a normal wait while
> adding a node.
>
> Since your a new user, I guess you have no data. If you want to try some
> conf you can always "reset" your cassandra node by removing .../cassandra/*
> (commitlog, data and saved_caches) after stopping Cassandra.
>
> Good luck with this.
>
>  Alain
>
>
> 2013/2/12 Boris Solovyov <bo...@gmail.com>
>
>> I've configured 2-node cluster in EC2, key settings as follows:
>>
>> cluster_name: 'TS'
>> num_tokens: 256
>> seed_provider:
>>     - class_name: org.apache.cassandra.locator.SimpleSeedProvider
>>       parameters:
>>           - seeds: "ec2-23-21-11-193.compute-1.amazonaws.com,
>> ec2-107-22-114-19.compute-1.amazonaws.com"
>> listen_address: 10.145.232.190
>> broadcast_address: ec2-23-21-11-193.compute-1.amazonaws.com
>> rpc_address: 0.0.0.0
>>  endpoint_snitch: Ec2MultiRegionSnitch
>>
>> On other node, it is similar, but of course the listen and broadcast
>> address are different. Now, when I start Cassandra, I see in the logs
>>
>> INFO 19:35:32,348 JOINING: waiting for ring information
>>
>> And then after 30 seconds, it says a bunch of things like this:
>>
>> JOINING: schema complete, ready to bootstrap
>> JOINING: getting bootstrap token
>> Enqueuing flush of Memtable...
>> JOINING: sleeping 30000 ms for pending range setup
>> JOINING: Starting to bootstrap...
>> Bootstrap completed! for the tokens [....]
>>
>> Finally, after some more memtable flushing,
>>
>> INFO 19:36:32,710 Node /107.22.114.19 state jump to normal
>> INFO 19:36:32,722 Startup completed! Now serving reads.
>>
>> Now, I start the other node, and I see basically the same thing in the
>> logs.
>>
>> Running nodetool status, I see what looks like two single-node clusters!
>>
>> [root@ip-10-147-171-160 ~]# nodetool status
>> Datacenter: us-east
>> ===================
>> Status=Up/Down
>> |/ State=Normal/Leaving/Joining/Moving
>> --  Address           Load       Tokens  Owns   Host ID
>>             Rack
>> UN  107.22.114.19     21 KB      256     100.0%
>>  f7a24bd2-8cb9-499d-806c-d9e548f34b8d  1a
>>
>> [root@ip-10-145-232-190 ~]# nodetool status
>> Datacenter: us-east
>> ===================
>> Status=Up/Down
>> |/ State=Normal/Leaving/Joining/Moving
>> --  Address           Load       Tokens  Owns   Host ID
>>             Rack
>> UN  23.21.11.193      21 KB      256     100.0%
>>  9d70f022-03cf-488a-807d-22e991761483  1a
>>
>> It looks to me like nodes didn't communicate with each other like I
>> thought they would, and timed out waiting for gossip to tell them which
>> nodes are in the ring (I'm new to Cassandra, but this is my guess...
>> certainly 30-second timeouts look suspicious). I checked with telnet, and
>> from each node I can connect to port 7000 on the other node (both on
>> internal and public IP). I feel like I have made a beginner's mistake.
>> Anyone has a suggestion where to look next?
>>
>> - Boris
>>
>
>

Re: Nodetool doesn't shows two nodes

Posted by Alain RODRIGUEZ <ar...@gmail.com>.
Hi Boris.

"I feel like I have made a beginner's mistake"
That's an horrible feeling :D. I'll try to help ;)

"cluster_name: 'TS'"
Are you sure you used the same name for both node ?

"I can connect to port 7000"
You can check all the ports needed there
http://www.datastax.com/docs/1.2/install/install_ami and open them in
security group once and for all so you won't be wondering this anymore.

"listen_address: 10.145.232.190"
"INFO 19:36:32,710 Node /107.22.114.19 state jump to normal"
There is "10.145.232.190" defined as listen address and you logs says
that 107.22.114.19
joined the ring and your second ip seems to be 23.21.11.193... When you
stop an EC2 server, its internal ip may change. So I recommend you not to
do so, but restart them instead. Anyway you should use instance stores and
not EBS, and Instance Store can't be stopped so you won't have this issue
anymore. Don't trust ip-10-145-232-190 which is configured at first start
in /etc/hostname.

"endpoint_snitch: Ec2MultiRegionSnitch"
Maybe should you use endpoint_snitch: Ec2Snitch since all your servers are
in the same zone. You will have to use privates ip everywhere and comment
the broadcast_address if you do so.


The first node has to start with auto_bootsrap: false, while the 2nd one
could use auto_bootsrap: true. Seeds node must be your first node only, a
bootstrapping node mustn't be defined as a seed.

"my guess... certainly 30-second timeouts look suspicious"
This is not a timeout but rather a sleep and it is a normal wait while
adding a node.

Since your a new user, I guess you have no data. If you want to try some
conf you can always "reset" your cassandra node by removing .../cassandra/*
(commitlog, data and saved_caches) after stopping Cassandra.

Good luck with this.

Alain


2013/2/12 Boris Solovyov <bo...@gmail.com>

> I've configured 2-node cluster in EC2, key settings as follows:
>
> cluster_name: 'TS'
> num_tokens: 256
> seed_provider:
>     - class_name: org.apache.cassandra.locator.SimpleSeedProvider
>       parameters:
>           - seeds: "ec2-23-21-11-193.compute-1.amazonaws.com,
> ec2-107-22-114-19.compute-1.amazonaws.com"
> listen_address: 10.145.232.190
> broadcast_address: ec2-23-21-11-193.compute-1.amazonaws.com
> rpc_address: 0.0.0.0
>  endpoint_snitch: Ec2MultiRegionSnitch
>
> On other node, it is similar, but of course the listen and broadcast
> address are different. Now, when I start Cassandra, I see in the logs
>
> INFO 19:35:32,348 JOINING: waiting for ring information
>
> And then after 30 seconds, it says a bunch of things like this:
>
> JOINING: schema complete, ready to bootstrap
> JOINING: getting bootstrap token
> Enqueuing flush of Memtable...
> JOINING: sleeping 30000 ms for pending range setup
> JOINING: Starting to bootstrap...
> Bootstrap completed! for the tokens [....]
>
> Finally, after some more memtable flushing,
>
> INFO 19:36:32,710 Node /107.22.114.19 state jump to normal
> INFO 19:36:32,722 Startup completed! Now serving reads.
>
> Now, I start the other node, and I see basically the same thing in the
> logs.
>
> Running nodetool status, I see what looks like two single-node clusters!
>
> [root@ip-10-147-171-160 ~]# nodetool status
> Datacenter: us-east
> ===================
> Status=Up/Down
> |/ State=Normal/Leaving/Joining/Moving
> --  Address           Load       Tokens  Owns   Host ID
>             Rack
> UN  107.22.114.19     21 KB      256     100.0%
>  f7a24bd2-8cb9-499d-806c-d9e548f34b8d  1a
>
> [root@ip-10-145-232-190 ~]# nodetool status
> Datacenter: us-east
> ===================
> Status=Up/Down
> |/ State=Normal/Leaving/Joining/Moving
> --  Address           Load       Tokens  Owns   Host ID
>             Rack
> UN  23.21.11.193      21 KB      256     100.0%
>  9d70f022-03cf-488a-807d-22e991761483  1a
>
> It looks to me like nodes didn't communicate with each other like I
> thought they would, and timed out waiting for gossip to tell them which
> nodes are in the ring (I'm new to Cassandra, but this is my guess...
> certainly 30-second timeouts look suspicious). I checked with telnet, and
> from each node I can connect to port 7000 on the other node (both on
> internal and public IP). I feel like I have made a beginner's mistake.
> Anyone has a suggestion where to look next?
>
> - Boris
>