DataStax OpsCenter

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 OpsCenter

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.

The OpsCenter features

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:

  • Centralized view of all the clusters: A centralized view provides options to visualize clusters in different modes: ring view, list view, and view by data centers.
  • Manage cluster configuration: OpsCenter enables one to edit and update cluster-wide configuration from the web console.
  • Visualize performance: OpsCenter actually stores the performance history over time. This can help you visualize performance in various time windows: 20 minutes, hourly, daily, weekly, and monthly.
  • Add a new node: On your local cluster, you can ask OpsCenter to add another node by providing the node address and credentials (of a sudoer), and choosing the appropriate DataStax package, which is basically Cassandra and OpsCenter packaged in a user-friendly way by DataStax.

OpsCenter's enterprise edition has the following features that are more advanced:

  • New cluster addition from GUI
  • Downloadable diagnostic information
  • Single-click cluster rebalancing
  • Multiple cluster management
  • Alerts and e-mail notifications

Note

If you are on AWS EC2, OpsCenter allows you to automatically add a new node to your existing cluster. This node is basically an instance of DataStax AMI with the appropriate Cassandra version that you have chosen.

Installing OpsCenter and an agent

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.

Prerequisites

The following are the prerequisites needed to install OpsCenter and an agent:

  • Python 2.6+: The web interface is Python-based and utilizes the 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: This is a bundle of system monitoring utilities. It provides statistics about CPU usage, memory usage, space monitoring, I/O activity information, and network statistics, and some other data about system resources. The presence of 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
    
  • OpenSSL: This is an optional component. OpsCenter uses a secure connection to communicate within the OpsCenter web interface and agents by default. If you are just testing OpsCenter, you are running within a secure internal network; alternatively, if there is no appropriate OpenSSL implementation for the platform, you may just avoid this step by adding the following lines in $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

Running a Cassandra cluster

You need to have a running Cassandra cluster that can communicate with OpsCenter's web interface machine.

Installing OpsCenter from tarball

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).

Note

View all the download options for OpsCenter Community Edition at http://planetcassandra.org/Download/DataStaxCommunityEdition.

To download and install OpsCenter, perform the following steps:

  1. Download and untar OpsCenter as follows:
    # Download latest OpsCenter
    $ wget 
     http://downloads.datastax.com/community/opscenter.tar.gz
    # Untar
    $ tar -xzf opscenter.tar.gz
    
  2. Edit 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
    
  3. Start the OpsCenter web server as follows:
    # 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.

Setting up an OpsCenter agent

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:

Setting up an OpsCenter agent

OpsCenter in action

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:

  1. Go to the agent directory:
    cd $OPSCENTER_HOME/agent
    
  2. Set up the 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.

  3. If you have SSL disabled, add use_ssl: 0:
    # address.yaml
    stomp_interface: "10.147.171.159"
    use_ssl: 0
    
  4. Once this is done and the 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
    
  5. After OpsCenter and the agents are up, open OpsCenter in the browser, click on Join existing cluster, and provide the node IPs (data of a single node should be sufficient).

Monitoring and administrating with OpsCenter

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:

Monitoring and administrating with 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.

Other features of OpsCenter

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.205.99