DataStax Enterprise 3.2

Installing DataStax Enterprise on HP Cloud

This is a step-by-step guide to setting up a DataStax Enterprise (DSE) cluster in the HP Cloud. DataStax supports installation on Ubuntu 11.04 Natty Narwhal and Ubuntu 11.10 Oneiric Ocelot.

Note: Some HP documents will not open unless you are logged into the HP Cloud Console.

Procedure

  1. Create a key pair:

    You need a key pair (.pem file) to login to your DataStax Enterprise nodes.

    1. From the HP Cloud Dashboard, click Manage Servers or Activate in one of the Availability Zones.
    2. Click Key Pairs.

    3. Click Add KeyPair.
      • If you do not have an existing key pair, specify only the Key Name, click Create Key, and then copy the contents into a text file that has .pem extension on your local machine.
      • If you already have an existing key pair, specify both the Key Name and Public Key.
      Note: For multiple availability zones, use the same key pair in each zone. If you used the HP Cloud console to create the key pair, you can retrieve the public key using the REST API. You must first create an authorization token to execute the API calls, then use the List Key Pairs command to retrieve the public key.
  2. Create a security group:

    A security group acts as a firewall that allows you to choose which protocols and ports are open in your cluster. A Cassandra cluster requires that certain ports are open for inter-node, OpsCenter, and SSH communication. You can specify the protocols and ports either by a range of IP addresses or by security group. It is much simpler and requires less maintenance to define port access by security group. Currently the HP Cloud console does not provide the capability to specify ports by security group. However, you can install and use the HP Extended Python Novaclient for this purpose.

    The HP Security Groups document provides information on defining rules for security groups.

    Note: After making any change to a security group, you must restart the nodes. You cannot change which security group is associated with an instance after the instance is created.
    1. Using the HP Extended Python Novaclient, create a security group.
      nova secgroup-create DSESecurityGroup "Security group for DataStax Enterprise"
    2. Create the rules for the security group. For example, to create a rule that opens port 7000 to other nodes in the security group.
      nova secgroup-add-group-rule DSESecurityGroup DSESecurityGroup --ip_proto tcp  --from_port 7000 --to_port 7000
      +-------------+-----------+---------+----------+-------------------+
      | IP Protocol | From Port | To Port | IP Range | Source Group      |
      +-------------+-----------+---------+----------+-------------------+
      | tcp         | 7000      | 7000    |          | DSESecurityGroup  |
      +-------------+-----------+---------+----------+-------------------+
    3. Set the Internet Control Message Protocol port.
      Port IP Protocol Description
      -1 icmp Use for ping
    4. Set the ports described in the Firewall port table. For these ports set the IP Protocol to tcp.

      Generally, when you have firewalls between machines, it is difficult to run JMX across a network and maintain security. This is because JMX connects on port 7199, handshakes, and then uses any port within the 1024+ range. Instead use SSH to execute commands to remotely connect to JMX locally or use the DataStax OpsCenter.

    5. After you are done adding the port rules, you can also view them on the HP Cloud console.

      Warning: This security configuration shown in the above graphic opens ports 22 and 8888 to incoming traffic from any IP address (0.0.0.0/0). If you desire a more secure configuration, see the HP Security Groups document.
  3. Create the server:
    1. From the HP Cloud Dashboard, click Manage Servers or Activate in one of the Availability Zones.
    2. Under Create Servers, select the following:
      • Flavor: standard.large (or greater).
      • Security Group: The DSE security group that you created earlier.
      • Install Image: Ubuntu Oneric 11.10.
      • Key Pair: The key pair that you created earlier.
    3. Click Create.

    4. Click Create for each additional instance.
  4. Connect to the server:
    1. If this is the first time you are connecting, copy your private key file (key_name.pem) you downloaded earlier to your home directory, and change the permissions so it is not publicly viewable. For example:
      $ chmod 400 DataStaxKey.pem
    2. After the instance is running, click Connect.
    3. From the Instance dialog box, copy the example and change the connection user from root to ubuntu, then paste it into your SSH client.

  5. Install the JRE and JNA:

    Oracle Java SE Runtime Environment (JRE) 6 or 7 is required to run DataStax Enterprise. The latest version is recommended.

    1. The easiest way to put the Oracle JRE on an HP Cloud instance is to download it to your local machine from Oracle Java SE Downloads and then use the secure copy command to copy it onto the node.
      $ scp -i DataStaxKey.pem jre-6u43-linux-x64.bin ubuntu@ip_address:~/
    2. Install the JRE as described in Installing Oracle JRE on Debian or Ubuntu Systems.
    3. Install the JNA as described in Installing the JNA on Debian or Ubuntu Systems.
  6. Install DataStax Enterprise. See Installing DataStax Enterprise on Debian-based systems.
    Note: You only need to install OpsCenter on one node.
  7. Configure DataStax Enterprise. See Single data center deployment or Multiple data center deployment using the following guidelines:

    Single availability zone:

    1. If necessary, change the default the delegated_snitch to DSESimpleSnitch. It is located in the /etc/dse/dse.yaml configuration file:
      delegated_snitch: com.datastax.bdp.snitch.DseSimpleSnitch
    2. In the /etc/dse/cassandra/cassandra.yaml configuration file, use the private IP addresses of the nodes, not the public IP addresses:
      seed_provider:
         - class_name: org.apache.cassandra.locator.SimpleSeedProvider
           parameters:
              - seeds: "private_ip_of_seed1,private_ip_of_seed2"
      listen_address: private_ip_of_the_node

    Multiple availability zones:

    1. In the /etc/dse/dse.yaml configuration file, set the delegated_snitch to PropertyFileSnitch:
      delegated_snitch: org.apache.cassandra.locator.PropertyFileSnitch
    2. In the /etc/dse/cassandra/cassandra.yaml configuration file, use the public IP addresses for the seeds and set the broadcast_address:
      seed_provider:
         - class_name: org.apache.cassandra.locator.SimpleSeedProvider
           parameters:
              - seeds: "public_ip_of_seed1,public_ip_of_seed2"
      listen_address: private_ip_of_the_node
      broadcast_address: public_ip_of_the_node
  8. Start the DataStax Enterprise service and agent on each node. See Starting DataStax Enterprise as a service.
    Note: The agent provides an interface between Opscenter and DataStax Enterprise services.
  9. Configure OpsCenter:

    OpsCenter is installed during the DataStax Enterprise installation when using the sudo apt-get install dse-full opscenter command. If you have not already installed OpsCenter, install it as described in Installing the OpsCenter deb package.

    1. In the /etc/opscenter/opscenterd.conf configuration file, set the [webserver] interface to the private IP address of the OpsCenter node.
      [webserver] 
      port = 8888
      interface = private_ip_of_the_opscenter_node
    2. Connect to the OpsCenter using the following URL.
      http://private_ip_of_the_opscenter_node:8888/
      When you start OpsCenter for the first time you are prompted to connect to your cluster.
    3. In Welcome to DataStax OpsCenter, click Use Existing Cluster.
    4. In Add Cluster, enter the IP addresses of the seed nodes into the Cluster Hosts/IPs field and the click Save Cluster.

    After the agents are connected the OpsCenter is ready for use.