Cassandra cqlsh - connection refused

前端 未结 20 1830
名媛妹妹
名媛妹妹 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:05

    When I installed Cassandra 3.11.1, I came across this problem. I checked the /var/log/cassandra/cassandra.log and found this error Exception encountered during startup....It is a bug and already reported. The original post link https://issues.apache.org/jira/browse/CASSANDRA-14173.

    The solution is to downgrade Cassandra to 3.0

    1. download Cassandra rpm

    curl -O https://www.apache.org/dist/cassandra/redhat/30x/cassandra-3.0.15-1.noarch.rpm

    or

    wget https://www.apache.org/dist/cassandra/redhat/30x/cassandra-3.0.15-1.noarch.rpm

    1. rpm -ivh cassandra-3.0.15-1.noarch.rpm
    2. service cassandra start
    3. service cassandra status # check cassandra status

    cassandra (pid 2322) is running...

    1. cqlsh # start cassandra
    0 讨论(0)
  • 2020-12-01 12:06

    It is a good idea to check the cassandra log if even the server is running. I was getting exactly the same message and unable to do anything with that and then I found out that there are errors in the log and the system is actually not working.

    Silly, I know, but could happen...

    0 讨论(0)
  • 2020-12-01 12:06

    I was experiencing the same issue with Cassandra 3.11.0, anytime I changed the address of rpc or listen address cqlsh wouldn't work. I had to add the same local ip to seeds

    So after much trial and error my working cassandra.yml ended up like this:

    class-name: org.apache.cassandra.locator.SimpleSeedProvider
    parameters: 
        -seeds: "192.168.0.30"
    
    listen_adress: 192.168.0.30
    rpc_address: 192.168.0.30
    
    0 讨论(0)
  • 2020-12-01 12:11

    Make sure that you also set "seeds" to the address which you provided at "listen_address"

    0 讨论(0)
  • 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=<public name>
    

    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=<public name>

    Step-2 Now replace <public name> 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.

    0 讨论(0)
  • 2020-12-01 12:15

    If you check the system.log file for cassandra in /var/log/cassandra, you will see that this problem occurs because the rpc server has not started.

    By default, the start_rpc is set to false in the cassandra.yaml file. Set it to start_rpc: true and then try again.

    From Cassandra 3.0 onwards, start_rpc is set to true by default. https://docs.datastax.com/en/cassandra/3.0/cassandra/configuration/configCassandra_yaml.html

    0 讨论(0)
提交回复
热议问题