12/02/2013 - GĂ©rard Dethier (@gdethier)
In this blog post, we explain how to deploy and scale a cluster hosting a distributed object store and file system called Ceph in the Cloud using ComodIT’s orchestration possibilities. Orchestration was already illustrated in a previous post with a web cluster hosting a Wordpress blog. We successfully tested the deployment of Ceph cluster on Amazon EC2 and Openstack, however it should be possible to use any platform supported by ComodIT (Eucalyptus, Rackspace, etc.) or even deploy the cluster on a bare-metal infrastructure.
The ceph orchestration scripts are available in the ComodIT repository. These scripts target CentOS distributions.
If you have other orchestration use cases, we’d be happy to help you out. Contact us and let’s discuss about it.
A typical Ceph cluster is composed of several instances of each of these services:
In particular, OSDs should be particularly numerous to obtain a large storage. Multiple MONs and MDSs allow to achieve scalability and reliability. Finally, data are replicated among OSDs for reliability.
A Ceph cluster can be scaled in 2 ways:
A ComodIT account (you can register for free here).
A ComodIT platform.
If you havn't done it yet, add your cloud platform to ComodIT. In the ‘Platform’ section, click the Add button, pick a driver and fill in the specific details. For more information, you can follow one of these tutorials.
A ComodIT distribution.
The application templates used in this orchestration scripts have been written for CentOS 6.3. You should therefore deploy on a compatible distribution. If you deploy on EC2, the easier is to get the ‘CentOS 6.3 (AMI)’ image from the ComodIT marketplace.
the ComodIT Python library (bundled with command-line interface, see this tutorial for information about how to install it).
Clone the demos public repository and enter Ceph cluster’s folder:
git clone git@github.com:comodit/demos.git
cd demos/ceph-cluster
Create a config.py
file with the following content:
endpoint = "https://my.comodit.com/api"
username = "<user>"
password = "<password>"
organization = "<org_name>"
time_out = 60 * 30 # seconds
admin_key = "AQAEKwlRgBqsDhAA7cwN/JtEyCym6vYN/ixHqA=="
platform = {"name" : "<plat_name>",
"settings" : { ... }
}
distribution = {"name" : "<dist_name>",
"settings" : { ... }
}
where <user>
and <password>
are your ComodIT credentials, <org_name>
the
name of your organization, <plat_name>
the name of a platform in your
organization and <dist_name>
the name of a distribution in your organization.
You should also fill the settings for both platform and distribution.
For instance, you may use an Amazon EC2 platform and store’s CentOS 6.3 AMI. In this case, platform settings look like:
"settings" : {
"ec2.instanceType": "t1.micro",
"ec2.securityGroups": "default",
"ec2.zone": "eu-west-1a",
"ec2.keyPair": "<key name>"
}
where <key name>
is a key pair name and distribution takes no setting:
"settings" : {}
Setup you ComodIT account i.e. create all required applications and create an environment that will contain cluster’s hosts:
./setup.py
Actually deploy the cluster:
./deploy.py
A simple Ceph cluster composed of 1 MON, 1 MDS and 2 OSDs hosted by 3 hosts is deployed: the MON and the MDS are hosted by the same host, the OSDs have their own host. Of course, this is not an architecture to use in production, you should always have several MONs. The complete deployment takes a few minutes on Amazon EC2.
Deployment script prints the public address of what we call the master node i.e. the computer hosting the monitor and MDS. You can connect to this host using SSH and check cluster’s health using the following command (executed as super-user or root):
ceph -s
See Ceph’s documentation for more details.
Add an OSD to deployed cluster:
./scale_osds.py -c 1
-c
option is the number of OSDs to add.
Add a monitor to deployed cluster:
./scale_mons.py -c 1
-c
option is the number of monitors to add.
You can delete all hosts created during deployment and scaling operations:
./teardown.py
If you also want to clean-up your organization i.e. delete the applications and environment created by setup script:
./cleanup.py
blog comments powered by Disqus
10 Sep 2013 by Laurent Eschenauer
15 May 2013 by Laurent Eschenauer
18 Apr 2013 by Laurent Eschenauer
2016 © ComodIT. All Rights Reserved. Privacy Policy | Terms of Service