Cassandra cqlsh - connection refused

前端 未结 20 2044
名媛妹妹
名媛妹妹 2020-12-01 11:50

I\'ve just started working with Cassandra (datastax), version 2.1.3 and cqlsh version 5.0.1.

Cassandra starts up fine and the cluster is operational instantly.

20条回答
  •  失恋的感觉
    2020-12-01 12:12

    This is because of some pre-configurations in the cassandra. And to fix this, there are following commented lines in the cassandra-env.sh file:

    #add this if you’re having trouble connecting:
    #JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=
    

    where you have to start fixing the error.

    Open the terminal and start fixing using the following easy steps:

    Step-1

    use

    sudo nano /etc/cassandra/cassandra-env.sh

    this command and search for JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname= uncomment the line by simply removing # attached in the start of the line.

    NOTE: If you have never opened this file to fix this error then you will find JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=

    Step-2 Now replace with 127.0.0.1

    Step-3 Save the file and restart the cassandra using systemctl restart cassandra.service (if you haven't the server is alredy running). OR start the cassandra using systemctl start cassandra.service (if the server is not running).

    Step-4 Check the status either by using sudo service cassandra status or systemctl status cassandra.service.

    Note: Once check the system monitor whether cassandra is running there or not.

    Try cqlsh now. It'll work.

    Note: nano is editor you can use other editors you are comfortable with.

提交回复
热议问题