<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Mathiaz&#039;s Weblog</title>
	<atom:link href="http://ubuntumathiaz.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ubuntumathiaz.wordpress.com</link>
	<description>Some thoughts from an Ubuntu Developer</description>
	<lastBuildDate>Thu, 29 Sep 2011 15:59:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ubuntumathiaz.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Mathiaz&#039;s Weblog</title>
		<link>http://ubuntumathiaz.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ubuntumathiaz.wordpress.com/osd.xml" title="Mathiaz&#039;s Weblog" />
	<atom:link rel='hub' href='http://ubuntumathiaz.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Overview of a Puppet Split CA architecture</title>
		<link>http://ubuntumathiaz.wordpress.com/2010/10/06/overview-of-a-puppet-split-ca-architecture/</link>
		<comments>http://ubuntumathiaz.wordpress.com/2010/10/06/overview-of-a-puppet-split-ca-architecture/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 21:49:14 +0000</pubDate>
		<dc:creator>Mathias Gug</dc:creator>
				<category><![CDATA[cloud]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://ubuntumathiaz.wordpress.com/?p=247</guid>
		<description><![CDATA[The Puppet Master CA is the only Certificate Authority (CA) in the whole infrastructure. It issues certificates for all Puppet agents. It also manages the Puppet Master systems. The Puppet Masters are only responsible for compiling catalogs requested by Puppet Agents &#8211; they don&#8217;t act as CA themselves. They only accept Puppet Agents which certificates [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=247&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://ubuntumathiaz.files.wordpress.com/2010/10/overview.png"><img class="aligncenter size-full wp-image-252" title="Puppet Split CA architecture" src="http://ubuntumathiaz.files.wordpress.com/2010/10/overview.png?w=300&#038;h=200" alt="" width="300" height="200" /></a><br />
The Puppet Master CA is the only Certificate Authority (CA) in the whole infrastructure. It issues certificates for all Puppet agents. It also manages the Puppet Master systems.</p>
<p>The Puppet Masters are only responsible for compiling catalogs requested by Puppet Agents &#8211; they don&#8217;t act as CA themselves. They only accept Puppet Agents which certificates have been issued by the Puppet Master CA.</p>
<p>The Puppet Agent retrieves their certificates from the Puppet Master CA the first time they run. They connect to the Puppet Masters afterwards to get their catalogs. They won&#8217;t contact the Puppet Master CA anymore.</p>
<h3>Puppet Master CA</h3>
<p>The Puppet Master CA manages all Puppet Masters. In particular it distributes its own Certificate Revocation List (CRL) file to every Puppet Master. The Puppet Master CA also issues certificates to Puppet Agents.</p>
<h3>Puppet Master</h3>
<p>A Puppet Master runs under Apache and Passenger. Apache ssl module is configured to <strong>require</strong> certificates signed by the Puppet Master CA (<em>/etc/apache2/site-available/puppetmaster</em>):</p>
<pre> # Require certificates to be valid
 SSLVerifyClient require
 SSLVerifyDepth  1</pre>
<p>The Puppet Master is also configured to not act as a Puppet CA (<em>/etc/puppet/puppet.conf</em>):</p>
<pre> [main]
 ca = false</pre>
<h3>Puppet Agent</h3>
<p>Puppet Agents retrieve their certificate from the Puppet Master CA and request their catalog from one of the Puppet Masters (<em>/etc/puppet/puppet.conf</em>):</p>
<pre> [agent]
 ca_server = PUPPET_MASTER_CA
 server = PUPPET_MASTER</pre>
<h3>Conclusion</h3>
<p>From a security perspective setting the <em>SSLVerifyClient</em> option to <strong>require</strong> increases the protection of Puppet Masters from unknown requests and revoked Puppet Agents. Having the Puppet Master CA manage the Puppet Masters also facilitates the distribution of the Puppet Master CA CRL.</p>
<p>On the reliability front new systems won&#8217;t be added to the infrastructure if the Puppet Master CA is unavailable. However existing Puppet Agents are still functional as long as they can connect to a Puppet Master.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ubuntumathiaz.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ubuntumathiaz.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ubuntumathiaz.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ubuntumathiaz.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ubuntumathiaz.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ubuntumathiaz.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ubuntumathiaz.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ubuntumathiaz.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ubuntumathiaz.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ubuntumathiaz.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ubuntumathiaz.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ubuntumathiaz.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ubuntumathiaz.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ubuntumathiaz.wordpress.com/247/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=247&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ubuntumathiaz.wordpress.com/2010/10/06/overview-of-a-puppet-split-ca-architecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mathiaz</media:title>
		</media:content>

		<media:content url="http://ubuntumathiaz.files.wordpress.com/2010/10/overview.png" medium="image">
			<media:title type="html">Puppet Split CA architecture</media:title>
		</media:content>
	</item>
		<item>
		<title>Deploying a Hadoop cluster on EC2/UEC with Puppet and Ubuntu Maverick</title>
		<link>http://ubuntumathiaz.wordpress.com/2010/09/27/deploying-a-hadoop-cluster-on-ec2uec-with-puppet-and-ubuntu-maverick/</link>
		<comments>http://ubuntumathiaz.wordpress.com/2010/09/27/deploying-a-hadoop-cluster-on-ec2uec-with-puppet-and-ubuntu-maverick/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 01:02:08 +0000</pubDate>
		<dc:creator>Mathias Gug</dc:creator>
				<category><![CDATA[cloud]]></category>
		<category><![CDATA[hadoop]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://ubuntumathiaz.wordpress.com/?p=228</guid>
		<description><![CDATA[A Hadoop Cluster running on EC2/UEC deployed by puppet on Ubuntu Maverick. How it works The Cloud Conductor is located outside the AWS infrastructure as it needs AWS credentials to start new instances. The Puppet Master runs in EC2 and uses S3 to check which clients it should accept. The Hadoop Namenode, Jobtracker and Worker [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=228&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://ubuntumathiaz.files.wordpress.com/2010/09/overview.png"><img class="alignnone size-full wp-image-229" title="Hadoop_Cluster_EC2_Puppet_Ubuntu" src="http://ubuntumathiaz.files.wordpress.com/2010/09/overview.png?w=450&#038;h=300" alt="" width="450" height="300" /></a><br />
A Hadoop Cluster running on EC2/UEC deployed by puppet on Ubuntu Maverick.</p>
<h3>How it works</h3>
<p>The <a href="https://ubuntumathiaz.wordpress.com/2010/04/07/using-puppet-in-uecec2-node-classification-4/">Cloud Conductor</a> is located outside the AWS infrastructure as it needs AWS credentials to start new instances. The Puppet Master runs in EC2 and uses S3 to check which clients it should accept.</p>
<p>The Hadoop Namenode, Jobtracker and Worker are also running in EC2. The Puppet Master automatically configures them so that each Worker can connect to the Namenode and Jobtracker.</p>
<p>The Puppet Master uses<a href="http://projects.puppetlabs.com/projects/puppet/wiki/Using_Stored_Configuration"> Stored Configuration</a> to distribute configuration between all the Hadoop components. For example the Namenode IP address is automatically pushed to the Jobtracker and the Worker nodes so that they can connect to the Namenode.</p>
<p>Ubuntu Maverick is used since Puppet 2.6 is required. The excellent <a href="http://www.cloudera.com/">Cloudera</a> CDH3 Beta2 packages provide the base Hadoop foundation.</p>
<p>Puppet recipes and the Cloud Conductor scripts are available in a <a href="https://code.launchpad.net/~mathiaz/+junk/hadoop-cluster-puppet-conf/">bzr branch on Launchpad</a>.</p>
<h3>Setup the Cloud Conductor</h3>
<p>The first part of the Cloud Conductor is the <strong>start_instance.py</strong> script. It takes care of starting new instances in EC2 and registering them in S3. Its configuration lives in <strong>start_instance.yaml</strong>. Both files are located in the <strong>conductor</strong> directory of the bzr branch.</p>
<p>The following options are available on the cloud conductor:</p>
<ul>
<li><em>s3_bucket_name</em>: Sets the name of the S3 bucket used to store the list of instances started by the Cloud Conductor. The Puppet Master uses the same bucket to check which Puppet Client should be accepted.</li>
<li><em>ami_id</em>: Sets the id of the AMI the Cloud Conductor will use to start new instances.</li>
<li><em>cloud_init</em>: Sets specific cloud-init parameters. All of the puppet client configuration is defined here.Public ssh keys (for example from Launchpad) can be configured using the <strong>ssh_import_id</strong> option. The <a href="http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/maverick/cloud-init/maverick/files/head%3A/doc/">cloud-init documentation </a>has more information [1] about what can be configured when starting new instances.</li>
</ul>
<p>A sample <strong>start_instance.yaml</strong> file looks like this:</p>
<p><code># Name of the S3 bucket to use to store the certname of started instances<br />
s3_bucket_name: mathiaz-hadoop-cluster<br />
# Base AMI id to use to start all instances<br />
ami_id: ami-c210e5ab<br />
# Extra information passed to cloud-init when starting new instances<br />
# see cloud-init documentation for available options.<br />
cloud_init: &amp;site-cloud-init<br />
ssh_import_id: mathiaz</code></p>
<p>Once the Cloud Conductor is configured a Puppet Master can be started:<br />
<code> </code></p>
<p><code>./start_instance.py puppetmaster</code></p>
<h3>Setup the Puppet Master</h3>
<p>Once the instance has started and its ssh fingerprints can be verified the puppet recipes are deployed on the Puppet Master:<br />
<code> </code></p>
<p><code>bzr branch lp:~mathiaz/+junk/hadoop-cluster-puppet-conf ~/puppet/<br />
sudo mv /etc/puppet/ /etc/old.puppet<br />
sudo mv ~/puppet/ /etc/</code></p>
<p>The S3 bucket name is set in the Puppet Master configuration <strong>/etc/puppet/manifests/puppetmaster.pp</strong>:<br />
<code> </code></p>
<p><code>node default {<br />
class {<br />
"puppet::ca":<br />
node_bucket =&gt; "https://mathiaz-hadoop-cluster.s3.amazonaws.com";<br />
}<br />
}</code></p>
<p>And finally the Puppet Master installation can be completed by puppet itself:</p>
<p><code>sudo puppet apply /etc/puppet/manifests/puppetmaster.pp</code></p>
<p>A Puppet Master is now running into EC2 with all the recipes required to deploy the different components of a Hadoop Cluster.</p>
<h3>Update the Cloud Conductor configuration</h3>
<p>Since the Cloud Conductor starts instances that will connect to the Puppet Master it needs to know some information about the Puppet Master:</p>
<ul>
<li>the Puppet Master internal IP address or DNS name. For example the DNS name of the instance (which is the FQDN) can be used.</li>
<li>the Puppet Master certificate (located in <strong>/var/lib/puppet/ssl/ca/ca_crt.pem</strong>):</li>
</ul>
<p>On the Cloud Conductor the information gathered on the Puppet Master is added to <strong>start_instance.yaml</strong>:</p>
<p><code> agent:<br />
# Puppet server hostname or IP<br />
# In EC2 the Private DNS of the instance should be used<br />
server: domU-12-31-38-00-35-98.compute-1.internal<br />
# NB: the certname will automatically be added by start_instance.py<br />
# when a new instance is started.<br />
# Puppetmaster ca certificate<br />
# located in /var/lib/puppet/ssl/ca/ca_crt.pem on the puppetmaster system<br />
ca_cert: |<br />
-----BEGIN CERTIFICATE-----<br />
MIICFzCCAYCgAwIBAgIBATANBgkqhkiG9w0BAQUFADAUMRIwEAYDVQQDDAlQdXBw<br />
[ ... ]<br />
k0r/nTX6Tmr8TTU=<br />
-----END CERTIFICATE-----</code></p>
<h3>Start the Hadoop Namenode</h3>
<p>Once the Puppet Master and Cloud Conductor are configured the Hadoop Cluster can be deployed. First in line is the Hadoop Namenode:<br />
<code> </code></p>
<p><code>./start_instance.py namenode</code></p>
<p>After a few minutes the Namenode puppet client requests a certificate:<br />
<code> puppet-master[7397]: Starting Puppet master version 2.6.1<br />
puppet-master[7397]: 53b0b7bf-723c-4a0f-b4b1-082ebec84041 has a waiting certificate request</code><br />
The Master signs the CSR:<br />
<code> </code></p>
<p><code>CRON[8542]: (root) CMD (/usr/local/bin/check_csr https://mathiaz-hadoop-cluster.s3.amazonaws.com)<br />
check_csr[8543]: INFO: Signing request: 53b0b7bf-723c-4a0f-b4b1-082ebec84041</code></p>
<p>And finally the Master compiles the manifest for the Namenode:<br />
<code> </code></p>
<p><code>node_classifier[8989]: DEBUG: Checking url https://mathiaz-hadoop-cluster.s3.amazonaws.com/53b0b7bf-723c-4a0f-b4b1-082ebec84041<br />
node_classifier[8989]: INFO: Getting node configuration: 53b0b7bf-723c-4a0f-b4b1-082ebec84041<br />
node_classifier[8989]: DEBUG: Node configuration (53b0b7bf-723c-4a0f-b4b1-082ebec84041): classes: ['hadoop::namenode']<br />
puppet-master[7397]: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find stage hadoop-base specified by Class[Hadoop::Base] at /etc/puppet/modules/hadoop/manifests/init.pp:142 on node 53b0b7bf-723c-4a0f-b4b1-082ebec84041</code></p>
<p>Unfortunately there is a bug related to puppet stages. As a workaround the puppet agent can be restarted:<br />
<code> </code></p>
<p><code>sudo /etc/init.d/puppet restart</code></p>
<p>Looking at the syslog file on the Namenode the Puppet Agent installs and configures the Hadoop Namenode:<br />
<code> </code></p>
<p><code>puppet-agent[1795]: Starting Puppet client version 2.6.1<br />
puppet-agent[1795]: (/Stage[apt]/Hadoop::Apt/Apt::Key[cloudera]/File[/etc/apt/cloudera.key]/ensure) defined content as '{md5}dc59b632a1ce2ad325c40d0ba4a4927e'<br />
puppet-agent[1795]: (/Stage[apt]/Hadoop::Apt/Apt::Key[cloudera]/Exec[import apt key cloudera]) Triggered 'refresh' from 1 events<br />
puppet-agent[1795]: (/Stage[apt]/Hadoop::Apt/Apt::Sources_list[canonical]/File[/etc/apt/sources.list.d/canonical.list]/ensure) created<br />
puppet-agent[1795]: (/Stage[apt]/Hadoop::Apt/Apt::Sources_list[cloudera]/File[/etc/apt/sources.list.d/cloudera.list]/ensure) created<br />
puppet-agent[1795]: (/Stage[apt]/Apt::Apt/Exec[apt-get_update]) Triggered 'refresh' from 3 events</code></p>
<p>The first stage of the puppet run sets up the Canonical partner archive and the Cloudera archive. The Sun JVM is pulled from the Canonical archive while Hadoop packages are downloaded from the Cloudera archive.</p>
<p>The following stage creates a common Hadoop configuration:<br />
<code> </code></p>
<p><code>puppet-agent[1795]: (/Stage[hadoop-base]/Hadoop::Base/File[/var/cache/debconf/sun-java6.seeds]/ensure) defined content as '{md5}1e3a7ac4c2dc9e9c3a1ae9ab2c040794'<br />
puppet-agent[1795]: (/Stage[hadoop-base]/Hadoop::Base/Package[sun-java6-bin]/ensure) ensure changed 'purged' to 'latest'<br />
puppet-agent[1795]: (/Stage[hadoop-base]/Hadoop::Base/Package[hadoop-0.20]/ensure) ensure changed 'purged' to 'latest'<br />
puppet-agent[1795]: (/Stage[hadoop-base]/Hadoop::Base/File[/var/lib/hadoop-0.20/dfs]/ensure) created<br />
puppet-agent[1795]: (/Stage[hadoop-base]/Hadoop::Base/File[/etc/hadoop-0.20/conf.puppet]/ensure) created<br />
puppet-agent[1795]: (/Stage[hadoop-base]/Hadoop::Base/File[/etc/hadoop-0.20/conf.puppet/hdfs-site.xml]/ensure) defined content as '{md5}1f9788fceffdd1b2300c06160e7c364e'<br />
puppet-agent[1795]: (/Stage[hadoop-base]/Hadoop::Base/Exec[/usr/sbin/update-alternatives --install /etc/hadoop-0.20/conf hadoop-0.20-conf /etc/hadoop-0.20/conf.puppet 15]) Triggered 'refresh' from 1 events<br />
puppet-agent[1795]: (/Stage[hadoop-base]/Hadoop::Base/File[/etc/default/hadoop-0.20]/content) content changed '{md5}578894d1b3f7d636187955c15b8edb09' to '{md5}ecb699397751cbaec1b9ac8b2dd0b9c3'</code><br />
Finally the Hadoop Namenode is configured:<br />
<code> </code></p>
<p><code>puppet-agent[1795]: (/Stage[main]/Hadoop::Namenode/Package[hadoop-0.20-namenode]/ensure) ensure changed 'purged' to 'latest'<br />
puppet-agent[1795]: (/Stage[main]/Hadoop::Namenode/File[hadoop-core-site]/ensure) defined content as '{md5}2f2445bf3d4e26f5ceb3c32047b19419'<br />
puppet-agent[1795]: (/Stage[main]/Hadoop::Namenode/File[/var/lib/hadoop-0.20/dfs/name]/ensure) created<br />
puppet-agent[1795]: (/Stage[main]/Hadoop::Namenode/Exec[format-dfs]) Triggered 'refresh' from 1 events<br />
puppet-agent[1795]: (/Stage[main]/Hadoop::Namenode/Service[hadoop-0.20-namenode]/ensure) ensure changed 'stopped' to 'running'<br />
puppet-agent[1795]: (/Stage[main]/Hadoop::Namenode/Service[hadoop-0.20-namenode]) Failed to call refresh: Could not start Service[hadoop-0.20-namenode]: Execution of '/etc/init.d/hadoop-0.20-namenode start' returned 1:  at /etc/puppet/modules/hadoop/manifests/init.pp:177</code></p>
<p>There is another bug in the Hadoop init script this time: the Namenode cannot be started. The puppet agent can be restarted or the next puppet run will start it:<br />
<code> </code></p>
<p><code>sudo /etc/init.d/puppet restart</code></p>
<p>The Namenode daemon is running and logs information to its log file in <strong>/var/log/hadoop/hadoop-hadoop-namenode-*.log</strong>:<br />
<code> </code></p>
<p><code>[...]<br />
INFO org.apache.hadoop.hdfs.server.namenode.NameNode: Web-server up at: 0.0.0.0:50070<br />
[...]<br />
INFO org.apache.hadoop.ipc.Server: IPC Server handler 9 on 8200: starting<br />
INFO org.apache.hadoop.ipc.Server: IPC Server handler 8 on 8200: starting</code></p>
<h3>Start the Hadoop Jobtracker</h3>
<p>The next component to start is the Hadoop Jobtracker:<br />
<code> </code></p>
<p><code>./start_instance.py jobtracker</code></p>
<p>After some time the Puppet Master compiles the Jobtracker manifest:<br />
<code> </code></p>
<p><code>DEBUG: Checking url https://mathiaz-hadoop-cluster.s3.amazonaws.com/2faa4de9-c708-45ab-a515-ae041a9d0239<br />
node_classifier[30683]: INFO: Getting node configuration: 2faa4de9-c708-45ab-a515-ae041a9d0239<br />
node_classifier[30683]: DEBUG: Node configuration (2faa4de9-c708-45ab-a515-ae041a9d0239): classes: ['hadoop::jobtracker']<br />
puppet-master[23542]: Compiled catalog for 2faa4de9-c708-45ab-a515-ae041a9d0239 in environment production in 2.00 seconds</code></p>
<p>On the instance the puppet agent configures the Hadoop Jobtracker:<br />
<code> </code></p>
<p><code>puppet-agent[1035]: (/Stage[main]/Hadoop::Jobtracker/File[hadoop-mapred-site]/ensure) defined content as '{md5}af3b65a08df03e14305cc5fd56674867'<br />
puppet-agent[1035]: (/Stage[main]/Hadoop::Jobtracker/File[hadoop-core-site]/ensure) defined content as '{md5}2f2445bf3d4e26f5ceb3c32047b19419'<br />
puppet-agent[1035]: (/Stage[main]/Hadoop::Jobtracker/Package[hadoop-0.20-jobtracker]/ensure) ensure changed 'purged' to 'latest'<br />
puppet-agent[1035]: (/Stage[main]/Hadoop::Jobtracker/Service[hadoop-0.20-jobtracker]/ensure) ensure changed 'stopped' to 'running'<br />
puppet-agent[1035]: (/Stage[main]/Hadoop::Jobtracker/Service[hadoop-0.20-jobtracker]) Failed to call refresh: Could not start Service[hadoop-0.20-jobtracker]: Execution of '/etc/init.d/hadoop-0.20-jobtracker start' returned 1:  at /etc/puppet/modules/hadoop/manifests/init.pp:135</code></p>
<p>There is the same bug in the init script. Let&#8217;s restart the puppet agent:<br />
<code> </code></p>
<p><code>sudo /etc/init.d/puppet restart</code></p>
<p>The Jobtracker connects to the Namenode and error messages are logged on a regular basis to both the Namenode and Jobtracker log files:<br />
<code> </code></p>
<p><code>INFO org.apache.hadoop.ipc.Server: IPC Server handler 7 on 8200, call<br />
addBlock(/hadoop/mapred/system/jobtracker.info, DFSClient_-268101966, null)<br />
from 10.122.183.121:54322: error: java.io.IOException: File<br />
/hadoop/mapred/system/jobtracker.info could only be replicated to 0 nodes,<br />
instead of 1<br />
java.io.IOException: File /hadoop/mapred/system/jobtracker.info could only be<br />
replicated to 0 nodes, instead of 1</code></p>
<p>This is normal as there aren&#8217;t any Datanode daemon available for data replication.</p>
<h3>Start Hadoop workers</h3>
<p>It&#8217;s now time to start the Hadoop Worker to get an operational Hadoop Cluster:<br />
<code> </code></p>
<p><code>./start_instance.py worker</code></p>
<p>The Hadoop Worker holds both a Data node and a Task tracker. The Puppet agent configures them to talk to the Namenode and Job tracker respectively.</p>
<p>After some time the Puppet Master compiles the catalog for the Hadoop Worker:<br />
<code> </code></p>
<p><code>node_classifier[8368]: DEBUG: Checking url https://mathiaz-hadoop-cluster.s3.amazonaws.com/b72a8f4d-55e6-4059-ac4b-26927f1a1016<br />
node_classifier[8368]: INFO: Getting node configuration: b72a8f4d-55e6-4059-ac4b-26927f1a1016<br />
node_classifier[8368]: DEBUG: Node configuration (b72a8f4d-55e6-4059-ac4b-26927f1a1016): classes: ['hadoop::worker']<br />
puppet-master[23542]: Compiled catalog for b72a8f4d-55e6-4059-ac4b-26927f1a1016 in environment production in 0.18 seconds</code></p>
<p>On the instance the puppet agent installs the Hadoop worker:<br />
<code> </code></p>
<p><code>puppet-agent[1030]: (/Stage[main]/Hadoop::Worker/File[hadoop-mapred-site]/ensure) defined content as '{md5}af3b65a08df03e14305cc5fd56674867'<br />
puppet-agent[1030]: (/Stage[main]/Hadoop::Worker/Package[hadoop-0.20-datanode]/ensure) ensure changed 'purged' to 'latest'<br />
puppet-agent[1030]: (/Stage[main]/Hadoop::Worker/File[/var/lib/hadoop-0.20/dfs/data]/ensure) created<br />
puppet-agent[1030]: (/Stage[main]/Hadoop::Worker/Package[hadoop-0.20-tasktracker]/ensure) ensure changed 'purged' to 'latest'<br />
puppet-agent[1030]: (/Stage[main]/Hadoop::Worker/File[hadoop-core-site]/ensure) defined content as '{md5}2f2445bf3d4e26f5ceb3c32047b19419'<br />
puppet-agent[1030]: (/Stage[main]/Hadoop::Worker/Service[hadoop-0.20-datanode]/ensure) ensure changed 'stopped' to 'running'<br />
puppet-agent[1030]: (/Stage[main]/Hadoop::Worker/Service[hadoop-0.20-datanode]) Failed to call refresh: Could not start Service[hadoop-0.20-datanode]: Execution of '/etc/init.d/hadoop-0.20-datanode start' returned 1:  at /etc/puppet/modules/hadoop/manifests/init.pp:103<br />
puppet-agent[1030]: (/Stage[main]/Hadoop::Worker/Service[hadoop-0.20-tasktracker]/ensure) ensure changed 'stopped' to 'running'<br />
puppet-agent[1030]: (/Stage[main]/Hadoop::Worker/Service[hadoop-0.20-tasktracker]) Failed to call refresh: Could not start Service[hadoop-0.20-tasktracker]: Execution of '/etc/init.d/hadoop-0.20-tasktracker start' returned 1:  at /etc/puppet/modules/hadoop/manifests/init.pp:103</code></p>
<p>Again the same init script bug &#8211; let&#8217;s restart the puppet agent:<br />
<code> </code></p>
<p><code>sudo /etc/init.d/puppet restart</code></p>
<p>Once the worker is installed the Datanode daemon connects to the Namenode:<br />
<code> </code></p>
<p><code>INFO org.apache.hadoop.hdfs.StateChange: BLOCK* NameSystem.registerDatanode: node registration from 10.249.187.5:50010 storage DS-2066068566-10.249.187.5-50010-1285276011214<br />
INFO org.apache.hadoop.net.NetworkTopology: Adding a new node: /default-rack/10.249.187.5:50010</code></p>
<p>Similarly the Task Tracker daemon registers itself with the Jobtracker:<br />
<code> INFO org.apache.hadoop.net.NetworkTopology: Adding a new node: /default-rack/domU-12-31-39-03-B8-F7.compute-1.internal</code></p>
<p>The Hadoop Cluster is up and running.</p>
<h3>Conclusion</h3>
<p>Once the initial setup of the Puppet master is done and the Hadoop Namenode and Jobtracker are up and running adding new Hadoop Workers is<br />
just one command:</p>
<p><code> ./start_instance.py worker</code></p>
<p>Puppet automatically configures them to join the Hadoop Cluster.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ubuntumathiaz.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ubuntumathiaz.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ubuntumathiaz.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ubuntumathiaz.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ubuntumathiaz.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ubuntumathiaz.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ubuntumathiaz.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ubuntumathiaz.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ubuntumathiaz.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ubuntumathiaz.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ubuntumathiaz.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ubuntumathiaz.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ubuntumathiaz.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ubuntumathiaz.wordpress.com/228/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=228&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ubuntumathiaz.wordpress.com/2010/09/27/deploying-a-hadoop-cluster-on-ec2uec-with-puppet-and-ubuntu-maverick/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mathiaz</media:title>
		</media:content>

		<media:content url="http://ubuntumathiaz.files.wordpress.com/2010/09/overview.png" medium="image">
			<media:title type="html">Hadoop_Cluster_EC2_Puppet_Ubuntu</media:title>
		</media:content>
	</item>
		<item>
		<title>Vote for the Ubuntu stack exchange</title>
		<link>http://ubuntumathiaz.wordpress.com/2010/07/08/vote-for-the-ubuntu-stack-exchange/</link>
		<comments>http://ubuntumathiaz.wordpress.com/2010/07/08/vote-for-the-ubuntu-stack-exchange/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 22:49:03 +0000</pubDate>
		<dc:creator>Mathias Gug</dc:creator>
				<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://ubuntumathiaz.wordpress.com/?p=224</guid>
		<description><![CDATA[This morning Evan email hit my inbox: there is a suggestion to create a stack exchange for Ubuntu. I&#8217;ve always  been impressed by the stackoverflow and serverfault web sites. Granted forums have been around for a long time &#8211; however I love the user interaction provided by the folks behind Stack Exchange. A couple of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=224&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This morning <a href="https://lists.ubuntu.com/archives/ubuntu-devel-discuss/2010-July/011822.html">Evan  email</a> hit my inbox: there is a <a href="http://area51.stackexchange.com/proposals/7716/ubuntu">suggestion  to create a stack exchange for Ubuntu</a>.</p>
<p>I&#8217;ve always  been impressed by the <a href="http://stackoverflow.com/">stackoverflow</a> and <a href="http://serverfault.com/">serverfault</a> web sites. Granted forums have been around for a long time &#8211; however I love the user interaction provided by the folks behind <a href="http://www.stackexchange.com/">Stack Exchange</a>. A couple of months ago they created <a href="http://area51.stackexchange.com/">area51</a> to request new ideas that could use the same framework behind stackoverflow and serverfault. And again the user experience  for handling these requests is great.</p>
<p>In my opinion Stack Exchange provides an excellent user experience that fosters user contributions and collaboration &#8211; in-line with the values of the Ubuntu community.</p>
<p>So I went over to area51 and voted on the on-topic and off-topic  questions for the <a href="http://area51.stackexchange.com/proposals/7716/ubuntu">Ubuntu proposal</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ubuntumathiaz.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ubuntumathiaz.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ubuntumathiaz.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ubuntumathiaz.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ubuntumathiaz.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ubuntumathiaz.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ubuntumathiaz.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ubuntumathiaz.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ubuntumathiaz.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ubuntumathiaz.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ubuntumathiaz.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ubuntumathiaz.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ubuntumathiaz.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ubuntumathiaz.wordpress.com/224/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=224&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ubuntumathiaz.wordpress.com/2010/07/08/vote-for-the-ubuntu-stack-exchange/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mathiaz</media:title>
		</media:content>
	</item>
		<item>
		<title>Velocity 2010: Fast by default &#8211; Thursday</title>
		<link>http://ubuntumathiaz.wordpress.com/2010/07/06/velocity-2010-fast-by-default-thursday/</link>
		<comments>http://ubuntumathiaz.wordpress.com/2010/07/06/velocity-2010-fast-by-default-thursday/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 20:59:53 +0000</pubDate>
		<dc:creator>Mathias Gug</dc:creator>
				<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://ubuntumathiaz.wordpress.com/?p=216</guid>
		<description><![CDATA[Thursday was the last day of the conference and followed the same format as Wednesday: keynotes in the morning, three parallel tracks in the afternoon. Creating Cultural Change John Rauser from Amazon shared a few experiences about creating cultural changes inside and outside organizations. Here are some key takeaways: Try something new Seek group identity [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=216&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Thursday was the last day of the conference and followed the same format as Wednesday: keynotes in the morning, three parallel tracks in the afternoon.</p>
<h3>Creating Cultural Change</h3>
<p>John Rauser from Amazon<a href="http://en.oreilly.com/velocity2010/public/schedule/detail/11793"> shared a few experiences</a> about creating cultural changes inside and outside organizations.</p>
<p>Here are some key takeaways:</p>
<ul>
<li>Try something new</li>
<li>Seek group identity</li>
<li>Welcome newcomers</li>
<li>Be relentless happy</li>
</ul>
<p>Theses ideas actually reminded me of how the Ubuntu community is been built up.</p>
<span style="text-align:center; display: block;"><a href="http://ubuntumathiaz.wordpress.com/2010/07/06/velocity-2010-fast-by-default-thursday/"><img src="http://img.youtube.com/vi/UL2WDcNu_3A/2.jpg" alt="" /></a></span>
<h3>In the Belly of the Whale Operations at Twitter</h3>
<p>John Adams of Twitter <a href="http://en.oreilly.com/velocity2010/public/schedule/detail/12987">presented</a> a few insights on how operations are run at Twitter.</p>
<p>He outlined several principles to keep in mind when building their infrastructure:</p>
<ul>
<li>Nothing works the first time. Plan to rebuild everything more than once.</li>
<li>Deploy faster and more often as less code will change.</li>
<li>Detect problem as early as possible &#8211; to recover fast.</li>
<li>Disable/enable features in production aka Feature darkmode.</li>
</ul>
<p>To support these guiding principles he listed some of the tools that are used:</p>
<ul>
<li>configuration management done with puppet and svn.</li>
<li>Reviewboard to review changes made to the infrastructure</li>
<li>Ganglia to take care of monitoring</li>
<li>Scribe to collect and aggregate all logs into Hadoop HDFS using LZO compression.</li>
<li>Murder to deploy their code to all of their systems via bittorrent.</li>
<li>Google analytics to track errors pages while Whale Watcher to track errors in logs.</li>
<li>Unicorn to powers their rails stack.</li>
</ul>
<span style="text-align:center; display: block;"><a href="http://ubuntumathiaz.wordpress.com/2010/07/06/velocity-2010-fast-by-default-thursday/"><img src="http://img.youtube.com/vi/_7KdeUIvlvw/2.jpg" alt="" /></a></span>
<h3>Lightning talks</h3>
<p>Thursdays lightning <a href="http://en.oreilly.com/velocity2010/public/schedule/detail/15310">talks</a> covered another round of useful tools in helping optimizing page loads:</p>
<ul>
<li>httpwatch: a commercial tool that loads web pages and analyses it</li>
<li>pagetest</li>
<li>speedtracer: chrome browser extension that provides an insight on what the browser is doing when a loading a page</li>
<li>fiddler2</li>
</ul>
<span style="text-align:center; display: block;"><a href="http://ubuntumathiaz.wordpress.com/2010/07/06/velocity-2010-fast-by-default-thursday/"><img src="http://img.youtube.com/vi/0daDZs0c0D0/2.jpg" alt="" /></a></span>
<h3>Moving Fast</h3>
<p>Robert Johnson of Facebook <a href="http://en.oreilly.com/velocity2010/public/schedule/detail/14129">gave a talk </a>about the culture of moving fast at Facebook. Here are a few short sentence to summarize his points:</p>
<ul>
<li>How to scale? Have a team that reacts fast.</li>
<li>The release cycle: Make changes every day as frequent small changes makes it easier to figure out what went wrong.</li>
<li>Control and responsibility to one person.</li>
</ul>
<p>He finished with a few lessons that were learned:</p>
<ul>
<li>New code is slow.</li>
<li>Give developers room to try things.</li>
<li>Nobody&#8217;s job is to say no.</li>
</ul>
<span style="text-align:center; display: block;"><a href="http://ubuntumathiaz.wordpress.com/2010/07/06/velocity-2010-fast-by-default-thursday/"><img src="http://img.youtube.com/vi/nEmJ_5UHs1g/2.jpg" alt="" /></a></span>
<h3>Practice of Continuous Deployment</h3>
<p>Throughout the conference I heard multiple times the idea of continuous deployment. With continuous integration being pushed on on the developer side, its pendant on the ops side is continuous deployment: tests, build, deploy. Deploy multiple times a day with a good monitoring system to identify quickly when things go wrong. When things go wrong it&#8217;s easier to identify what changed as the number of changes is rather low. All the big shops have a deployment dashboard to review what went live, when and by whom.</p>
<p>The launchpad team is already following this idea: <a href="https://edge.launchpad.net/">Launchpad edge</a> has a daily update of the code running against the production database. Releases (with DB schema changes) are conducted on a monthly basis. And Ubuntu is providing something similar as the development version is always available for installation &#8211; and releases are cut every 6 months.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ubuntumathiaz.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ubuntumathiaz.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ubuntumathiaz.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ubuntumathiaz.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ubuntumathiaz.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ubuntumathiaz.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ubuntumathiaz.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ubuntumathiaz.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ubuntumathiaz.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ubuntumathiaz.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ubuntumathiaz.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ubuntumathiaz.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ubuntumathiaz.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ubuntumathiaz.wordpress.com/216/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=216&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ubuntumathiaz.wordpress.com/2010/07/06/velocity-2010-fast-by-default-thursday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mathiaz</media:title>
		</media:content>
	</item>
		<item>
		<title>Velocity 2010: Fast by default &#8211; Tuesday and Wednesday</title>
		<link>http://ubuntumathiaz.wordpress.com/2010/07/05/velocity-2010-fast-by-default-tuesday-and-wednesday/</link>
		<comments>http://ubuntumathiaz.wordpress.com/2010/07/05/velocity-2010-fast-by-default-tuesday-and-wednesday/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 20:45:07 +0000</pubDate>
		<dc:creator>Mathias Gug</dc:creator>
				<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://ubuntumathiaz.wordpress.com/?p=198</guid>
		<description><![CDATA[Here is a report on Velocity 2010, the Web Performance and Operations conference. In its third year it grew to more than 1100 attendees &#8211; this year was sold out. Tuesday workshops Tuesday was dedicated to workshops even though most of them turned out to be presentations with demos given the number of participants. So [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=198&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is a report on <a href="http://en.oreilly.com/velocity2010/">Velocity 2010, the Web Performance and Operations conference</a>. In its third year it grew to more than 1100 attendees &#8211; this year was sold out.</p>
<h2>Tuesday workshops</h2>
<p>Tuesday was dedicated to workshops even though most of them turned out to be presentations with demos given the number of participants. So not a lot of hands-on sessions. Here is a small selection of talks I found interesting throughout the day:</p>
<h3>Infrastructure automation with Chef</h3>
<p><a href="http://en.oreilly.com/velocity2010/public/schedule/detail/14432">Overview</a> of the chef project lead by the high energy and opinionated Adam Jacob from Opscode.</p>
<p>For me the most exciting part was the ability that chef provides a complete view in your infrastructure and the ability to query your infrastructure any way you want.</p>
<p>Adam gave a few high impact principles:</p>
<blockquote><p>Being able to reconstruct a business from a source code repository, a data backup and bare metal resources.</p></blockquote>
<p>Another interesting feature from the knife tool was the ability to start/spawn new instances in EC2 from the command line. For example the following command will give you an ec2 instance running your rails role within a few minutes:</p>
<blockquote><p>knife ec2 server create &#8216;role[rails]&#8216;</p></blockquote>
<h3>Protecting &#8220;Cloud&#8221; Secrets With Grendel</h3>
<p>A technical overview of the <a href="http://github.com/wesabe/grendel">Grendel project:</a> OpenPGP as a software service.</p>
<p>The project gives the ability to share encrypted documents between multiple people. From the security perspective each user private key is stored in the cloud encrypted by a pass phrase only known to the user transmitted via http basic auth.</p>
<h2>Wednesday sessions</h2>
<p>Wednesday was the first day of the conference with keynotes in the morning and three tracks in the afternoon.</p>
<h3>Datacenter Infrastructure Innovation</h3>
<p>James Hamilton from Amazon Web Services gave an <a href="http://en.oreilly.com/velocity2010/public/schedule/detail/15429">interesting overview</a> of the different parts of building a data center.</p>
<p>An interesting point he made was that data center should target 100% usage of their servers while the industry standard is around 10 to 15% utilization on average. This objective lead to the introduction of spot instances in EC2 so that resource usage could be maximized and Amazon cloud infrastructure can be flat lined. That reminds me of some comments from Google engineers stating that they try to pile as much work as possible on each of their servers. At their scale having a server powered off is costing money.</p>
<p>He covered other topics:</p>
<ul>
<li>air conditioning: DC could be run way hotter they are now</li>
<li>power: the cost of power has a small part of the total cost of running a data center &#8211; server hardware being more than half of the cost. This is an interesting point with regards to the whole green computing movement.</li>
</ul>
<span style="text-align:center; display: block;"><a href="http://ubuntumathiaz.wordpress.com/2010/07/05/velocity-2010-fast-by-default-tuesday-and-wednesday/"><img src="http://img.youtube.com/vi/kHW-ayt_Urk/2.jpg" alt="" /></a></span>
<h3>Speed matters</h3>
<p>Urs Hölzle from Google <a href="http://en.oreilly.com/velocity2010/public/schedule/detail/14371">covered</a> the importance of having web page that load fast and a range of improvements Google had been working on for the last years: from the web browser (via chrome) down to the infrastructure (such as dns).</p>
<p>He also highlighted that Google page ranking process now takes into account the speed at which a page loads. As heard multiple times during the conference there is now empirical evidence that links directly the page load speed to revenue: the faster a page load the more people will stay on the web site.</p>
<span style="text-align:center; display: block;"><a href="http://ubuntumathiaz.wordpress.com/2010/07/05/velocity-2010-fast-by-default-tuesday-and-wednesday/"><img src="http://img.youtube.com/vi/MStKwEff_kY/2.jpg" alt="" /></a></span>
<h3>Lightning talks</h3>
<p>Wednesdays<a href="http://en.oreilly.com/velocity2010/public/schedule/detail/15306"> lightning demos</a> show cased a list of tools focusing on highlighting performance bottleneck and helping out tracking why page load are slow and how to improve them:</p>
<ul>
<li><a href="http://developer.yahoo.com/yslow/">Yslow</a></li>
<li><a href="http://www.dynatrace.com/">dynaTrace link</a></li>
<li><a href="http://code.google.com/speed/page-speed/">page speed</a></li>
</ul>
<span style="text-align:center; display: block;"><a href="http://ubuntumathiaz.wordpress.com/2010/07/05/velocity-2010-fast-by-default-tuesday-and-wednesday/"><img src="http://img.youtube.com/vi/33R1FVCArA8/2.jpg" alt="" /></a></span>
<h3>Getting Fast: Moving Towards a Toolchain for Automated Operations</h3>
<p>Lee Thompson and Alex Honor <a href="http://en.oreilly.com/velocity2010/public/schedule/detail/13113">reported</a> on the work of the devtools-toolchain group. The group formed a few months ago to share experiences and build up a set of best practices. Of the use cases they&#8217;ve outlined KaChing&#8217;s Continuous Deployment was the most interesting one:</p>
<pre style="padding-left:30px;">Release is a marketing concern.</pre>
<h3>Facebook operations</h3>
<p>Tom Cook of Facebook <a href="http://en.oreilly.com/velocity2010/public/schedule/detail/13103">gave a sneak peak</a> at the life of operations in Facebook.</p>
<p>Very interesting talk about the developement practices of one of the busiest website of the internet. Facebook is running of two data center (one on the east coast, one of the west coast) while they&#8217;re building their own data center in Oregon.</p>
<p>Their core OS is Centos 5 with a customized kernel. For system management cfengine is set to update every 15 minutes with a cfengine run taking around 30 seconds. All of the changes are peer reviewed.</p>
<p>On the deployment front bug fixes are pushed out once a day while new features are rolled out on a weekly basis. Code is pushed to 10000s of servers using bittorrent swarms. Coordination is done via IRC with the engineer available in case something goes wrong.</p>
<p>The developer is responsible for writing the code as well as testing and deploying it. New code is then exposed to a subset of real traffic. Ops are embedded in engineering teams and take part of design decisions. They&#8217;re actually an interface to other ops.</p>
<p>As a summary tom gave a few points:</p>
<ul>
<li>version control everything</li>
<li>optimize early</li>
<li>automate++</li>
<li>use configuratiom mgmgt</li>
<li>plan to fail</li>
<li>instrument everything</li>
<li>don&#8217;t waste time on dumb stuff</li>
</ul>
<span style="text-align:center; display: block;"><a href="http://ubuntumathiaz.wordpress.com/2010/07/05/velocity-2010-fast-by-default-tuesday-and-wednesday/"><img src="http://img.youtube.com/vi/T-Xr_PJdNmQ/2.jpg" alt="" /></a></span>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ubuntumathiaz.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ubuntumathiaz.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ubuntumathiaz.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ubuntumathiaz.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ubuntumathiaz.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ubuntumathiaz.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ubuntumathiaz.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ubuntumathiaz.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ubuntumathiaz.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ubuntumathiaz.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ubuntumathiaz.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ubuntumathiaz.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ubuntumathiaz.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ubuntumathiaz.wordpress.com/198/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=198&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ubuntumathiaz.wordpress.com/2010/07/05/velocity-2010-fast-by-default-tuesday-and-wednesday/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mathiaz</media:title>
		</media:content>
	</item>
		<item>
		<title>Using puppet in UEC/EC2: Improving performance with Phusion Passenger</title>
		<link>http://ubuntumathiaz.wordpress.com/2010/04/08/using-puppet-in-uecec2-improving-performance-with-phusion-passenger/</link>
		<comments>http://ubuntumathiaz.wordpress.com/2010/04/08/using-puppet-in-uecec2-improving-performance-with-phusion-passenger/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 01:55:37 +0000</pubDate>
		<dc:creator>Mathias Gug</dc:creator>
				<category><![CDATA[cloud]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://ubuntumathiaz.wordpress.com/?p=187</guid>
		<description><![CDATA[Now that we have an efficient process to start instances within UEC/EC2 and get them configured for their task by puppet we&#8217;ll dive into improving the performance of the puppetmaster with Phusion Passenger. Why? The default configuration used by puppetmasterd is based on webrick which doesn&#8217;t really scale well. One popular choice to improve puppetmasterd [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=187&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Now that we have an efficient process to <a class="reference external" href="http://ubuntumathiaz.wordpress.com/2010/03/24/using-puppet-in-uecec2-puppet-support-in-ubuntu-images/">start instances within UEC/EC2</a> and get them <a class="reference external" href="http://ubuntumathiaz.wordpress.com/2010/03/25/using-puppet-in-uecec2-automating-the-signing-process/">configured</a> <a class="reference external" href="http://ubuntumathiaz.wordpress.com/2010/04/07/using-puppet-in-uecec2-node-classification-4/">for their task</a> by puppet we&#8217;ll dive into improving the performance of the <tt class="docutils literal">puppetmaster</tt> with <a class="reference external" href="http://www.modrails.com/">Phusion Passenger</a>.</p>
<div id="why" class="section">
<h3>Why?</h3>
<p>The default configuration used by puppetmasterd is based on webrick which doesn&#8217;t really scale well. One popular choice to improve puppetmasterd performance is to use mod passenger from the <a class="reference external" href="http://packages.ubuntu.com/lucid/libapache2-mod-passenger">libapache2-mod-passenger package</a>.</p>
</div>
<div id="apache2-setup" class="section">
<h3>Apache2 setup</h3>
<p>The configuration is based on the <a class="reference external" href="http://projects.reductivelabs.com/projects/puppet/wiki/Using_Passenger">Puppet passenger documentation</a>. It is available from the <a class="reference external" href="https://code.launchpad.net/~mathiaz/+junk/uec-ec2-puppet-config-passenger">bzr branch</a> as we&#8217;ll use puppet to actually configure the instance running puppetmasterd.</p>
<p>The <a class="reference external" href="http://bazaar.launchpad.net/~mathiaz/%2Bjunk/uec-ec2-puppet-config-passenger/annotate/head%3A/modules/puppet/manifests/init.pp">puppet module</a> has been updated to make sure the apache2 and libapache2-mod-passenger packages are installed. It also creates the relevant files and directories required to run puppetmasterd as a rack application.</p>
<p>Passenger and SSL modules are enabled in the <a class="reference external" href="http://bazaar.launchpad.net/~mathiaz/%2Bjunk/uec-ec2-puppet-config-passenger/annotate/head%3A/modules/puppet/templates/apache2.conf">apache2 configuration</a>. All of their configuration is done inside a virtual host definition. Note that the SSL options related to certificates and private keys files points directly to<tt class="docutils literal"> /var/lib/puppet/ssl/</tt>.</p>
<p>Apache2 is also configured to only listen on the default puppetmaster port by replacing apache2 default <a class="reference external" href="http://bazaar.launchpad.net/%7Emathiaz/%2Bjunk/uec-ec2-puppet-config-passenger/annotate/head%3A/modules/puppet/files/ports.conf">ports.conf</a> and <a class="reference external" href="http://bazaar.launchpad.net/%7Emathiaz/%2Bjunk/uec-ec2-puppet-config-passenger/annotate/head%3A/modules/puppet/manifests/init.pp#L64">disabling</a> the default virtual site.</p>
<p>Finally the <a class="reference external" href="http://bazaar.launchpad.net/~mathiaz/%2Bjunk/uec-ec2-puppet-config-passenger/annotate/head%3A/puppet.conf">configuration</a> of puppetmasterd has been updated so that it can correctly process the certificate clients while being run under passenger.</p>
<p>Note that puppetmasterd needs to be run once in order to be able to generate its ssl configuration. This happens automatically when the puppetmaster package is installed since puppetmasterd is started during the package installation.</p>
</div>
<div id="deploying-an-improved-puppetmaster" class="section">
<h3>Deploying an improved puppetmaster</h3>
<p>Log on the puppetmaster instance and update the puppet configuration using the<a class="reference external" href="https://code.launchpad.net/~mathiaz/+junk/uec-ec2-puppet-config-passenger"> bzr branch</a>:</p>
<blockquote><p>bzr pull &#8211;remember lp:~mathiaz/+junk/uec-ec2-puppet-config-passenger /etc/puppet/</p></blockquote>
<p>Update the configuration:</p>
<blockquote><p>sudo puppet &#8211;node_terminus=plain /etc/puppet/manifests/puppetmaster.pp</p></blockquote>
<p>On the <tt class="docutils literal">Cloud Conductor</tt> start a new instance with <tt class="docutils literal">start_instance.py</tt>. If you&#8217;re starting from scratch remember to update the <tt class="docutils literal">start_instance.yaml</tt><br />
file with the puppetmaster CA and internal IP:</p>
<blockquote><p>./start_instance.py -c start_instance.yaml AMI_NUMBER</p></blockquote>
<p>Following <tt class="docutils literal">/var/log/syslog</tt> on the puppetmaster you should see the new instance requesting a certificate:</p>
<blockquote><p>Apr  8 00:40:08 ip-10-195-93-129 puppetmasterd[3353]: Starting Puppet server version 0.25.4<br />
Apr  8 00:40:08 ip-10-195-93-129 puppetmasterd[3353]: 7d6b61a7-3772-4c41-a23d-471b417d9c47 has a waiting certificate request</p></blockquote>
<p>Now that the puppetmasterd process is run by apache2 and mod-passenger you can check in <tt class="docutils literal">/var/log/apache2/other_vhosts_access.logs.log</tt> the http requests made by the puppet client to get its certificate signed:</p>
<blockquote><p>ip-10-195-93-129.ec2.internal:8140 10.195.94.224 &#8211; - [08/Apr/2010:00:40:06 +0000] &#8220;GET /production/certificate/7d6b61a7-3772-4c41-a23d-471b417d9c47 HTTP/1.1&#8243; 404 2178 &#8220;-&#8221; &#8220;-&#8221;<br />
ip-10-195-93-129.ec2.internal:8140 10.195.94.224 &#8211; - [08/Apr/2010:00:40:08 +0000] &#8220;GET /production/certificate_request/7d6b61a7-3772-4c41-a23d-471b417d9c47 HTTP/1.1&#8243; 404 2178 &#8220;-&#8221; &#8220;-&#8221;<br />
ip-10-195-93-129.ec2.internal:8140 10.195.94.224 &#8211; - [08/Apr/2010:00:40:08 +0000] &#8220;PUT /production/certificate_request/7d6b61a7-3772-4c41-a23d-471b417d9c47 HTTP/1.1&#8243; 200 2082 &#8220;-&#8221; &#8220;-&#8221;<br />
ip-10-195-93-129.ec2.internal:8140 10.195.94.224 &#8211; - [08/Apr/2010:00:40:08 +0000] &#8220;GET /production/certificate/7d6b61a7-3772-4c41-a23d-471b417d9c47 HTTP/1.1&#8243; 404 2178 &#8220;-&#8221; &#8220;-&#8221;<br />
ip-10-195-93-129.ec2.internal:8140 10.195.94.224 &#8211; - [08/Apr/2010:00:40:08 +0000] &#8220;GET /production/certificate/7d6b61a7-3772-4c41-a23d-471b417d9c47 HTTP/1.1&#8243; 404 2178 &#8220;-&#8221; &#8220;-&#8221;</p></blockquote>
<p>Once <tt class="docutils literal">check_csr</tt> is run by cron the certificate will be signed and the puppet client is able to retrieve its certificate:</p>
<blockquote><p>ip-10-195-93-129.ec2.internal:8140 10.195.94.224 &#8211; - [08/Apr/2010:00:42:08 +0000] &#8220;GET /production/certificate/7d6b61a7-3772-4c41-a23d-471b417d9c47 HTTP/1.1&#8243; 200 2962 &#8220;-&#8221; &#8220;-&#8221;<br />
ip-10-195-93-129.ec2.internal:8140 10.195.94.224 &#8211; - [08/Apr/2010:00:42:08 +0000] &#8220;GET /production/certificate_revocation_list/ca HTTP/1.1&#8243; 200 2450 &#8220;-&#8221; &#8220;-&#8221;</p></blockquote>
<p>The puppet client ends up requesting its manifest:</p>
<blockquote><p>ip-10-195-93-129.ec2.internal:8140 10.195.94.224 &#8211; - [08/Apr/2010:00:42:09 +0000] &#8220;GET /production/catalog/7d6b61a7-3772-4c41-a23d-471b417d9c47?facts_format=b64_zlib_yaml&amp;facts=eNp [....] HTTP/1.1&#8243; 200 2354 &#8220;-&#8221; &#8220;-&#8221;</p></blockquote>
</div>
<div id="conclusion" class="section">
<h3>Conclusion</h3>
<p>I&#8217;ve just outlined how to configure mod passeenger to run puppetmasterd which is a much more efficient setup than using the default webrick server. Most of the configuration is detailed in the files available in the <a class="reference external" href="https://code.launchpad.net/~mathiaz/+junk/uec-ec2-puppet-config-passenger">bzr branch</a>.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ubuntumathiaz.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ubuntumathiaz.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ubuntumathiaz.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ubuntumathiaz.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ubuntumathiaz.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ubuntumathiaz.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ubuntumathiaz.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ubuntumathiaz.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ubuntumathiaz.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ubuntumathiaz.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ubuntumathiaz.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ubuntumathiaz.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ubuntumathiaz.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ubuntumathiaz.wordpress.com/187/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=187&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ubuntumathiaz.wordpress.com/2010/04/08/using-puppet-in-uecec2-improving-performance-with-phusion-passenger/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mathiaz</media:title>
		</media:content>
	</item>
		<item>
		<title>Using puppet in UEC/EC2: Node classification</title>
		<link>http://ubuntumathiaz.wordpress.com/2010/04/07/using-puppet-in-uecec2-node-classification-4/</link>
		<comments>http://ubuntumathiaz.wordpress.com/2010/04/07/using-puppet-in-uecec2-node-classification-4/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 20:58:57 +0000</pubDate>
		<dc:creator>Mathias Gug</dc:creator>
				<category><![CDATA[cloud]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://ubuntumathiaz.wordpress.com/?p=177</guid>
		<description><![CDATA[In a previous article I discussed how to set up an automated registration process for puppet instances. We&#8217;ll now have a look at how we can tell these instances what they should be doing. Going back to the overall architecture the Cloud conductor is the component responsible for starting new instances. Of all the three [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=177&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In a <a class="reference external" href="https://ubuntumathiaz.wordpress.com/2010/03/25/using-puppet-in-uecec2-automating-the-signing-process/">previous article</a> I discussed how to set up an automated registration process for puppet instances. We&#8217;ll now have a look at how we can tell these instances what they should be doing.</p>
<p>Going back to the <a class="reference external" href="https://ubuntumathiaz.wordpress.com/2010/03/25/using-puppet-in-uecec2-automating-the-signing-process/#overview">overall architecture</a> the <tt class="docutils literal">Cloud conductor</tt> is the component responsible for starting new instances. Of all the three components it&#8217;s him that has the most knowledge about what an instance should be: it is the one responsible for starting a new instance after all.</p>
<div id="using-s3-to-store-node-definitions" class="section">
<h3>Using S3 to store node definitions</h3>
<p>We&#8217;ll use the <a class="reference external" href="http://projects.reductivelabs.com/projects/puppet/wiki/External_Nodes">puppet external node</a> feature to connect the <tt class="docutils literal">Cloud conductor</tt> with the <tt class="docutils literal">puppetmaster</tt>. The external node script -<a class="reference external" href="http://bazaar.launchpad.net/%7Emathiaz/%2Bjunk/uec-ec2-puppet-config-tut3/annotate/head%3A/scripts/node_classifier.py">node_classifier.py</a> &#8211; will be responsible for telling which classes each instance is supposed to have. Whenever a puppet client connects to the master the <tt class="docutils literal">node_classifier.py</tt> script is called with the certificate name. It is responsible for providing a description of the classes, environments and parameters for the client on its standard output in a yaml format.</p>
<p>Given that the <tt class="docutils literal">Cloud conductor</tt> creates a file with the certificate name for each instance it spawns we&#8217;ll extend the <a class="reference external" href="http://bazaar.launchpad.net/%7Emathiaz/%2Bjunk/uec-ec2-puppet-config-tut3/annotate/head%3A/scripts/start_instance.py">start_instance.py</a> script to store the node classification in the content of the file created in the S3 bucket.</p>
<p>You may have noticed that instances started by <tt class="docutils literal">start_instance.py</tt> don&#8217;t have an ssh public key associated with them. So we&#8217;re going to create a<tt class="docutils literal"><span class="pre"> login-allowed</span></tt> class that will install the authorized key for the ubuntu user.</p>
</div>
<div id="setup-the-puppetmaster-to-use-the-node-classifier" class="section">
<h3>Setup the puppetmaster to use the node classifier</h3>
<p>We&#8217;ll use the <a class="reference external" href="http://uec-images.ubuntu.com/releases/lucid/beta-2/">Ubuntu Lucid Beta2 image</a> as the base image on which to build our Puppet infrastructure.</p>
<p>Start an instance of the Lucid Beta2 AMI using an ssh key. Once it&#8217;s running write down its public and private DNS addresses. The public DNS address will be used to setup the puppetmaster via ssh. The private DNS address will be used as the puppetmaster hostname given out to puppet clients.</p>
<p>Log on the started instance via ssh to install and setup the puppet master:</p>
<ol class="arabic">
<li>
<p class="first">Update apt files:</p>
<blockquote><p>sudo apt-get update</p></blockquote>
</li>
<li>
<p class="first">Install the puppet and bzr packages:</p>
<blockquote><p>sudo apt-get install puppet bzr</p></blockquote>
</li>
<li>
<p class="first">Change the ownership of the puppet directory so that the ubuntu user can directly edit the puppet configuration files:</p>
<blockquote><p>sudo chown -R ubuntu:ubuntu /etc/puppet/</p></blockquote>
</li>
<li>
<p class="first">On the puppetmaster check out the <a class="reference external" href="https://code.launchpad.net/~mathiaz/+junk/uec-ec2-puppet-config-tut3">tutorial3</a> bzr branch:</p>
<blockquote><p>bzr branch &#8211;use-existing-dir lp:~mathiaz/+junk/uec-ec2-puppet-config-tut3 /etc/puppet/</p></blockquote>
<p>You&#8217;ll get a conflict for the puppet.conf file. You can ignore the conflict as the puppet.conf file from the branch is the one that supports an external node classifier:</p>
<blockquote><p>bzr resolve /etc/puppet/puppet.conf</p></blockquote>
</li>
</ol>
<p>Edit the node classifier script <tt class="docutils literal">scripts/node_classifier.py</tt> to set the correct location of your S3 bucket.</p>
<p>Note that the script is set to return 1 if the certificate name doesn&#8217;t have a corresponding file in the S3 bucket. You may want to change the return code to 0 if you want to use the normal nodes definition. See the <a class="reference external" href="http://projects.reductivelabs.com/projects/puppet/wiki/External_Nodes">puppet external node</a> documentation for more information.</p>
<p>The puppetmaster configuration in <tt class="docutils literal">puppet.conf</tt> has been updated to use the external node script.</p>
<p>There is also the <tt class="docutils literal"><span class="pre">login-allowed</span></tt> class defined in the <tt class="docutils literal">manifests/site.pp</tt><tt> </tt>file. It sets the authorized key file for the ubuntu user.</p>
<p>On the puppetmaster edit <tt class="docutils literal">manifests/site.pp</tt> to update the public key with your EC2 public key. You can get the public key from<tt class="docutils literal"><span class="pre"> ~ubuntu/.ssh/authorized_key</span></tt> on the puppetmaster.</p>
<p>To bootstrap the new puppetmaster configuration run the puppet client:</p>
<blockquote><p>sudo puppet &#8211;node_terminus=plain /etc/puppet/manifests/puppetmaster.pp</p></blockquote>
<p>Note that you&#8217;ll have to set the node_terminus to plain to avoid calling the node classifier script when configuring the puppetmaster itself. Otherwise the puppet run would fail since the puppetmaster certificate name (which defaults the to fqdn of the instance) doesn&#8217;t have a corresponding file in the S3 bucket.</p>
<p>We have now our puppetmaster configured to look up the node classification for each puppet client.</p>
</div>
<div id="update-start-instance-py-to-provide-a-node-definition" class="section">
<h3>Update start_instance.py to provide a node definition</h3>
<p>It&#8217;s time to update the <tt class="docutils literal">Cloud conductor</tt> to provide the relevant node classification information whenever it starts a new instance.</p>
<p>Update the bzr branch on the <tt class="docutils literal">Cloud conductor</tt> system:</p>
<blockquote><p>bzr pull &#8211;remember lp:~mathiaz/uec-puppet-config-tut3</p></blockquote>
<p>The <tt class="docutils literal">start_instance.py</tt> script has been updated to write the node classification information when it creates the instance file in the S3 bucket. That information is actually set in the <tt class="docutils literal">start_instance.yaml</tt> file under the node key. All of the node classification information expected by the puppetmaster from the external node classifier script is set under the <tt class="docutils literal">node</tt><tt> </tt>key in <tt class="docutils literal">start_instance.yaml</tt>. See the <a class="reference external" href="http://projects.reductivelabs.com/projects/puppet/wiki/External_Nodes">puppet external node</a> documentation for more information on the information that can be provided by the external node script.</p>
<p>Review the <tt class="docutils literal">start_instance.yaml</tt> file to make sure the S3 bucket name, the puppetmaster server IP and CA certificate are still valid for your own setup.</p>
<p>Start an instance:</p>
<blockquote><p>./start_instance.py -c start_instance.yaml AMI_NUMBER</p></blockquote>
<p>Following <tt class="docutils literal">/var/log/syslog</tt> you should see something similar to this:</p>
<blockquote><p>Apr  7 19:15:37 domU-12-31-39-07-D6-52 puppetmasterd[1644]: 77ad2a3c-5d52-4ca7-9fea-b99b767b09d0 has a waiting certificate request</p></blockquote>
<p>The instance has booted and registered with the puppetmaster.</p>
<blockquote><p>Apr  7 19:16:01 domU-12-31-39-07-D6-52 CRON[2188]: (root) CMD (/usr/local/bin/check_csr &#8211;log-level=debug <a class="reference external" href="https://mathiaz-puppet-nodes-1.s3.amazonaws.com">https://mathiaz-puppet-nodes-1.s3.amazonaws.com</a>)<br />
Apr  7 19:16:02 domU-12-31-39-07-D6-52 check_csr[2189]: DEBUG: List of waiting csr: 77ad2a3c-5d52-4ca7-9fea-b99b767b09d0<br />
Apr  7 19:16:02 domU-12-31-39-07-D6-52 check_csr[2189]: DEBUG: Checking 77ad2a3c-5d52-4ca7-9fea-b99b767b09d0<br />
Apr  7 19:16:02 domU-12-31-39-07-D6-52 check_csr[2189]: DEBUG: Checking url <a class="reference external" href="https://mathiaz-puppet-nodes-1.s3.amazonaws.com/77ad2a3c-5d52-4ca7-9fea-b99b767b09d0">https://mathiaz-puppet-nodes-1.s3.amazonaws.com/77ad2a3c-5d52-4ca7-9fea-b99b767b09d0</a><br />
Apr  7 19:16:03 domU-12-31-39-07-D6-52 check_csr[2189]: INFO: Signing request: 77ad2a3c-5d52-4ca7-9fea-b99b767b09d0</p></blockquote>
<p>The puppetmaster checked if the client request is expected and signs it.</p>
<blockquote><p>Apr  7 19:17:39 domU-12-31-39-07-D6-52 node_classifier[2240]: DEBUG: Checking url <a class="reference external" href="https://mathiaz-puppet-nodes-1.s3.amazonaws.com/77ad2a3c-5d52-4ca7-9fea-b99b767b09d0">https://mathiaz-puppet-nodes-1.s3.amazonaws.com/77ad2a3c-5d52-4ca7-9fea-b99b767b09d0</a><br />
Apr  7 19:17:39 domU-12-31-39-07-D6-52 node_classifier[2240]: INFO: Getting node configuration: 77ad2a3c-5d52-4ca7-9fea-b99b767b09d0<br />
Apr  7 19:17:39 domU-12-31-39-07-D6-52 node_classifier[2240]: DEBUG: Node configuration (77ad2a3c-5d52-4ca7-9fea-b99b767b09d0): classes: [login-allowed]<br />
Apr  7 19:17:39 domU-12-31-39-07-D6-52 puppetmasterd[1644]: Compiled catalog for 77ad2a3c-5d52-4ca7-9fea-b99b767b09d0 in 0.01 seconds</p></blockquote>
<p>The puppetmaster compiled a manifest for the client according to the information provided by the node classifier script.</p>
<p>Make sure that the instance that has been started doesn&#8217;t have any ssh key associated with it:</p>
<blockquote><p>euca-describe-instances</p></blockquote>
<p>Make a note of the instance ID and its public DNS name.</p>
<p>Login into the instance:</p>
<ol class="arabic">
<li>
<p class="first">Run <tt class="docutils literal"><span class="pre">euca-get-console-output</span> instance_ID</tt> to get the ssh fingerprint.  You may need to scroll back to get the fingerprints.</p>
</li>
<li>
<p class="first">Login into the instances using your EC2 public key:</p>
<blockquote><p>ssh -i ~/.ssh/ec2_key <a class="reference external" href="mailto:ubuntu@public_dns">ubuntu@public_dns</a></p></blockquote>
</li>
</ol>
</div>
<div id="conclusion" class="section">
<h3>Conclusion</h3>
<p>The <a class="reference external" href="http://bazaar.launchpad.net/%7Emathiaz/%2Bjunk/uec-ec2-puppet-config-tut3/annotate/head%3A/scripts/start_instance.py">start_instance.py</a> script is currently very simple and should be considered as a proof of concept.</p>
<p>Storing the node classification information into an S3 bucket makes it also easy to edit the content of the file. It also provides an easy way to get a list of the nodes that have been started by the Cloud Conductor as well as their classification.</p>
<p>If you look at the <a class="reference external" href="http://bazaar.launchpad.net/%7Emathiaz/%2Bjunk/uec-ec2-puppet-config-tut3/annotate/head%3A/scripts/start_instance.py">start_instance.py</a> script you&#8217;ll notice that the ACL on the S3 bucket is &#8216;public-read&#8217;. That means anyone can read the list of your nodes as well as the list of classes and other node classification information for each of them. You may wanna use S3 private url instead.</p>
<p>We now have a puppet infrastructure where <tt class="docutils literal">instances</tt> are started by a<tt class="docutils literal"> Cloud conductor</tt> in order to achieve a specific task. These <tt class="docutils literal">instances</tt> automatically connect to the <tt class="docutils literal">puppetmaster</tt> to get configured automatically for the task they&#8217;ve been created for. All of the <tt class="docutils literal">instances</tt> configuration is stored in a reliable and scalable system: S3.</p>
<p>With instances being created on demand our puppet infrastructure can grow quickly. The <tt class="docutils literal">puppetmaster</tt> can easily be responsible for managing hundreds of instances. Next we&#8217;ll have a look at how improving the performance of the<tt class="docutils literal"> puppetmaster</tt>.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ubuntumathiaz.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ubuntumathiaz.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ubuntumathiaz.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ubuntumathiaz.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ubuntumathiaz.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ubuntumathiaz.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ubuntumathiaz.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ubuntumathiaz.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ubuntumathiaz.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ubuntumathiaz.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ubuntumathiaz.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ubuntumathiaz.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ubuntumathiaz.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ubuntumathiaz.wordpress.com/177/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=177&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ubuntumathiaz.wordpress.com/2010/04/07/using-puppet-in-uecec2-node-classification-4/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mathiaz</media:title>
		</media:content>
	</item>
		<item>
		<title>MySQL 5.1 Bug Zap: Bug day result</title>
		<link>http://ubuntumathiaz.wordpress.com/2010/03/30/mysql-5-1-bug-zap-bug-day-result/</link>
		<comments>http://ubuntumathiaz.wordpress.com/2010/03/30/mysql-5-1-bug-zap-bug-day-result/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 01:03:23 +0000</pubDate>
		<dc:creator>Mathias Gug</dc:creator>
				<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://ubuntumathiaz.wordpress.com/?p=167</guid>
		<description><![CDATA[Today was targeted at looking through the mysql-dfsg-5.1 bugs to triage them. We ended up with all bugs having their importance set and their status set to Triaged or Incomplete. Tomorrow will be dedicated to fixing most of them as well as some upgrade testing. I&#8217;ll also have a look at the new mysql upstart [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=167&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today was targeted at looking through the <a href="https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.1">mysql-dfsg-5.1 bugs</a> to triage them. We ended up with all bugs having their importance set and their status set to Triaged or Incomplete.</p>
<p>Tomorrow will be dedicated to fixing most of them as well as some upgrade testing. I&#8217;ll also have a look at the new mysql upstart job that has replaced the mysld_safe script.</p>
<p>Looking at the bugs today I&#8217;ve found a couple of bugs that look easy to fix:</p>
<ul>
<li><a href="https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.1/+bug/552053">Bug 552053</a>:  mysqld_safe should be available in mysql-server</li>
<li> <a href="https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.1/+bug/498939">Bug 498939</a>: mysql- packages section on synaptic</li>
</ul>
<p>To get started grab a copy of the package branch:</p>
<pre>bzr init-repo mysql-dfsg-5.1/
cd mysql-dfsg-5.1/
bzr branch lp:ubuntu/mysql-dfsg-5.1
</pre>
<p>Fix a bug and push the branch to launchpad:</p>
<pre>bzr push lp:~YOUR-LOGIN/ubuntu/mysql-dfsg-5.1/zap-bug-XXXXXX</pre>
<p>And finish up by creating a merge proposal for the Lucid package branch. I&#8217;ll take a look at the list of merge proposal throughout the day and include them in the upload schedule for tomorrow.</p>
<div id="_mcePaste" style="overflow:hidden;position:absolute;left:-10000px;top:0;width:1px;height:1px;"><a href="https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.1/+bug/552053">mysqld_safe should be available in mysql-server</a></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ubuntumathiaz.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ubuntumathiaz.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ubuntumathiaz.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ubuntumathiaz.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ubuntumathiaz.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ubuntumathiaz.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ubuntumathiaz.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ubuntumathiaz.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ubuntumathiaz.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ubuntumathiaz.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ubuntumathiaz.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ubuntumathiaz.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ubuntumathiaz.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ubuntumathiaz.wordpress.com/167/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=167&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ubuntumathiaz.wordpress.com/2010/03/30/mysql-5-1-bug-zap-bug-day-result/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mathiaz</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu Server Bug Zap: MySQL 5.1</title>
		<link>http://ubuntumathiaz.wordpress.com/2010/03/29/ubuntu-server-bug-zap-mysql-5-1/</link>
		<comments>http://ubuntumathiaz.wordpress.com/2010/03/29/ubuntu-server-bug-zap-mysql-5-1/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 00:45:18 +0000</pubDate>
		<dc:creator>Mathias Gug</dc:creator>
				<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://ubuntumathiaz.wordpress.com/?p=164</guid>
		<description><![CDATA[Following up on the kvm and samba bug zap days I&#8217;m organizing a two day bug zap around MySQL. First phase: bug triaging First in line is triaging all the bugs related to mysql-dfsg-5.1 package. As of Tue Mar 30 00:23:04 UTC 2010 there are 27 bugs waiting to be looked at. The goal is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=164&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Following up on the <a class="reference external" href="http://blog.dustinkirkland.com/2010/03/server-bug-zapping-kvm-in-retrospective.html">kvm</a> and <a class="reference external" href="http://fnords.wordpress.com/2010/03/07/samba-bugzapping/">samba</a> bug zap days I&#8217;m organizing a two day bug<br />
zap around MySQL.</p>
<div class="section" id="first-phase-bug-triaging">
<h3>First phase: bug triaging</h3>
<p>First in line is triaging all the bugs related to <a class="reference external" href="http://lucid-mysql-bug-zap.notlong.com">mysql-dfsg-5.1 package</a>. As<br />
of Tue Mar 30 00:23:04 UTC 2010 there are 27 bugs waiting to be looked at.</p>
<p>The goal is to have the <a class="reference external" href="https://wiki.ubuntu.com/Bugs/Importance">importance</a> set for all bugs and have as many bugs<br />
<a class="reference external" href="https://wiki.ubuntu.com/Bugs/Status">status</a> moved to either Triaged or Invalid/Won&#8217;t Fix.</p>
<p>A few resources are available to help out:</p>
<blockquote>
<ul class="simple">
<li>The <a class="reference external" href="https://wiki.ubuntu.com/DebuggingMySQL">Debugging MySQL wiki page</a></li>
</ul>
</blockquote>
<blockquote>
<ul class="simple">
<li>The #ubuntu-server IRC channel</li>
<li>The  <a class="reference external" href="http://lucid-mysql-bug-zap.notlong.com">up-to-date list of bugs</a>  that still need to be triaged.</li>
</ul>
</blockquote>
<p>Objective: get the <a class="reference external" href="http://lucid-mysql-bug-zap.notlong.com">list of bugs</a> to <em>zero</em>.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ubuntumathiaz.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ubuntumathiaz.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ubuntumathiaz.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ubuntumathiaz.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ubuntumathiaz.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ubuntumathiaz.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ubuntumathiaz.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ubuntumathiaz.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ubuntumathiaz.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ubuntumathiaz.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ubuntumathiaz.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ubuntumathiaz.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ubuntumathiaz.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ubuntumathiaz.wordpress.com/164/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=164&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ubuntumathiaz.wordpress.com/2010/03/29/ubuntu-server-bug-zap-mysql-5-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mathiaz</media:title>
		</media:content>
	</item>
		<item>
		<title>Using puppet in UEC/EC2: Automating the signing process</title>
		<link>http://ubuntumathiaz.wordpress.com/2010/03/25/using-puppet-in-uecec2-automating-the-signing-process/</link>
		<comments>http://ubuntumathiaz.wordpress.com/2010/03/25/using-puppet-in-uecec2-automating-the-signing-process/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 20:54:03 +0000</pubDate>
		<dc:creator>Mathias Gug</dc:creator>
				<category><![CDATA[cloud]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://ubuntumathiaz.wordpress.com/?p=151</guid>
		<description><![CDATA[I outlined in the previous article how to setup a puppetmaster instance on UEC/EC2 and how to start instances that will automatically register with the puppetmaster. We&#8217;re going to look at automating the process of signing puppet client certificate requests. Overview Our puppet infrastructure on the cloud can be broken down into three components: The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=151&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I outlined in the <a class="reference external" href="http://ubuntumathiaz.wordpress.com/2010/03/24/using-puppet-in-uecec2-puppet-support-in-ubuntu-images/">previous article</a> how to setup a puppetmaster instance on UEC/EC2 and how to start instances that will automatically register with the puppetmaster. We&#8217;re going to look at automating the process of signing puppet client certificate requests.</p>
<div class="section" id="overview">
<h3>Overview</h3>
<p>Our puppet infrastructure on the cloud can be broken down into three components:</p>
<ul class="simple">
<li>The <tt class="docutils literal"><span class="pre">Cloud</span> <span class="pre">conductor</span></tt> responsible for starting new instances in our cloud.</li>
<li>A <tt class="docutils literal"><span class="pre">Puppetmaster</span></tt> responsible for configuring all the instances running in our cloud.</li>
<li><tt class="docutils literal"><span class="pre">Instances</span></tt> acting as puppet clients asking to be setup correctly.</li>
</ul>
<p>The idea is to have the <tt class="docutils literal"><span class="pre">Cloud</span> <span class="pre">conductor</span></tt> start <tt class="docutils literal"><span class="pre">instances</span></tt> and notify the <tt class="docutils literal"><span class="pre">puppetmaster</span></tt> that these new instances are coming up. The <tt class="docutils literal"><span class="pre">puppetmaster</span></tt> can then automatically sign their certificate requests.</p>
<p>We&#8217;ll use S3 as the way to communicate between the <tt class="docutils literal"><span class="pre">Cloud</span> <span class="pre">conductor</span></tt> and the <tt class="docutils literal"><span class="pre">puppetmaster</span></tt>. The <tt class="docutils literal"><span class="pre">Cloud</span> <span class="pre">conductor</span></tt> will also assign a random certificate to each instance it starts.</p>
<p>The <tt class="docutils literal"><span class="pre">Cloud</span> <span class="pre">conductor</span></tt> will be located on a sysadmin workstation while the <tt class="docutils literal"><span class="pre">puppetmaster</span></tt> and <tt class="docutils literal"><span class="pre">instances</span></tt> will be running in the cloud. The <a class="reference external" href="https://code.launchpad.net/~mathiaz/+junk/uec-ec2-puppet-config-tut2">bzr branch</a> contains all the scripts necessary to setup such a solution.</p>
</div>
<div class="section" id="the-cloud-conductor-start-instance-py">
<h3>The Cloud conductor: start_instance.py</h3>
<ol class="arabic">
<li>
<p class="first">Get the tutorial2 bzr on the <tt class="docutils literal"><span class="pre">Cloud</span> <span class="pre">conductor</span></tt> (an admin workstation):</p>
<blockquote>
<p>bzr branch lp:~mathiaz/+junk/uec-ec2-puppet-config-tut2</p>
</blockquote>
<p>In the <tt class="docutils literal"><span class="pre">scripts/</span></tt> directory <a class="reference external" href="http://bazaar.launchpad.net/%7Emathiaz/%2Bjunk/uec-ec2-puppet-config-tut2/annotate/head%3A/scripts/start_instance.py">start_instance.py</a> plays the role of the <tt class="docutils literal"><span class="pre">Cloud</span> <span class="pre">conductor</span></tt>. It creates new instances and stores their certname in S3. The <em>start_instance.yaml</em> configuration file provides almost the same information as the <tt class="docutils literal"><span class="pre">user-data.yaml</span></tt> file we used in the previous article.</p>
</li>
<li>
<p class="first">Edit the <em>start_instance.yaml</em> file and update each setting:</p>
<ul class="simple">
<li>Choose a unique S3 bucket name.</li>
<li>Use the private DNS hostname of the instance running the puppetmaster.</li>
<li>Add the puppetmaster ca certificate found on the puppetmaster.</li>
</ul>
</li>
<li>
<p class="first">Make sure your AWS/UEC credentials are available in the environment. The <em>start_instance.py</em> uses these to access EC2 to start new instances and S3 to store the instance certificate names.</p>
</li>
<li>
<p class="first">Start a new instance of the Lucid Beta1 AMI:</p>
<blockquote>
<p>./start_instance.py -c ./start_instance.yaml ami-ad09e6c4</p>
</blockquote>
<p><em>start_instance.py</em> starts a new instance using the AMI specified on the command line. The instance user data holds a random UUID for the puppet client certificate name. <em>start_instance.py</em> also creates a new file in its S3 bucket named after the puppet client certificate name.</p>
</li>
<li>
<p class="first">On the puppetmater looking at the puppetmaster log you should see a certificate request show up after some time:</p>
<blockquote>
<p>Mar 19 19:09:33 ip-10-245-197-226 puppetmasterd[20273]: a83b0057-ab8d-426e-b2ab-175729742adb has a waiting certificate request</p>
</blockquote>
</li>
</ol>
</div>
<div class="section" id="automating-the-signing-process-on-the-puppetmaster">
<h3>Automating the signing process on the puppetmaster</h3>
<p>It&#8217;s time to setup the puppetmaster to check if there are any certificate requests waiting and signs only the ones started by the <tt class="docutils literal"><span class="pre">Cloud</span> <span class="pre">conductor</span></tt>. We&#8217;ll use the <a class="reference external" href="http://bazaar.launchpad.net/%7Emathiaz/%2Bjunk/uec-ec2-puppet-config-tut2/annotate/head%3A/scripts/check_csr.py">check_csr.py cron job</a> that will get the list of waiting certificate requests via <tt class="docutils literal"><span class="pre">puppetca</span> <span class="pre">--list</span></tt> and checks whether there is a corresponding file in the S3 bucket.</p>
<ol class="arabic">
<li>
<p class="first">On the puppetmaster get the <cite>tutorial2</cite> bzr branch:</p>
<blockquote>
<p>bzr pull &#8211;remember lp:~mathiaz/+junk/uec-ec2-config/tut2 /etc/puppet/</p>
</blockquote>
</li>
<li>
<p class="first">The <a class="reference external" href="http://bazaar.launchpad.net/%7Emathiaz/%2Bjunk/uec-ec2-puppet-config-tut2/annotate/head%3A/manifests/puppetmaster.pp">puppetmaster.pp</a> manifest has been updated to setup the <tt class="docutils literal"><span class="pre">check_csr.py</span></tt> cron job to run every 2 minutes. You need to update the cron job command line in <tt class="docutils literal"><span class="pre">/etc/puppet/manifests/puppetmaster.pp</span></tt> with your own S3 bucket name.</p>
</li>
<li>
<p class="first">Update the puppetmaster configuration:</p>
<blockquote>
<p>sudo puppet /etc/puppet/manifests/puppetmaster.pp</p>
</blockquote>
</li>
<li>
<p class="first">Watching <tt class="docutils literal"><span class="pre">/var/log/syslog</span></tt> you should see <em>check_csr</em> being run by cron every other minute:</p>
<blockquote>
<p>Mar 19 19:10:01 ip-10-245-197-226 CRON[21858]: (root) CMD (/usr/local/bin/check_csr &#8211;log-level=debug <a class="reference external" href="https://mathiaz-puppet-nodes-1.s3.amazonaws.com">https://mathiaz-puppet-nodes-1.s3.amazonaws.com</a>)</p>
</blockquote>
<p><em>check_csr</em> gets the list of waiting certificate requests and checks if there is a corresponding file in its S3 bucket:</p>
<blockquote>
<p>Mar 19 19:10:03 ip-10-245-197-226 check_csr[21859]: DEBUG: List of waiting csr: a83b0057-ab8d-426e-b2ab-175729742adb<br />
Mar 19 19:10:03 ip-10-245-197-226 check_csr[21859]: DEBUG: Checking a83b0057-ab8d-426e-b2ab-175729742adb<br />
Mar 19 19:10:03 ip-10-245-197-226 check_csr[21859]: DEBUG: Checking url <a class="reference external" href="https://mathiaz-puppet-nodes-1.s3.amazonaws.com/a83b0057-ab8d-426e-b2ab-175729742adb">https://mathiaz-puppet-nodes-1.s3.amazonaws.com/a83b0057-ab8d-426e-b2ab-175729742adb</a></p>
</blockquote>
<p>If so it will sign the certificate request:</p>
<blockquote>
<p>Mar 19 19:10:03 ip-10-245-197-226 check_csr[21859]: INFO: Signing request: a83b0057-ab8d-426e-b2ab-175729742adb</p>
</blockquote>
</li>
</ol>
</div>
<div class="section" id="s3-bucket-acl">
<h3>S3 bucket ACL</h3>
<p>For now the S3 bucket ACL is set so that anyone can get the list files available in the bucket. However only authenticated requests can create new files in the bucket. Given that the filename are just random UUID this is not a big issue.</p>
</div>
<div class="section" id="using-sqs-instead-of-s3">
<h3>Using SQS instead of S3</h3>
<p>Another implementation of the same idea is to use SQS to handle the notification of the <tt class="docutils literal"><span class="pre">puppetmaster</span></tt> by the <tt class="docutils literal"><span class="pre">Cloud</span> <span class="pre">conductor</span></tt> about new <tt class="docutils literal"><span class="pre">instances</span></tt>. While SQS would seem to be the best tool to provide that functionality it is not available in UEC in Lucid.</p>
</div>
<div class="section" id="conclusion">
<h3>Conclusion</h3>
<p>We end up with a puppet infrastructure where legitimate instances are automatically accepted. Now that instances can easily show up and be automatically enrolled <em>what</em> should these be configured as? We&#8217;ll dive into this issue in the next article.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ubuntumathiaz.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ubuntumathiaz.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ubuntumathiaz.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ubuntumathiaz.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ubuntumathiaz.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ubuntumathiaz.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ubuntumathiaz.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ubuntumathiaz.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ubuntumathiaz.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ubuntumathiaz.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ubuntumathiaz.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ubuntumathiaz.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ubuntumathiaz.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ubuntumathiaz.wordpress.com/151/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ubuntumathiaz.wordpress.com&amp;blog=4897956&amp;post=151&amp;subd=ubuntumathiaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ubuntumathiaz.wordpress.com/2010/03/25/using-puppet-in-uecec2-automating-the-signing-process/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mathiaz</media:title>
		</media:content>
	</item>
	</channel>
</rss>
