0

I have installed cassandra on my mac osx sierra using the instructions given here

https://gist.github.com/hkhamm/a9a2b45dd749e5d3b3ae

the installation was successful and I can easily connect to the cassandra locally using cqlsh

when I do a netstat -a I see

~ > netstat -a
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp4       0      0  localhost.9042         *.*                    LISTEN

when i do a nodetool status i see

Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens       Owns (effective)  Host ID                               Rack
UN  127.0.0.1  156.97 KiB  256          100.0%            1bf6cbd8-22c1-42e5-afdd-c1846be9e322  rack1

So here we can see that cassandra is running but its listening on localhost:9042

How can I make it listen to 0.0.0.0 so that I can connect remotely?

If I try to connect remotely I get this error

Connection error: ('Unable to connect to any servers', {'A.B.C.D': error(61, "Tried connecting to [('A.B.C.D', 9042)]. Last error: Connection refused")})

The IP address A.B.C.D is 100% correct because I am connected to the machine using screen sharing for the exact same IP address.

Firewall is disabled.

I edited this file sudo vi /usr/local/Cellar/cassandra/3.10_1/homebrew.mxcl.cassandra.plist

and modified it to

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>KeepAlive</key>
    <true/>
    <key>Label</key>
    <string>homebrew.mxcl.cassandra</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/opt/cassandra/bin/cassandra</string>
        <string>-f</string>
        <string>--bind-address=0.0.0.0</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>WorkingDirectory</key>
    <string>/usr/local/var/lib/cassandra</string>
  </dict>
</plist>

but this causes cassandra to even reject local connections.

Once again. I am on MACOSX and installed cassandra using HOMEBREW.

Knows Not Much
  • 30,395
  • 60
  • 197
  • 373

1 Answers1

0

I was able to resolve it. I edited the cassandra.yaml and set the rpc_address to my IP address.

this resolved the issue.

Knows Not Much
  • 30,395
  • 60
  • 197
  • 373