title: Cassandra : Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1', 9042)]
body: <p>I installed cassandra on ubuntu16.04 using following commands - </p>
  
  <pre><code>  echo "deb http://www.apache.org/dist/cassandra/debian 311x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
    sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key A278B781FE4B2BDA
    sudo apt update
    sudo apt install cassandra
  </code></pre>
  
  <p>When try to connect to cqlsh , it gives me error - </p>
  
  <pre><code>  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")})
  </code></pre>
  
  <p>Tired installing cassandra-driver as suggested <a href="https://www.itzgeek.com/how-tos/linux/ubuntu-how-tos/install-cassandra-on-ubuntu-16-04-and-run-a-single-node-cassandra-cluster-on-ubuntu.html" rel="nofollow noreferrer">here</a>. Still getting same error.</p>
  
  <p>Am I missing anything?</p>
  
  <p>However , if I start cassandra as a foreground process , i.e <strong>sudo cassandra -f</strong> , it works.</p>