|
| 1 | +.. _getting-started: |
| 2 | + |
| 3 | +=============================== |
| 4 | +Getting started with cfncluster |
| 5 | +=============================== |
| 6 | + |
| 7 | +cfncluster is a framework that deploys and maintains HPC clusters on |
| 8 | +AWS. It is reasonably agnostic to what the cluster is for and can easily be |
| 9 | +extended to support different frameworks. The CLI is stateless, |
| 10 | +everything is done using CloudFormation or resources within AWS. |
| 11 | + |
| 12 | +Installing cfncluster |
| 13 | +--------------------- |
| 14 | + |
| 15 | +The current working version is cfncluster-0.0.16. The CLI is written in python |
| 16 | +and uses BOTO for AWS actions. You can install the CLI with the following command: |
| 17 | + |
| 18 | +#### Linux/OSX |
| 19 | + |
| 20 | +``` |
| 21 | +$ sudo pip install cfncluster |
| 22 | +``` |
| 23 | +or |
| 24 | +``` |
| 25 | +$ sudo easy_install cfncluster |
| 26 | +``` |
| 27 | + |
| 28 | +#### Windows |
| 29 | +Windows support is experimental!! |
| 30 | + |
| 31 | +Install the following packages: |
| 32 | + |
| 33 | +Python2.7 - https://www.python.org/download/ |
| 34 | + |
| 35 | +setuptools - https://pypi.python.org/pypi/setuptools#windows-7-or-graphical-install |
| 36 | + |
| 37 | +Once installed, you should update the Environment Variables to have the Python install directory and Python Scripts directory in the PATH, for example: C:\Python27;C:\Python27\Scripts |
| 38 | + |
| 39 | +Now it should be possible to run the following within a command prompt window: |
| 40 | + |
| 41 | +``` |
| 42 | +C:\> easy_install cfncluster |
| 43 | +``` |
| 44 | + |
| 45 | +#### Upgrading |
| 46 | + |
| 47 | +To upgrade an older version of cfncluster, you can use either of the following commands, |
| 48 | +depening on how it was originally installed: |
| 49 | + |
| 50 | +``` |
| 51 | +$ sudo pip install --upgrade cfncluster |
| 52 | +``` |
| 53 | +or |
| 54 | +``` |
| 55 | +$ sudo easy_install -U cfncluster |
| 56 | +``` |
| 57 | + |
| 58 | +** Remember when upgrading to check that the exiting config is compatible with the latest |
| 59 | +version installed. |
| 60 | + |
| 61 | +====================== |
| 62 | +Configuring cfncluster |
| 63 | +====================== |
| 64 | + |
| 65 | +Once installed you will need to setup some initial config. The easiest way to do this is below: |
| 66 | + |
| 67 | +``` |
| 68 | +$ cfncluster create mycluster |
| 69 | +Starting: mycluster |
| 70 | +Default config /home/ec2-user/.cfncluster/config not found |
| 71 | +You can copy a template from here: /usr/lib/python2.6/site-packages/cfncluster/examples/config |
| 72 | +$ |
| 73 | +$ cp /usr/lib/python2.6/site-packages/cfncluster/examples/config ~/.cfncluster |
| 74 | +``` |
| 75 | + |
| 76 | +You should now edit the config and set some defaults before launching the cluster. First define |
| 77 | +a keypair that already exists in EC2. If you do not already have a keypair, refer to the EC2 |
| 78 | +documentation on EC2 Key Pairs - http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html |
| 79 | + |
| 80 | +Then you should associate your choosen keypair with the cluster template. |
| 81 | +```` |
| 82 | +[cluster default] |
| 83 | +# Name of an existing EC2 KeyPair to enable SSH access to the instances. |
| 84 | +key_name = mykey |
| 85 | +``` |
| 86 | + |
| 87 | +Next, a simple cluster launches into a VPC and uses an existing subnet which supports public |
| 88 | +IP's i.e. the route table for the subnet is 0.0.0.0/0 => igw-xxxxxx. The VPC must have |
| 89 | +"DNS Resolution = yes" and "DNS Hostnames = yes". It should also have DHCP options with the |
| 90 | +correct "domain-name" for the region, as defined in the docs: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html |
| 91 | + |
| 92 | +``` |
| 93 | +## VPC Settings |
| 94 | +[vpc public] |
| 95 | +# ID of the VPC you want to provision cluster into. |
| 96 | +vpc_id = CHANGE ME, for example vpc-a1b2c3d4 |
| 97 | +# ID of the Subnet you want to provision the Master server into |
| 98 | +master_subnet_id = CHANGE ME, for exaple subnet-1ab2c3d4 |
| 99 | +``` |
| 100 | + |
| 101 | +Once all of those settings contain valid values, you can launch the cluster by repeating the command that was used at the start. |
| 102 | +``` |
| 103 | +$ cfncluster create mycluster |
| 104 | +``` |
| 105 | +Once the cluster reaches the "CREATE_COMPLETE" status, you can connect using your normal SSH client/settings. For more details on connecting to EC2 instances, check the EC2 User Guide - http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-connect-to-instance-linux.html#using-ssh-client |
0 commit comments