Connection refused to localhost at Cassandra 0.8.0

3,328 views
Skip to first unread message

ssich

unread,
Jun 30, 2011, 9:55:34 AM6/30/11
to pycassa-discuss
My Cassandra used to work with no problems.

I was able to connect with no problems but now for some reason it
doesn't work anymore.

[default@unknown] connect localhost/9160; Exception connecting to
localhost/9160. Reason: Connection refused.

I am in Ubuntu server

Thanks in-advance

Dan Kuebrich

unread,
Jun 30, 2011, 10:03:06 AM6/30/11
to pycassa...@googlegroups.com
Is cassandra running?  Does it show up in

$ ps -ef | grep cassandra

Also, in the future the cassandra-user list might get you better answers for general cassandra questions.

ssich

unread,
Jun 30, 2011, 1:10:56 PM6/30/11
to pycassa-discuss
hello Dan

here is the output of the commands and its running
root@gestion:~# ps -ef | grep cassandra
root 6335 5474 0 13:08 pts/2 00:00:00 grep --color=auto
cassandra


On Jun 30, 10:03 am, Dan Kuebrich <dan.kuebr...@gmail.com> wrote:
> Is cassandra running?  Does it show up in
>
> $ ps -ef | grep cassandra
>
> Also, in the future the cassandra-user list might get you better answers for
> general cassandra questions.
>

Sasha Dolgy

unread,
Jun 30, 2011, 1:26:30 PM6/30/11
to pycassa...@googlegroups.com
that means cassandra is not running.

ssich

unread,
Jun 30, 2011, 2:02:51 PM6/30/11
to pycassa-discuss
But when I run the cassandra -cli

root@gestion:~# cassandra-cli
Welcome to cassandra CLI.
Type 'help;' or '?' for help. Type 'quit;' or 'exit;' to quit.
[root@gestion] connect localhost/9160;
Exception connecting to localhost/9160. Reason: Connection refused.

Thanks Sasha and any comments.


On Jun 30, 1:26 pm, Sasha Dolgy <sdo...@gmail.com> wrote:
> that means cassandra is not running.
>

Sasha Dolgy

unread,
Jun 30, 2011, 2:09:01 PM6/30/11
to pycassa...@googlegroups.com
There is a wonderful file in the cassandra distribution called README.txt.

Getting started
---------------

This short guide will walk you through getting a basic one node cluster up
and running, and demonstrate some simple reads and writes.

* tar -zxvf apache-cassandra-$VERSION.tar.gz
* cd apache-cassandra-$VERSION
* sudo mkdir -p /var/log/cassandra
* sudo chown -R `whoami` /var/log/cassandra
* sudo mkdir -p /var/lib/cassandra
* sudo chown -R `whoami` /var/lib/cassandra

Note: The sample configuration files in conf/ determine the file-system
locations Cassandra uses for logging and data storage. You are free to
change these to suit your own environment and adjust the path names
used here accordingly.

Now that we're ready, let's start it up!

* bin/cassandra -f

Running the startup script with the -f argument will cause Cassandra to
remain in the foreground and log to standard out.

Now let's try to read and write some data using the command line client.

* bin/cassandra-cli --host localhost

The command line client is interactive so if everything worked you should
be sitting in front of a prompt...

Connected to: "Test Cluster" on localhost/9160
Welcome to cassandra CLI.

Type 'help;' or '?' for help. Type 'quit;' or 'exit;' to quit.

[default@unknown]

As the banner says, you can use 'help;' or '?' to see what the CLI has to
offer, and 'quit;' or 'exit;' when you've had enough fun.

--
Sasha Dolgy
sasha...@gmail.com

ssich

unread,
Jun 30, 2011, 7:07:34 PM6/30/11
to pycassa-discuss
I have installed the Cassandra successfully but still I have the same
problem. Here is the output of

root@gestion:~# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address
State PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:*
LISTEN 1015/mysqld
tcp 0 0 0.0.0.0:80 0.0.0.0:*
LISTEN 1637/apache2
tcp 0 0 0.0.0.0:22 0.0.0.0:*
LISTEN 5695/sshd
tcp 0 0 127.0.0.1:3350 0.0.0.0:*
LISTEN 1307/sesman
tcp 0 0 127.0.0.1:631 0.0.0.0:*
LISTEN 1357/cupsd
tcp 0 0 0.0.0.0:25 0.0.0.0:*
LISTEN 1229/master
tcp 0 0 0.0.0.0:3389 0.0.0.0:*
LISTEN 1280/xrdp
tcp6 0 0 :::22 :::*
LISTEN 5695/sshd
tcp6 0 0 ::1:631 :::*
LISTEN 1357/cupsd
udp 0 0 0.0.0.0:68
0.0.0.0:* 872/dhclient
udp 0 0 0.0.0.0:5353
0.0.0.0:* 720/avahi-daemon: r
udp 0 0 0.0.0.0:43335
0.0.0.0:* 720/avahi-daemon: r


Can anyone suggest me anything?
> sasha.do...@gmail.com

Tyler Hobbs

unread,
Jun 30, 2011, 8:01:11 PM6/30/11
to pycassa...@googlegroups.com
On Thu, Jun 30, 2011 at 6:07 PM, ssich <sarwar...@gmail.com> wrote:
> I have installed the Cassandra successfully but still I have the same
> problem.

What is the output of "bin/cassandra -f"?

--
Tyler Hobbs
Software Engineer, DataStax
Maintainer of the pycassa Cassandra Python client library

ssich

unread,
Jul 1, 2011, 2:59:07 PM7/1/11
to pycassa-discuss
Hello Tyler,

Thank you very much for your reply here is the output of cassandra -f
and cassandra-cli

The output of "bin/cassandra -f"

Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Couldn't figure out log4j
configuration.
at
org.apache.cassandra.service.AbstractCassandraDaemon.<clinit>(AbstractCassandraDaemon.java:
75)
Could not find the main class:
org.apache.cassandra.thrift.CassandraDaemon. Program will exit.


gestion@gestion:~$ cassandra-cli
Welcome to the Cassandra CLI.

Type 'help;' or '?' for help.
Type 'quit;' or 'exit;' to quit.

[default@unknown] connect localhost/9160;
Exception connecting to localhost/9160. Reason: Connection refused.
[default@unknown]

Please help me. I am new to Cassandra

Sarwar

On Jun 30, 8:01 pm, Tyler Hobbs <ty...@datastax.com> wrote:

ssich

unread,
Jul 1, 2011, 3:16:28 PM7/1/11
to pycassa-discuss
here is the output of the java -version

root@gestion:/bin# java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.8)
(6b20-1.9.8-0ubuntu1~10.04.1)
OpenJDK Server VM (build 19.0-b09, mixed mode)

ssich

unread,
Jul 4, 2011, 1:44:12 PM7/4/11
to pycassa-discuss

log4j-server.properties file:


# output messages into a rolling log file as well as stdout
log4j.rootLogger=INFO,stdout,R

# stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p %d{HH:mm:ss,SSS} %m
%n

# rolling log file
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.maxFileSize=20MB
log4j.appender.R.maxBackupIndex=50
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%5p [%t] %d{ISO8601} %F
(line %L) %m%n
# Edit the next line to point to your logs directory
log4j.appender.R.File=/var/log/cassandra/system.log

# Application logging options
#log4j.logger.org.apache.cassandra=DEBUG
#log4j.logger.org.apache.cassandra.db=DEBUG
#log4j.logger.org.apache.cassandra.service.StorageProxy=DEBUG


I do not know whats is the problem. Any help?
Reply all
Reply to author
Forward
0 new messages