DataStax OpsCenter

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 OpsCenter

Figure 7.3: DataStax OpsCenter Cluster View and Actionable Items

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 Features

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:

  • Centralized view of all the clusters: Options to visualize a cluster in different modes: ring view, list view, and view by data centers.
  • Manage cluster configuration: 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 more advanced features, as follows:
    • New cluster addition from GUI
    • Downloadable diagnostic information
    • Single-click cluster rebalancing
    • Multiple cluster management
    • Alerts and e-mail notification

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

Prerequisites

  • Java 6: The machines where you are planning to install a web interface or agents must have Java 6; or any version that is specifically not lower than version 1.6.0_19. Java 7 is not recommended. The version can be checked for as follows:
    $ 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)
  • 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: sysstat is a bundle of system monitoring utilities. It provides statistics about CPU usage, memory usage, space monitoring, I/O activity information, network statistics, and some other data about system resources. The presence of this 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: OpenSSL 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, or 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 

    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

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

Note

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

  1. Download and untar:
    # 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:
    # 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.

Setting up an OpsCenter agent

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:

Setting up an OpsCenter agent

Figure 7.4: 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's 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 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.

Monitoring and administrating with OpsCenter

Figure 7.5: A subset of monitoring options by OpsCenter

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.

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

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

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