DataStax (http://www.datastax.com) is the leading company that provides commercial support for Cassandra. At the time of writing, DataStax claimed to employ more than 90 percent of Cassandra committers. DataStax provides an easy-to-use, web-based utility—OpsCenter—that is a 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. The following screenshot shows DataStax OpsCenter's cluster view and actionable items:
DataStax provides two versions of OpsCenter: an enterprise version and a community version. The enterprise version has more features and official support, and it is paid for. 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, three-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 provides administrative tooling beyond the default toolset that comes with Cassandra. The following is a short list of features:
OpsCenter's enterprise edition has the following features that are more advanced:
OpsCenter installation comprises two parts: installing the OpsCenter web interface on one machine and installing agents on each Cassandra node. The web interface and nodes communicate with each other to be able to display information.
The following are the prerequisites needed to install OpsCenter and an agent:
Twisted
package. Python's recommended version is 2.6+. It may or may not work with Python 3. Use the following command to find out the version of Python installed on your computer:# yes, UPPERCASE V $ python -V Python 2.6.8
sysstat
can be checked by executing the following command:# 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
If you want SSL to be enabled, make sure you have the correct OpenSSL version installed for your platform with the following command:
$ 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 |
If 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 commands shows how a server with CentOS 5.x with the 1.0.0 version was fixed (OpsCenter requires version 0.9.8). Note that this may not be an ideal solution, and it could potentially break another 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
A better way to get around the OpenSSL version issue is to install pyOpenSSL
0.10 or onward. Check the version of the existing pyOpenSSL
by executing the following command:
$ python -c "import OpenSSL; print OpenSSL.__version__"
Install the latest version of pyOpenSSL
as follows:
$ easy_install pyOpenSSL
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 which 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.
To download and install OpsCenter, perform the following steps:
# 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 preceding command, $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.
OpsCenter works in such a way that there are agents that the web interface of OpsCenter talks to. These agents collect data points and send commands to the nodes as shown in the following screenshot:
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
agent
directory is copied across all nodes. Start the agents on each node by executing the following command:# 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 now 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. The following screenshot shows a subset of monitoring options by OpsCenter:
OpsCenter provides a plethora of attributes to keep a tab on. It covers Cassandra-specific attributes such as read/write requests; pending tasks in different stages; the row and key cache hit rate; table-specific statistics such as pending read and writes and SSTables size and count; and operating system resource-specific statistics such as CPU, memory, disk usage, and network. 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 tables.
Another interesting feature is the Data Explorer screen. This provides a visually pleasing interface to browse keyspaces and tables. You can also search within a table with 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 are beyond the scope of this book. Refer to the official DataStax documentation for this at http://www.datastax.com/docs/opscenter/index.
3.145.109.234