-
Notifications
You must be signed in to change notification settings - Fork 14
Priam
HOME > BURI ROLE GUIDE > PRIAM
Priam is a Netflix OSS co-process providing for the management of an Apache Cassandra ring, including token management, and centralized configuration.
- Create Priam S3 bucket
- Configure local/site.yml and build AMI
- Create IAM role
- Create security group
- Setup launch configuration
- Launch per-zone autoscale groups
- Open the AWS S3 console
- Click "Create Bucket", provide a name, and ensure you select the correct region where you will deploy Priam.
The same S3 bucket can be used for multiple cassandra clusters, each using a folder within for their backups.
## Step 2: Configure local/site.yml and build AMI-
Edit local/site.yml in your Buri build tree and ensure the following is set as needed:
# The bucket name setup in step 1. priam_s3_bucket: "vfs-priam" # The unique name for this cluster priam_clustername: "devapicounters" # If you are using VPC or not priam_vpc: true # If you are going to run the ring in multiple regions priam_multiregion_enable: false # Should ALWAYS be set to Ec2MultiRegionSnitch regardless of your deployment plans # UNLESS you are in a VPC, in which case this MUST be set to Ec2Snitch priam_endpoint_snitch: "org.apache.cassandra.locator.Ec2MultiRegionSnitch" # List the zones you will run the cluster in here. priam_zones_available: "us-east-1a,us-east-1d,us-east-1e"
-
General SSL keys for the cassandra secure storage port
./create-priam-keys.sh
-
Build the AMI for the Priam cluster
./resnap.sh <base-pvm-ami-ID> priam
-
In the AWS IAM console left-side menu, click "Roles"
-
Click "Create New Role"
-
Give it a name. ("Priam" is suggested)
-
On the "Select Role Type" screen, click "Select" next to "Amazon EC2"
-
Click "Custom Policy", then "Select"
-
Under "Policy Name", give it the same name as in 3rd point of this section.
-
Under "Policy Document", paste in the file policies/priam.sample from the Buri distribution
-
Edit the following text in what was pasted, to reflect the S3 bucket you have created for Priam backups:
"Resource": [ "arn:aws:s3:::cassandra-archive/*", "arn:aws:s3:::cassandra-archive" ]
-
Click "Continue" and then "Create Role" to complete creating the IAM role needed by Exihibitor.
Note: there must be seperate security groups for each cluster, and they need specific names
- In the AWS EC2 console left-side menu, under "Network & Security", click "Security Groups"
- Click "Create Security Group"
- Give it a name, which must be the priam_cluster_name, prefixed with "priam-", IE: "priam-mycluster".
- Add a description and pick VPC if applicable.
- Add a rule to allow SSH from the source IPs you wish to administrate from
- Add a rule to allow port 8080 from the source IPs you wish to administrate from
- Click "Create"
- Make note of the security group ID, and edit the inbound rules for the security group again
- Add a rule to allow all TCP ports from 1024-65535 from other members of the security group. (IE: place the ID in the source column)
Priam must be launched in an autoscaling group. This and the following step detail this as seen from the EC2 management console.
-
In the AWS EC2 console left-side menu, under "Auto Scaling", click "Launch Configurations"
-
Click "Create launch configuration"
-
Select the AMI built in step 2
-
Select a machine type. You want one with considerable storage and memory available, and ideally, solid state disks. This i2.* machine types are well suited. (Requires using HVM AMI type.)
-
Name the launch configuration in the form: "clustername-useast1". Note the lack of dashes in the region name.
-
Ensure the IAM role created in step 3 is selected.
-
Under "Advanced Details", ensure "Assign a public IP to every instance" is selected if you are using a VPC.
-
Ensure all the available instance stores are mapped if there is more than one ephemeral disk on your machine type.
-
Select the security group created in step 4
-
Review the settings and complete the setup.
It is important to understand that the parameters of the autoscale groups determine how priam will configure the underlying Cassandra ring, and influence token selection.
The following steps must be performed for each of the availability zones specified in priam_zones_available setting. (3 zones = 3 scale groups)
-
In the AWS EC2 console left-side menu, under "Auto Scaling", click "Auto Scaling Groups"
-
Click "Create Auto Scaling group"
-
Select the launch configuration created in [step 5](step 5)
-
In naming the group, it MUST be named in the form: "clustername-useast1a". Failing to do so will cause Priam to not be able find the node configuration.
-
Select your VPC if you are using one, and pick the availability zone (not on VPC) or subnet (if on VPC), that correlates to the availability zone you are setting up this autoscale group for.
-
Set the scaling parameters instance range to the same number. IE: if you are looking for 3 nodes per zone, set to "Scale between 3 and 3 instances"
-
Setup notifications in whatever manner you see fit.
-
Review and finalize
-
Repeat for all remaining availability zones