DataStax (http://www.datastax.com) is the leading company that provides commercial support for Cassandra. At the time of writing of this book, DataStax claimed to employ more than 90 percent of Cassandra committers. DataStax provides an easy-to-use, web-based utility—OpsCenter—that is little more than a GUI wrapper over Cassandra's JMX instrumentation. OpsCenter provides a clean, simple, and intuitive interface to manage and monitor a Cassandra cluster. This section will briefly go over OpsCenter.
DataStax provides two versions of OpsCenter: an enterprise version and a community version. The enterprise version has more features, official support, and is paid. The community version can be downloaded and used for free in a production environment. You may download and evaluate the enterprise version for free for development purposes. In this section, we will briefly go over installing, configuring, monitoring, and administrating a single data center, 3-node cluster using OpsCenter's community version.
OpsCenter is a superset of nodetool
. It provides all the functionality of nodetool
, displays metrics in an intuitive way, and also provides administrative tooling beyond the default toolset that comes with Cassandra. The following is a short list of features:
OpsCenter installation comprises two parts: installation of the OpsCenter web interface on one machine and installation of agents on each Cassandra node. The web interface and nodes communicate with one an other to be able to display information.
$ java -version java version "1.6.0_34" Java(TM) SE Runtime Environment (build 1.6.0_34-b04) Java HotSpot(TM) 64-Bit Server VM (build 20.9-b04, mixed mode)
# yes, UPPERCASE V $ python -V Python 2.6.8
# iostat is one the utilities in sysstat. V is uppercase. $ iostat -V sysstat version 9.0.4 (C) Sebastien Godard (sysstat <at> orange.fr)
If it is not already installed, use the following commands depending on your Linux distribution:
# CentOS or RHEL like systems sudo apt-get install sysstat # Ubuntu or Debian like systems yum install sysstat
$OPSCENTER_HOME/conf/opscenterd.conf
:[agents] use_ssl = false
You will also need to update the agent's conf/address.yaml
file using:
use_ssl: 0
In case you want SSL to be enabled, make sure you have the correct OpenSSL version installed for your platform.
$ openssl version OpenSSL 1.0.1e-fips 11 Feb 2013
DataStax provides the following compatibility list for OpenSSL with OpsCenter:
Version |
Operating System |
---|---|
0.9.8 |
CentOS 5.x, Debian, Mac OS X, Oracle Linux 5.5, RHEL 5.x, SuSe Enterprise 11.x, Ubuntu, and Windows |
1.0.0 |
CentOS 6.x, Oracle Linux 6.1, and RHEL 6.x |
In case you have the 1.0.0
version on an operating system that requires version 0.9.8
for OpsCenter to work, installing a 0.9.8
version may solve the problem. It may not be ideal to have two versions of OpenSSL. The following code shows how a server with CentOS 5.x with the 1.0.0
version was fixed (OpsCenter requires version 0.9.8
). Please note that this may not be an ideal solution and it can potentially break some other functionality.
$ yum install openssl098e # Bad practice! $ sudo ln -s /usr/lib64/libssl.so.0.9.8e /usr/lib64/libssl.so.0.9.8 $ sudo ln -s /usr/lib64/libcrypto.so.0.9.8e /usr/lib64/libcrypto.so.0.9.8
You need to have a running Cassandra cluster that can communicate with OpsCenter's web interface machine.
DataStax provides different binaries packaged specifically for different operating systems. One may download an RPM package, a Deb package, or an MSI (Windows) package based on what operating system one is using. In this section, we will use the Tarball archive because it works across several platforms (Linux, Mac OS X).
View all the download options for OpsCenter Community Edition at http://planetcassandra.org/Download/DataStaxCommunityEdition.
# Download latest OpsCenter $ wget http://downloads.datastax.com/community/opscenter.tar.gz # Untar $ tar -xzf opscenter.tar.gz
conf/opscenterd.conf
and insert the appropriate hostname, OpsCenter's port number, and SSL setting (if required):# vi conf/opscenterd.conf [webserver] port = 80 interface = 10.147.171.159 #IP of OpsCenter machine [agents] use_ssl = false
# Use -f to start in foreground $OPSCENTER_HOME/bin/opscenter # In the command above, $OPSCENTER_HOME is just a reference # to the OpsCenter installation location.
If the web server starts without any error, you should be able to access OpsCenter from your browser. Make sure the security settings allow the port mentioned in opscenterd.conf
. When no agent is added, it will ask you to create a new cluster or join an existing cluster. This is the time to set up agents on each Cassandra node.
The ways OpsCenter works is that there are agents that the web interface of OpsCenter talks to. These agents collect data points and send commands to the nodes. See the following figure:
An agent is available within the OpsCenter directory under the agent
directory. You need to set up the agent and then copy the agent directory to all other nodes. Then, start the agents. The following are the steps to set up the agent:
cd $OPSCENTER_HOME/agent
bin/setup OPSCENTER_IP
Here, OPSCENTER_IP:
is the address of the machine hosting OpsCenter.
This updates the $AGENT_HOME/conf/address.yaml
file.
use_ssl: 0
:# address.yaml stomp_interface: "10.147.171.159" use_ssl: 0
# Execute this from agent directory, user -f for foreground $ bin/opscenter-agent
OpsCenter exposes all the functionality of JMX via a web console. This means everything that we were able to do using nodetool
, we can do with OpsCenter. Most of the node-level administrative options are available by clicking on the node (under the cluster view menu) and then clicking on the
Action button.
For cluster-wide operations, there are menus under the cluster view page. You can add a node, change the configuration file cluster-wide, and perform a rolling restart of the cluster. In the paid version, you can create a cluster, add more than one cluster to OpsCenter, download information to diagnose a problem, and generate reports.
OpsCenter provides a plethora of attributes to keep a tab on. It covers Cassandra-specific attributes like read/write requests, pending tasks in different stages, row and key cache hit rate; column family-specific statistics like pending read and writes, SSTables' size and count, and so on; and operating system resource-specific statistics such as CPU, memory, disk usage, network, and some more. Basically, a superset of monitoring options is provided by nodetool. To add more plots to the Performance screen, you need to click on the Add Graph button and select the appropriate graph. To make this setting permanent, save this plot setting by choosing Save as... from the drop-down menu next to the Performance Metrics heading.
Apart from operational tasks, OpsCenter can be pretty useful to add, remove, or modify keyspaces. The Schema screen provides options to play with keyspaces and column families.
Another interesting feature is the Data Explorer screen. This provides a visually pleasing interface to browse keyspace and column families. You can also search within a column family by the row key.
OpsCenter provides security features; it allows us to enable SSL for the OpsCenter web console, a simple authentication mechanism for OpsCenter. Advanced configuration and setup is outside the scope of this book; refer to the official DataStax documentation for this at http://www.datastax.com/docs/opscenter/index.
3.22.41.212