title: Enable JMX port for Cassandra 2
body: <p>I need to configure JMX on Casandra 2. I configured the configuration file this way:</p>
  
  <p>/etc/cassandra/default.conf/cassandra-env.sh</p>
  
  <pre><code>........
      LOCAL_JMX=no
  
      if [ "$LOCAL_JMX" = "yes" ]; then
        JVM_OPTS="$JVM_OPTS -Dcassandra.jmx.local.port=$JMX_PORT -XX:+DisableExplicitGC"
      else
        JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT"
        JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT"
        JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.ssl=false"
        JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=192.168.1.146"
        JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.authenticate=true"
        JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.password.file=/etc/cassandra/jmxremote.password"
      fi
  
      JVM_OPTS="$JVM_OPTS $JVM_EXTRA_OPTS"
  
  
  chmod 600 /etc/cassandra/jmxremote.password
  
  File content:
  
  monitorRole QED
  controlRole R&amp;D
  cassandra cassandrapassword
  </code></pre>
  
  <p>But in log file I get:</p>
  
  <pre><code>/usr/sbin/cassandra: line 155: /var/run/cassandra/cassandra.pid: No such file or directory
  Error: Password file not readable: /etc/cassandra/jmxremote.password
  </code></pre>
  
  <p>Can you give some idea how I can solve this problem?</p>