This document provides step-by-step instructions on how to install and configure ClustrixDB in AWS using the ClustrixDB AMI. To proceed with this installation, you will also need a ClustrixDB license. If you do not yet have a ClustrixDB license, please contact Clustrix Sales. If you encounter any problems or issues while using these instructions, please contact Clustrix Support.
These instructions are a customized version of the steps found in the following ClustrixDB Online Documentation:
ClustrixDB AMI comes preinstalled with CentOS 7, ClustrixDB, and a few additional linux tools such as ntpd, htop, etc. For recommended server specifications for your particular deployment, please refer to ClustrixDB Reference Server Configurations.
The installation of ClustrixDB follows these high-level phases:
Log into the AWS Console, and select the EC2 service.
A Placement Group is used to ensure low latency and high throughput between nodes. It is a logical grouping of instances within an Availability Zone (see Regions and Availability Zones ) which affects how close together the instances are created, from a networking standpoint. By placing all ClustrixDB instances in the same Placement Group you ensure the network latency is as low as possible between the instances. If you are using ClustrixDB Zones you will want to create one Placement Group for each Zone. See the Zones documentation for more information.
To create a Placement Group, select the “Placement Groups” link under Network & Security on the left-side menu.
Then click the “Create Placement Group” button and enter a name for the Placement Group. The name must be a name that has not been previously used by another Placement Group.
Click the “Create” button.
A security group, like a firewall, is used to control incoming and outgoing network traffic to and from your AWS machine instance. Select the “Security Groups” link under Network & Security on the left-side menu.
Then click the “Create Security Group” button.
Enter a name and description for the Security Group, and select the VPC (Best Practices For AWS Security Groups) in which the ClustrixDB instances will run. Then add the following 2 rules:
You may customize the Source of each rule. Ensure that the rule allows proper access from SSH and MySQL clients. We recommend starting with the Source set to “Anywhere” as the rules can be configured to be more restrictive after the installation is complete.
Click the “Create” button.
Now we must add three more rules that were not easy to add on the previous screen. Select the Security Group created from the list of groups, and choose Actions → Edit inbound rules.
Add the following rules:
After selecting “Custom” for the Source, in the field to the right start typing this Security Group’s name (e.g. in our example: “clustrixdb-sg”). As you type, a selection menu will appear and you can click the Security Group’s name to cause the Security Group's ID to be populated (shown below).
Please double-check your Security Group settings. Errors in the Security Group are the most common misconfiguration we see with ClustrixDB in AWS.
Click the “Save” button.
Still, within the AWS Console, select the EC2 service and then select AMIs from the left-hand menu under the IMAGES category.
Then in the top-left corner of the list of AMIs, change the search drop-down box to “Private images”.
Identify and select the private AMI using the AMI ID provided by your Clustrix representative. If your list of private AMIs is long, you may need to enter the intended AMI ID in the search box and press enter.
After selecting the correct AMI from the list of private AMIs, click the Launch button to move on to Step 2.
Select one of the following instance types:
Click the “Next: Configure Instance Details” button to move to Step 3.
Make the following selections:
Click the “Next: Add Storage” button
The AMI is pre-configured to leverage the ephemeral SSD disks, therefore there is no action required to configure the /data/clustrix/ partition.
We recommend configuring an EBS volume for logging. More detail on that can be found here: How to use an EBS volume for ClustrixDB logs
Click the “Next: Add Tags” button
ClustrixDB does not require any additional instance tags.
Click the “Next: Configure Security Group” button
Choose the option “Select an existing security group” and select the Security Group you created in the previous steps.
Click the “Review and Launch” button.
You may review the selections, then click the “Launch” button.
You are prompted to select an existing key pair or create a new key pair. Make the appropriate selection and click the “Launch Instances” button.
Once the EC2 instance is running, the ClustrixDB software is already running on the instance. However, the instance is not yet part of a cluster.
From the AWS Console, gather the private IP address of each EC2 instance that will run the ClustrixDB software. You will need these IP addresses during the installation.
To join the ClustrixDB servers into a single unified cluster, connect to one ClustrixDB server and run a few SQL commands.
# set permissions for the pem file
# SSH into one of the ClustrixDB servers
# Launch the mysql client shell> mysql -u root
-- Set the cluster license sql> SET GLOBAL license = 'license_key';
-- Create a cluster with the other nodes
sql> ALTER CLUSTER ADD 'ip', 'ip';
The ALTER CLUSTER command will initiate a short group change , after which the cluster is formed.
Run the clx command-line utility to view the status of the ClustrixDB nodes. This command can be run on any of the ClustrixDB servers as the clustrix user.
shell> /opt/clustrix/bin/clx stat Cluster Name: claef30606ca58824f Cluster Version: 5.0.45-clustrix-9.0.4 Cluster Status: OK Cluster Size: 3 nodes - 16 CPUs per Node Current Node: ip-10-76-3-58 - nid 1 nid | Hostname | Status | IP Address | TPS | Used | Total ----+-----------------+--------+--------------+-----+----------------+-------- 1 | ip-10-76-3-58 | OK | 10.76.3.58 | 0 | 10.6M (0.01%) | 119.0G 2 | ip-10-76-3-105 | OK | 10.76.3.105 | 0 | 5.9M (0.00%) | 119.0G 3 | ip-10-76-3-232 | OK | 10.76.3.232 | 0 | 5.9M (0.00%) | 119.0G ----+-----------------+--------+--------------+-----+----------------+-------- 0 | 22.4M (0.01%) | 357.0G
Create a user to be used during the import:
-- Create a user for importing
mysql> grant all on *.* to '<importuser>'@'%' identified by '<importuserpasswd>';
For more information see: clustrix_import
The ClustrixGUI must be started with the following commands before the first time you access it.
shell> /opt/clustrix/bin/clx nanny stop_job clxdbi
shell> /opt/clustrix/bin/clx nanny start_job clxdbi
Access the ClustrixGUI by typing the ip or hostname of one of your nodes into a web browser, include port :8080. Chrome is the recommended web browser.
Provide the following credentials:
Select the “Load Balancers” link on the left-side menu.
Then click the “Create Load Balancer” button.
Choose the Classic Load Balancer, and click the Continue button.
Enter the Basic Configuration as follows.
Then add the following Load Balancer Protocols:
Then select the same subnet that you used above in “Step 3: Configure Instance Details” when launching the EC2 instances.
Select the subnet your Cluster is in (see Configure Instance Details, above). If you are using ClustrixDB Zones, you will also need to select the subnet for each zone where you wish traffic to be routed by your load balancer:
Click the “Next: Assign Security Groups” button.
Select the same Security Group that you created previously for the ClustrixDB instances. Choose the option “Select an existing security group”, and then check the proper security group.
Click the “Next: Configure Security Settings” button.
Click the “Next: Configure Health Check” button
Configure the health check using the following values:
Click the “Next: Add EC2 Instances” button
Select from the list the ClustrixDB EC2 instances you launched previously.
Additionally, check the following options:
Click the “Next: Add Tags” button.
ClustrixDB does not require any additional tags.
Click the “Review and Create” button.
Review the settings, then click the “Create” button.
We want the database to handle terminating idle connections instead of the ELB. The default ELB Idle Timeout value is 60 seconds, which is too short for long-running queries. Therefore, we recommend setting the ELB Idle Timeout to its maximum value of 3600 seconds.
Return to the main Load Balancers page by selecting the “Load Balancers” link on the left-side menu.
Then in the list of load balancers, select the load balancer you just created. In the Description tab of the details pane below the list of load balancers, find the Attributes section near the bottom:
Click the "Edit idle timeout" button, then enter 3600, and click the Save button.