I installed Cassandra on Ubuntu 16.04. (I have gotten Cassandra to work on RedHat. But now I want it to work on Ubuntu.) The installation seemed to go smoothly. I run this command to prove that Cassandra is active:
sudo service cassandra status
This command returns this output:
cassandra.service - LSB: distributed storage system for structured data
Loaded: loaded (/etc/init.d/cassandra; bad; vendor preset: enabled)
Active: active (exited) since Tue 2017-12-26 19:22:43 UTC; 8min ago
Docs: man:systemd-sysv-generator(8) Process: 1252 ExecStart=/etc/init.d/cassandra start (code=exited, status=0/SUCCESS)
Tasks: 0 Memory: 0B CPU: 0
The above "bad" concerns me. But it does return "Active." It seems like there is no major problem.
When I run "cqlsh" or "cqlsh 127.0.0.1" I get
Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})
I used nmap to test port 9042. The port is not blocked. There is not firewall installed either.
I rebooted the server. I tried modifying cassandra-env.sh. I uncommented a stanza and set it to be 127.0.0.1:
JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=127.0.0.1"
Nothing I do works. I expect to enter a different command prompt when I type in "cqlsh" or "cqlsh 127.0.0.1". But this does not happen. What do I do to have "cqlsh" work on an Ubuntu server?
sudo fuser -n tcp 9042, if it returns a pid, there is at least a process running and listening on this port. Then try also to connect to 127.0.1.1 (https://askubuntu.com/a/754219/367444). – Harald Dec 27 '17 at 12:58sudo fuser -n tcp 9042returns nothing.sudo service cassandra statusshows the Cassandra service is active.cqlsh 127.0.1.1returnsConnection error: ('Unable to connect to any servers', {'127.0.1.1': error(111, "Tried connecting to [('127.0.1.1', 9042)]. Last error: Connection refused")})– Jermoe Dec 28 '17 at 06:49