You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by osishkin osishkin <os...@gmail.com> on 2010/07/11 17:15:43 UTC

Strange "Address already in use" error

I'm testing a simple Cassandra cluster on two machines. For some reaon
after a while one of the nodes in the cluster crashes.
At first I thought the fault was on me, so I simply started it up again.
After the second time this happenned I noticed the following message errors -

 INFO 17:28:05,624 Mycolumnfamily has reached its threshold; switching
in a fresh Memtable at
CommitLogContext(file='/var/lib/cassandra/commitlogMY/CommitLog-1278858485610.log',
position=116)
 INFO 17:28:05,625 Enqueuing flush of Memtable(Mycolumnfamily)@1499027801
 INFO 17:28:05,672 Writing Memtable(Mycolumnfamily)@1499027801
 INFO 17:28:05,730 Completed flushing
/var/lib/cassandra/dataMY/MYKeyspace1/Mycolumnfamily-27-Data.db
 INFO 17:28:05,731 Log replay complete
 INFO 17:28:05,756 Saved Token found: 66090367128402196046887347762075208662
 INFO 17:28:05,756 Saved ClusterName found: MY Cluster
 WARN 17:28:05,760 Unable to start GCInspector (currently only
supported on the Sun JVM)
 INFO 17:28:05,760 Starting up server gossip
ERROR 17:28:05,766 Exception encountered during startup.
java.net.BindException: Address already in use
        at sun.nio.ch.Net.bind(Native Method)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:137)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:52)
        at org.apache.cassandra.net.MessagingService.listen(MessagingService.java:138)
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:328)
        at org.apache.cassandra.thrift.CassandraDaemon.setup(CassandraDaemon.java:99)
        at org.apache.cassandra.thrift.CassandraDaemon.main(CassandraDaemon.java:177)
Exception encountered during startup.

Obviously nothing has changed on the machines, I'm using default ports
that aren't taken by any other application (I saw people had problems
with 8080, but it's not used on my machines. 9160 isn't either). When
I started up cassandra again on both nodes, things worked just fine
(until further notice at least).
So I'm kind of at a loss here.

Any idea as to what is wrong would be appreciated
Thank you.

Re: Strange "Address already in use" error

Posted by Roger Schildmeijer <sc...@gmail.com>.
Something is already using the port (probably 7000 (default, used internal by cassandra)) you tried to bind. 
Use e.g. 'lsof -i' to investigate the port usage further. 

// Roger Schildmeijer

On 11 jul 2010, at 17.15em, osishkin osishkin wrote:

> I'm testing a simple Cassandra cluster on two machines. For some reaon
> after a while one of the nodes in the cluster crashes.
> At first I thought the fault was on me, so I simply started it up again.
> After the second time this happenned I noticed the following message errors -
> 
> INFO 17:28:05,624 Mycolumnfamily has reached its threshold; switching
> in a fresh Memtable at
> CommitLogContext(file='/var/lib/cassandra/commitlogMY/CommitLog-1278858485610.log',
> position=116)
> INFO 17:28:05,625 Enqueuing flush of Memtable(Mycolumnfamily)@1499027801
> INFO 17:28:05,672 Writing Memtable(Mycolumnfamily)@1499027801
> INFO 17:28:05,730 Completed flushing
> /var/lib/cassandra/dataMY/MYKeyspace1/Mycolumnfamily-27-Data.db
> INFO 17:28:05,731 Log replay complete
> INFO 17:28:05,756 Saved Token found: 66090367128402196046887347762075208662
> INFO 17:28:05,756 Saved ClusterName found: MY Cluster
> WARN 17:28:05,760 Unable to start GCInspector (currently only
> supported on the Sun JVM)
> INFO 17:28:05,760 Starting up server gossip
> ERROR 17:28:05,766 Exception encountered during startup.
> java.net.BindException: Address already in use
>        at sun.nio.ch.Net.bind(Native Method)
>        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:137)
>        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
>        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:52)
>        at org.apache.cassandra.net.MessagingService.listen(MessagingService.java:138)
>        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:328)
>        at org.apache.cassandra.thrift.CassandraDaemon.setup(CassandraDaemon.java:99)
>        at org.apache.cassandra.thrift.CassandraDaemon.main(CassandraDaemon.java:177)
> Exception encountered during startup.
> 
> Obviously nothing has changed on the machines, I'm using default ports
> that aren't taken by any other application (I saw people had problems
> with 8080, but it's not used on my machines. 9160 isn't either). When
> I started up cassandra again on both nodes, things worked just fine
> (until further notice at least).
> So I'm kind of at a loss here.
> 
> Any idea as to what is wrong would be appreciated
> Thank you.