Dear Wiki user, You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for change notification.
The "RunningCassandra" page has been changed by EricEvans. The comment on this change is: removed off-topic material, documented cmd options to startup script. http://wiki.apache.org/cassandra/RunningCassandra?action=diff&rev1=10&rev2=11 -------------------------------------------------- + Startup of a Cassandra node is handled by the `bin/cassandra` shell script. Options used by `bin/cassandra` are taken from a shell snippet, `/bin/cassandra.in.sh` by default. - When you run bin/cassandra, by default it takes its JVM options and configuration directory from bin/cassanrda.in.sh. - - Among other things, the defaults include a maximum heap size (-Xmx) of 1GB, which you will want to modify appropriately for your hardware, being sure to specifiy a size under the amount of RAM. cassandra.in.sh by default ("-Dcom.sun.management.jmxremote.port=8080") also exposes the JmxInterface on port 8080. The thrift service (which clients connect to) is set by a storage-conf.xml option ("RPCPort") and defaults to port 9160. Nodes also communicate between each other on port 7000. - - To connect to a default server running on localhost via the command line client : - {{{ - cassandra-cli -host localhost -port 9160 - }}} - - If you run into issues connecting via jconsole to the JmxInterface port from a remote machine, it may be the JVM option '-Djava.rmi.server.hostname'. This may need to be set to a particular interface like '-Djava.rmi.server.hostname=$IP' (where $IP is the ip address of the interface you can reach from the remote machine). Java defaults to the ip address of "localhost" which is mostly likely not what you want. - - You may also run into issues connecting to the JMX interface (even locally) because by default JMX binds to IPv6 if it's available (netstat -nap | grep 8080). This case is also solved by passing '-Djava.rmi.server.hostname=$IP' explicitly as a JVM option. This will prompt JMX to bind to the given IPv4 IP address so that nodetool can access it. You can override the options script to use with CASSANDRA_INCLUDE. E.g., @@ -21, +10 @@ $ CASSANDRA_INCLUDE=/tmp/new.in.sh bin/cassandra }}} + Among other things, the defaults in `bin/cassandra.in.sh` include a maximum heap size (-Xmx) of 1GB, which you'll almost certainly want to considering tailoring for your environment. The port to access Cassandra's JmxInterface is also configured here through the `com.sun.management.jmxremote.port` property and defaults to 8080. + + Additionally, the script recognizes a number of command line arguments, invoking the script with the `-h` option prints a brief summary of them. + + {{{ + $ bin/cassandra -h + Usage: bin/cassandra [-f] [-h] [-p pidfile] + $ + }}} + + The `-f` argument will prevent Cassandra from daemonizing and force it to run in the foreground. The `-p <pidfile>` argument causes the process ID to be written to the named file (useful for shutdown ala `kill $(cat pidfile)`). + Note: The Debian package makes use of an init script and [[http://commons.apache.org/daemon/jsvc.html|jsvc]] to start and stop Cassandra. Startup options should be configured in /etc/default/cassandra (not /usr/share/cassandra/cassandra.in.sh) on Debian systems. See also [[Operations]]
