<?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/"
	>

<channel>
	<title>system-log:tyr</title>
	<atom:link href="http://system-log.tyr.org.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://system-log.tyr.org.uk</link>
	<description>Skyscraper I love you</description>
	<pubDate>Tue, 05 Aug 2008 21:21:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>&#8216;Your Next Bus&#8217; on your iPhone</title>
		<link>http://system-log.tyr.org.uk/2008/08/05/your-next-bus-on-your-iphone/</link>
		<comments>http://system-log.tyr.org.uk/2008/08/05/your-next-bus-on-your-iphone/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 19:17:42 +0000</pubDate>
		<dc:creator>tyr</dc:creator>
		
		<category><![CDATA[Mac]]></category>

		<category><![CDATA[Transport]]></category>

		<guid isPermaLink="false">http://system-log.tyr.org.uk/?p=27</guid>
		<description><![CDATA[&#8216;Your Next Bus&#8217; is the system used in West Yorkshire (and other regions) to provide live bus timetables. Some time ago I wrote a Dashboard Widget to display live timetables on a OS X Dashboard. I had a request to develop this for the iPhone and so I knocked something together with Dashcode and came [...]]]></description>
			<content:encoded><![CDATA[<p>&#8216;Your Next Bus&#8217; is the system used in West Yorkshire (and other regions) to provide live bus timetables. Some time ago I wrote a <a href='http://widget.newswall.org.uk/yournextbus/'>Dashboard Widget</a> to display live timetables on a OS X Dashboard. I had a request to develop this for the iPhone and so I knocked something together with Dashcode and came up with <a href="http://tyr.org.uk/bus">tyr.org.uk/bus</a>. Browse to in in your iPhone and see it in action, requires Version 2.0 of the OS.</p>
<p>Please feedback with any bug reports or feature requests.</p>
<p>Read on for some of the behind the scenes info.<br />
<span id="more-27"></span><br />
There are two options facing a prospective iPhone application developer, to develop a web app or a full blown iPhone application. Prior to the release of the iPhone 2.0 OS web apps were the only option open to developers wanting to target users without jailbroken phones.</p>
<p>Writing a full iPhone application requires Cocoa and Objective-C fu, which whilst I&#8217;m learning I&#8217;m nowhere near the level required this task. Conversely web apps are much simpler and are just served as standard web pages to the local iPhone Safari browser. All the client side coding can be created in JavaScript.</p>
<p>Apple&#8217;s provided development environment for web apps is called Dashcode. I&#8217;d used it previously as a beta on Tiger to create the Dashboard widget and found it to be fairly buggy. This time however I&#8217;m pleased to say it performed admirably. To aid development a selection of framework apps are provided, in this instance the &#8216;browser&#8217; framework was picked. This provides you with a simple interface that lets the user browse through multiple view in a tree structure. The only Javascript you need to provide is a controller for the view, a sufficient outline is given to get you going without too much work.</p>
<p>I don&#8217;t actually own an iPhone but an iPhone simulator is provided with the development tools. As soon as you click &#8216;Run&#8217; in Dashcode the simulator loads up and launches your web app. You can simulate pretty much all the normal iPhone functionality including rotation and multi touch. It really helps make development a breeze.</p>
<p>iPhone OS 2 ships with a version of Safari 3.1.1, which supports client side SQL in JavaScript. Using this to store user settings is a breath of fresh air compared to creating bespoke functions to (un)pack data into cookies. Here&#8217;s the SQL used to create a database</p>
<pre>
 try {
     var shortName = 'yournextbus';
     var version = '1.0';
     var displayName = 'Your Next Bus Database';
     var maxSize = 2048;
     var db = openDatabase (shortName, version, displayName, maxSize);
     return db;
 } catch (e) {
     if ( e == INVALID_STATE_ERR ) {
         // Version number mismatch
         alert ("Invalid database version");
     } else {
         alert ("An error occured creating a database "+e+".");
     }
 }
</pre>
<p>And here&#8217;s the code to create a table and add a row:</p>
<pre>
 this._db.transaction (
    function (transaction) {
        transaction.executeSql('CREATE TABLE stops(id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL DEFAULT "A Bus Stop", number INTEGER NOT NULL)', [], nullDataHandler, killTransactionSilently);
        transaction.executeSql('INSERT INTO stops ( name , number ) VALUES (?,?) ', [ 'Demo Stop', 45013610 ], nullDataHandler, errorHandler );

     }
 )
</pre>
<p>Whilst the data being stored for this app is fairly trivial it&#8217;s simple to see how this could become very powerful.</p>
<p>A couple of pics of the app in action:</p>
<p><a href='http://system-log.tyr.org.uk/wp-content/uploads/2008/08/bus-app-main-menu.png'><img src="http://system-log.tyr.org.uk/wp-content/uploads/2008/08/bus-app-main-menu-156x300.png" alt="Main Menu" title="Bus App Main Menu" width="156" height="300" class="alignnone size-medium wp-image-28" /></a><br />
<a href='http://system-log.tyr.org.uk/wp-content/uploads/2008/08/bus-app-timetable.png'><img src="http://system-log.tyr.org.uk/wp-content/uploads/2008/08/bus-app-timetable-156x300.png" alt="Timetable" title="Bus App Timetable" width="156" height="300" class="alignnone size-medium wp-image-29" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://system-log.tyr.org.uk/2008/08/05/your-next-bus-on-your-iphone/feed/</wfw:commentRss>
		</item>
		<item>
		<title>VCS Simulator</title>
		<link>http://system-log.tyr.org.uk/2008/07/09/vcs-simulator/</link>
		<comments>http://system-log.tyr.org.uk/2008/07/09/vcs-simulator/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 13:38:07 +0000</pubDate>
		<dc:creator>tyr</dc:creator>
		
		<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://system-log.tyr.org.uk/?p=25</guid>
		<description><![CDATA[I&#8217;m writing some training documentation for Veritas Cluster Server (VCS). Reading through my notes I was reminded of the &#8216;VCS Simulator&#8217;. You can import an existing cluster config into the Simulator and use the (Windows) GUI as if it was a live cluster, changing the config, faling things over etc. It&#8217;s just the ticket for [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m writing some training documentation for Veritas Cluster Server (VCS). Reading through my notes I was reminded of the &#8216;VCS Simulator&#8217;. You can import an existing cluster config into the Simulator and use the (Windows) GUI as if it was a live cluster, changing the config, faling things over etc. It&#8217;s just the ticket for a training aid, it&#8217;s just a shame there isn&#8217;t a CLI simulator.</p>
<p>You can download it <a href="http://www.symantec.com/offer?a_id=5647">here</a> (needs a Symantec login) and there&#8217;s a Flash video explaining how to import an existing cluster <a href="http://eval.symantec.com/flashdemos/products/vcs_simulator/index.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://system-log.tyr.org.uk/2008/07/09/vcs-simulator/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Building a Solaris Cluster Express cluster in a VirtualBox on OpenSolaris</title>
		<link>http://system-log.tyr.org.uk/2008/06/27/building-a-solaris-cluster-express-cluster-in-a-virtualbox-on-opensolaris/</link>
		<comments>http://system-log.tyr.org.uk/2008/06/27/building-a-solaris-cluster-express-cluster-in-a-virtualbox-on-opensolaris/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 17:03:54 +0000</pubDate>
		<dc:creator>tyr</dc:creator>
		
		<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://system-log.tyr.org.uk/?p=21</guid>
		<description><![CDATA[I&#8217;ve been wanting to have a play around with both the Solaris Cluster Express work that&#8217;s coming out of OpenSolaris and also VirtualBox, a virtualization platform that Sun recently acquired and have moved under their xVM banner. So wanting to kill two birds with one stone I thought I&#8217;d try setting up a VirtualBox Solaris [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been wanting to have a play around with both the Solaris Cluster Express work that&#8217;s coming out of OpenSolaris and also VirtualBox, a virtualization platform that Sun recently acquired and have moved under their xVM banner. So wanting to kill two birds with one stone I thought I&#8217;d try setting up a VirtualBox Solaris Express cluster. Here&#8217;s a run through on how to get the same thing going if you&#8217;d like to try.</p>
<p><span id="more-21"></span></p>
<p>First an overview of what I set out to achieve.</p>
<ul>
<li>Clustered MySQL server in a zone</li>
<li>Clustered Apache zone providing phpmyadmin front end for MySQL</li>
<li>On a two node Solaris Express cluster</li>
<li>With nodes running in VirtualBox virtual machines on a single physical machine</li>
<li>Shared storage provided over iSCSI from the host machine</li>
</ul>
<p>VirtualBox does not support sharing the same (VDI) disk image between multiple hosts, unless the image is read-only. As such VirtualBox cannot natively provide storage appropriate for a clustered environment, so we&#8217;re going to prevent storage over iSCSI to the virtual nodes.</p>
<p>At the time of writing Solaris Cluster Express 6/08 has just been released, this has been updated to run on Solaris Express Community Edition (SXCE) Build 86, so we&#8217;ll be using that for our guest OS in the virtual machines.</p>
<p>Initially I was hoping to use OS X as the host platform for VirtualBox however the networking support is far from complete in the OS X release. Specifically is does not support &#8216;internal networking&#8217; and that&#8217;s needed for the cluster interconnects. So instead I chose OpenSolaris 2008.05 for the host, this has the advantage that the host can be used to provide the iSCSI services along with a Quorum Server and has the required networking flexibility.</p>
<p>If you don&#8217;t have an OpenSolaris host, then any recent Solaris 10 or Solaris Express server on your network should work fine. Ensure that ZFS supports the &#8217;shareiscsi&#8217; options and that you can share 2 8GB volumes from it. Also you will need to install a Quorum Server to it. If you don&#8217;t have a suitable host on your network you could create a 3rd VirtualBox machine to provide the required services.</p>
<p>To build this environment the following downloads were used</p>
<ul>
<li>Solaris Express community edition, build 86, from <a title="SXCE Build 86" href="https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_SMI-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=Sol-Express_b86-FULL-DVD-x86-SP-G-B@CDS-CDS_SMI">here</a></li>
<li>VirtualBox 1.6.2 from <a title="VirtualBox downloads" href="http://www.virtualbox.org/wiki/Downloads">here</a></li>
<li>Solaris Cluster Express 6/08 from <a title="Solaris Express Install Packages" href="http://opensolaris.org/os/community/ha-clusters/ohac/Documentation/SCXdocs/SCX/">here</a></li>
<li>OpenSolaris 2008.05 from <a title="OpenSolaris" href="http://www.opensolaris.com/get/">here</a></li>
<li>phpMyAdmin 2.11.6 from <a title="phpMyAdmin download" href="http://www.phpmyadmin.net/home_page/downloads.php">here</a></li>
</ul>
<p>You&#8217;ll need a machine with at least 2 GB of RAM, and around 50GB of hard disk space to follow this guide. If you have 2GB of RAM you&#8217;ll spend a fair amount of time swapping and may experience occasional cluster node panic, so more is recommended if you can get it. </p>
<p>Throughout this guide the prompt for the commands indicated the server it should be typed on.</p>
<ul>
<li><tt>opensolhost#</tt> - The OpenSolaris host</li>
<li><tt>cxnode1#</tt> - The first Cluster Express node</li>
<li><tt>cxnode2#</tt> - The second Cluster Express node</li>
<li><tt>both-nodes#</tt> - Repeat on both the first and second cluster nodes</li>
<li><tt>apache-zone#</tt> - Within the Apache zone</li>
<li><tt>mysql-zone#</tt> - Within the MySQL zone</li>
</ul>
<p>The following IP addresses were used, modify these to match your local network environment</p>
<ul>
<li>192.168.0.111 - The IPMP failover IP for cxnode1</li>
<li>192.168.0.112 - The IPMP failover IP for cxnode2</li>
<li>192.168.0.118 - The IP for the Apache zone</li>
<li>192.168.0.119 - The IP for the MySQL zone</li>
<li>192.168.0.121 - The first IPMP test address on cxnode1</li>
<li>192.168.0.122 - The first IPMP test address on cxnode2</li>
<li>192.168.0.131 - The second IPMP test address on cxnode1</li>
<li>192.168.0.132 - The second IPMP test address on cxnode2</li>
</ul>
<p>Sun provide extensive documentation for Sun Cluster 3.2, which for these purposes should match Cluster Express closely enough. You can find a good starting point at this <a title="Sun Cluster 3.2 Documentation Centre" href="http://docs.sun.com/app/docs/doc/820-2562/fxjbo?a=view">documentation centre page</a>.</p>
<h2>Installing and configuring VirtualBox</h2>
<p>To begin download VirtualBox from the links above, the steps below reference the 64 bit version but they should be the same for 32 bit users. Download the package and unzip/tar it, inside you&#8217;ll find two packages, they both need installing, ie:</p>
<pre>opensol-host# pkgadd -d VirtualBoxKern-1.6.2-SunOS-r31466.pkg
opensol-host# pkgadd -d VirtualBox-1.6.2-SunOS-amd64-r31466.pkg</pre>
<p>Before the virtual machines can be created some network configuration on the host is required. To enable the front interfaces of the cluster nodes to connect to the local network some virtual interfaces on the host are required. These will have the desired affect of bridging the local VLAN with the virtual machines.</p>
<p>The instructions in the VirtualBox documentation say to use /opt/VirtualBox/setup_vnic.sh to create these interfaces, however I had problems getting that to work. Not only is does it need some tweaks to get it to work with OpenSolaris 2008.05, I found I couldn&#8217;t get the interfaces going even after they were created. Fortunately I came across <a title="An Audience for Two Blog" href="http://blogs.sun.com/davetong/entry/configuring_host_networking_for_virtualbox">this</a> blog post, which pointed me in the direction of the steps below.</p>
<p>2 public interfaces are required for each cluster node, these can then be configured with IPMP, just as you would do in a real cluster, whilst this doesn&#8217;t really provide more resiliency it&#8217;s a worthwhile exercise. To create these public interfaces a total of four virtual interfaces are required on the host. Each one needs a defined MAC address that you can choose yourself, or you can use the suggested ones here. To create the interfaces do this, replacing e1000g0 with the address of your physical interface on your host.</p>
<pre>opensol-host# /usr/lib/vna e1000g0 c0:ff:ee:0:1:0
opensol-host# /usr/lib/vna e1000g0 c0:ff:ee:0:1:1
opensol-host# /usr/lib/vna e1000g0 c0:ff:ee:0:2:0
opensol-host# /usr/lib/vna e1000g0 c0:ff:ee:0:2:1</pre>
<p>I&#8217;ve chosen these MAC addresses because c0:ff:ee is easy to remember, and the last two octets represent the cluster node number and then the interface number in that node.</p>
<p>Now plumb these interfaces, but don&#8217;t give them IP addresses.</p>
<pre>opensol-host# ifconfig vnic0 plumb
opensol-host# ifconfig vnic1 plumb
opensol-host# ifconfig vnic2 plumb
opensol-host# ifconfig vnic3 plumb</pre>
<p>These four &#8216;vnic&#8217; interfaces will form the public interfaces of our cluster nodes. However these will not persist over a reboot so you may want to create a start up script to create these. There&#8217;s a sample script in the linked blog post above.</p>
<p>It&#8217;s now time to create the virtual machines, as your normal user run /opt/VirtualBox/VirtualBox and a window should pop up like this</p>
<p style="text-align: center;"><a href="http://system-log.tyr.org.uk/wp-content/uploads/2008/06/sun-xvm-virtualbox-front-page.png"><img class="alignnone size-medium wp-image-22" title="sun-xvm-virtualbox-front-page" src="http://system-log.tyr.org.uk/wp-content/uploads/2008/06/sun-xvm-virtualbox-front-page-300x223.png" alt="Sun xVM VirtualBox" width="300" height="223" /></a></p>
<p>To start creating the virtual machine that will serve as the first node of the cluster, click &#8216;New&#8217; to fire up the new server wizard. Enter &#8216;cxnode1&#8242; for the name of the first node (or choose something more imaginative), pick &#8216;Solaris&#8217; as the OS. Page through the rest of the wizard choosing 1GB for the memory allocation (this can be reduced later, at least 700MB is recommended) and create the default 16GB disk image.</p>
<p>The network interfaces need to be configured to support the cluster. Click into the &#8216;Network&#8217; settings area and change the &#8216;Adapter 0&#8242; type to &#8216;Intel PRO/1000 MT Desktop&#8217; and change the &#8216;Attached to&#8217; to &#8216;Host Interface&#8217;. Then enter the first MAC address you configured for the VNICs, if you followed the example above this will be c0ffee000100, then enter an interface name of &#8216;vnic0&#8242;. This Intel PRO/1000 MT Desktop adapter will appear as e1000g0 within the virtual machine. Generally I&#8217;ve grown to like these adapters, not least because they use a GLDv3 driver.</p>
<p>Now for &#8216;Adapter 1&#8242; enable the adapter and change the type as before, and set &#8216;Attached to&#8217; to &#8216;Host Interface&#8217;, the MAC to c0ffee000101 (or as appropriate) and the interface name to &#8216;vnic1&#8242;. Then enable &#8216;Adapter 2&#8242; and set &#8216;Attached to&#8217; to Internal Network and set &#8216;Network Name&#8217; to &#8216;Interconnect 1&#8242;. Repeat for &#8216;Adapter 2&#8242; but set the &#8216;Network Name&#8217; to &#8216;Interconnect 2&#8242;.</p>
<p>Finally point the CD/DVD-ROM to the ISO image you downloaded for Solaris Express Build 86. You need to add the ISO with the &#8216;Virtual Disk Manager&#8217; to make it available to the machine. You can use the &#8216;/net&#8217; NFS automounter to point to a NFS share where this image resides if required.</p>
<p>Finally change the boot order, in General / Advanced, so that &#8216;Hard Disk&#8217; comes before &#8216;CD/DVD&#8217;. This means that it will initially boot the install media, but once installed will boot from the installed drive.</p>
<p>Repeat the above steps to create a second cluster node. Ensure that &#8216;Adapter 2&#8242; and &#8216;Adapter 3&#8242; are connected to the same networks as for the first cluster node. Adapters 1 and 2 should be connected to the 3rd and 4th VNICs created previously.</p>
<h2>Installing Solairs</h2>
<p>Solaris now needs to be installed to both the cluster nodes. Repeat the following steps for each node. To boot a virtual machine click &#8216;Start&#8217; and the machine should boot and display the Grub menu. DON&#8217;T pick the default of &#8216;Solaris Express Developer Edition&#8217; but rather choose &#8216;Solaris Express&#8217;. If you choose the Developer Edition option you&#8217;ll get the SXDE installer which does not offer the flexibility required around partition layout.</p>
<p>Pick one of the &#8216;Solaris Interactive&#8217; install options as per your personal preference. If you&#8217;ve ever installed one of the main line Solaris releases that you&#8217;ll be at home here. Suggested settings for system identification phase:</p>
<ul>
<li>Networked</li>
<li>Configure e1000g0 (leave the others for the time being)
<ul>
<li>No DHCP</li>
<li>Hostname: cxnode1 (or choose something yourself)</li>
<li>IP: 192.168.0.111 (or something else as appropriate)</li>
<li>Netmask 255.255.255.0 (or as appropriate)</li>
<li>No IPV6</li>
<li>Default Route - Specify</li>
<li>192.168.0.1 (the IP of your default router)</li>
<li>Don&#8217;t enable Kerberos</li>
<li>&#8216;None&#8217; for naming service</li>
<li>Default derived domain for NFSv4 domain</li>
</ul>
</li>
<li>Specify time zone as required</li>
<li>Pick a root password</li>
</ul>
<p>Then in the installation phase pick the following options</p>
<ul>
<li>Reboot automatically: no</li>
<li>Eject additional CDs: yes (not that we&#8217;ll be using any)</li>
<li>Media: CD/DVD</li>
<li>Install Type: Custom</li>
<li>Add additional locales as required, we&#8217;re using C as the default.</li>
<li>Web Start Scan location: None</li>
<li>Software group: Entire Group Plus OEM / Default Packages</li>
<li>Leave the fdisk partition as the default, one single Solaris partition covering the whole disk.</li>
<li>To support the cluster a specific filesystem layout is required. Click &#8216;Modify&#8217; then set as this: (If space is needed for a live upgrade in the future then an additional virtual disk can be attached)
<ul>
<li>Slice 0: &#8216;/&#8217; - 13735 MB</li>
<li>Slice 1: &#8217;swap&#8217; - 2048 MB</li>
<li>Slice 6 &#8216;/globaldevices&#8217; - 512 MB</li>
<li>Slice 7 &#8216;(leave blank)&#8217; - 32MB</li>
</ul>
</li>
<li>Now just confirm and start the install</li>
</ul>
<p>The installer should now run through in due course, once complete reboot the machine and check it boots up fine for the first time.</p>
<p>By default Solaris will boot up into a GNOME desktop. If you want to disable the graphic login prompt from launching then do &#8217;svcadm disable cde-login&#8217;</p>
<p>Before the cluster framework is installed the VirtualBox &#8216;Guest Additions&#8217; need to be installed, these serve a similar role to VMWare Tools in that they provide better integration with the host environment. Specifically the &#8216;Time synchronization&#8217; facilities are required to assist with keeping the cluster nodes in sync.</p>
<p>If you still have the SXDE DVD image mounted then &#8216;eject&#8217; this in the guest and &#8216;Unmount&#8217; it from the &#8216;Devices&#8217; menu. Then choose &#8216;Install Guest Additions&#8230;&#8217; from the VirtualBox menu. The Guest Additions iso should mount, then su to root and pkgadd the VBoxSolarisAdditions.pkg from the CD. If you&#8217;re running X you should logout and back in to activate the X11 features.</p>
<p>Repeat the above steps for both cluster nodes.</p>
<p>It&#8217;s worth considering taking a snapshot at this point so if you run into problems later you can just snap it back to this post install state.</p>
<h2>Preparing for cluster install</h2>
<p>Once the nodes are installed there are a few steps required to configure them before the cluster framework can be installed. Firstly the public network interfaces on the nodes need to be configured. To do this use the below /etc/hostname files modifying where appropriate to your local network.</p>
<ul>
<li>cxnode1:/etc/hostname.e1000g0
<ul>
<li>
<pre>192.168.0.121 netmask 255.255.255.0 broadcast 192.168.0.255 deprecated -failover group public up
addif 192.168.0.111 up</pre>
</li>
</ul>
</li>
<li>cxnode1:/etc/hostname.e1000g1
<ul>
<li>
<pre>192.168.0.131 netmask 255.255.255.0 broadcast 192.168.0.255 deprecated -failover group public up</pre>
</li>
</ul>
</li>
<li>cxnode2:/etc/hostname.e1000g0
<ul>
<li>
<pre>192.168.0.122 netmask 255.255.255.0 broadcast 192.168.0.255 deprecated -failover group public up
addif 192.168.0.112 up</pre>
</li>
</ul>
</li>
<li>cxnode2:/etc/hostname.e1000g1
<ul>
<li>
<pre>192.168.0.132 netmask 255.255.255.0 broadcast 192.168.0.255 deprecated -failover group public up</pre>
</li>
</ul>
</li>
</ul>
<p>Also check that /etc/defaultrouter is correct.</p>
<p>The RPC communication must be activated for the cluster framework to function. To do this do</p>
<pre>opensol-host# svccfg
svc:&gt; select network/rpc/bind
svc:/network/rpc/bind&gt; setprop config/local_only=false
svc:/network/rpc/bind&gt; quit
opensol-host# svcadm refresh network/rpc/bind:default
opensol-host# svcprop network/rpc/bind:default | grep local_only</pre>
<p>The last command should return &#8216;false&#8217;.</p>
<p>Modify your path to include</p>
<pre>/usr/bin
/usr/cluster/bin
/usr/sbin
/usr/ccs/bin</pre>
<p>Also check your &#8216;umask&#8217; is set to 0022 and change it if not.</p>
<p>Finally we need to ensure the cluster nodes exist in /etc/inet/hosts on both hosts. For example</p>
<pre>192.168.0.111 cxnode1
192.168.0.112 cxnode2</pre>
<p>After making the above changes bounce the nodes to check it all persists across a reboot.</p>
<p>Once the above has been repeated on both cluster nodes it is time to install the cluster framework.</p>
<h2>Installing Cluster Express</h2>
<p>Download and extract Solaris Cluster Express 6/08, inside the package <tt>cd</tt> into <tt>&#8216;Solaris_x86&#8242;</tt> then run <tt>&#8216;./installer&#8217;</tt>. If you are connected over a ssh or on the console then run <tt>&#8216;./installer -nodisplay&#8217;</tt> instead. The steps listed here are for the GUI installer, but the text one is much the same.</p>
<p>Wait for the GUI to launch, click through and accept the license. Then from the list of available services choose ‘Solaris (TM) Cluster Express 6/08′ and ‘Solaris (TM) Cluster Express Agents 6/08′ (enter ‘4,6′ if you’re in the text installer). Leave the other options disabled, and clear ‘Install multilingual packages’ unless you want them. Click ‘Next’ to start the installer. You’ll be informed that some packages are being upgraded from their existing versions (namely SUNWant, SUNWjaf and SUNWjmail). The cluster will now perform some pre installation checks and they should all pass ‘OK’, then proceed with the install. Choose ‘Configure Later’ when prompted, as that will be done once all the installation steps are finished. Repeat the install process on the second node.</p>
<p>Now the cluster is installed it can be configured and established. This is started by running <tt>/usr/cluster/bin/scinstall</tt>. I prefer to do this on the second node of the cluster (<tt>cxnode2</tt>), as the installer configures the partner server first and it will be assigned node id 1, the server running the install will be assigned node id 2. It doesn’t really matter I just prefer it to follow the ordering of the hostnames.</p>
<p>Once the installer is running choose option 1 (Create a new cluster or add a cluster node), then option 1 (Create a new cluster), answer ‘yes’ to continue, choose ‘2′ for custom configuration. Pick a cluster name eg ‘DEV1′. Then when prompted for the other nodes in the cluster enter ‘cxnode2′ then ^D to complete. Confirm the list of nodes is correct, communication with the other node will now be tested and should complete fine. Answer ‘no’ for DES authentication.</p>
<p>Now you’ll be asked about the network configuration for the interconnect. The default network range is 172.16.0.0/255.255.248.0 but you can change this if required. Answer ‘yes’ to use at least two private networks, then ‘yes’ to the question about switches. Although there are no switches to configure we’re considering each private network configured in VirtualBox to be an unmanaged switch. Accept the default names for ’switch1′ and ’switch2′. You’ll now be asked to configure the transport adapters (effectively the network interfaces). Pick ‘1′ (e1000g2) for the first cluster transport adapter, answer ‘yes’ to indicate it is a dedicated cluster transport adapter. Answer ’switch1′ when asked about which switch it is connected to and accept the defaut name. Then pick ‘2′ (e1000g3) for the second adapter and again pick the default options. Answer ‘yes’ for auto discovery.</p>
<p>You’ll now be asked about Quorum configuration, this will be addressed later so choose ‘yes’ to disable automatic selection. The next quetion is about the global devices file system. The default is /globaldevices, accept it as this matches the layout created when initially installing Solaris. Accept this for cxnode2 as well.</p>
<p>You’ll be asked for final confirmation that it is ok to proceed so just answer ‘yes’ when you’re ready. You’ll now be asked if you want the creation to be interrupted if sccheck fails, go for ‘yes’ rather than the default of ‘no’. The cluster establishment will now start. You should see something similar to this when it discovers the cluster transports:</p>
<pre>The following connections were discovered:
cxnode2:e1000g2  switch1  cxnode1:e1000g2
cxnode2:e1000g3  switch2  cxnode1:e1000g3</pre>
<p><tt>cdnode1</tt> will reboot and establish the cluster with itself as the only node. Don’t worry about any errors about <tt>/etc/cluster/ccr/did_instances</tt>, the DID database hasn’t been created yet. The installer will then configure <tt>cxnode2</tt> and reboot that. When it boots back up it will join the new cluster.</p>
<p>We now have an established cluster! However it’s in ‘installmode’ until a quorum device is configured.</p>
<h2>Configuring a Quorum Server</h2>
<p>To finish the base cluster configuration a quorum device must be assigned. Initially I was planning to do this by presenting an iSCSI LUN from the OpenSolaris host into the guests, then using that for the quorum device. However I found that it, although it could be added fine, it would show as ‘offline’ and not function properly.</p>
<p>As such a quorum server running on the OpenSolaris host will be used. Full documentation for this can be found <a title="Quorum Server Configuration" href="http://docs.sun.com/app/docs/doc/819-5360">here</a>, but this overview should be enough to get you going. Fortunately it can be installed on it’s own, without requiring a full cluster install. To install it make the Cluster Express package available on the host and run the installer again, you’ll need to use the ‘-nodisplay’ option as some packages won’t be available for the graphical installer.</p>
<p>When running the installer choose ‘No’ when asked if you want to install the full set of components. Then choose option 2 for ‘Quorum Server’ and install that. Choose ‘Configure Later’ when asked.</p>
<p>The default install creates a configuration for one quorum server, running on port 9000. You can see the configuration in /etc/scqsd/scqsd.conf. Start the quorum server by running</p>
<pre>opensol-host# /usr/cluster/bin/clquorumserver start 9000</pre>
<p>The quorum server can now be configured into the cluster to get it fully operational.</p>
<p>One one of the cluster nodes run <tt>clsetup</tt>. Answer ‘yes’ to confirm you have finished the initial cluster setup and ‘yes’ to add a quorum device. Now pick option 3 (Quorum Server). Answer ‘yes’ to continue then give a name for the device, such as ‘opelsolhost’. Enter the IP of your host when prompted and 9000 as the port number. Allow it to proceed then choose ‘yes’ to reset installmode. The cluster is now properly established.</p>
<p>You can check the quorum registration on the OpenSolaris host by doing <tt>/usr/cluster/bin/clquorumserver show</tt>, you should see something like this:</p>
<pre>opensol-host#/usr/cluster/bin/clquorumserver show
---  Cluster DEV1 (id 0x484E9DB9) Registrations ---
Node ID:                      1
Registration key:           0x484e9db900000001
Node ID:                      2
Registration key:           0x484e9db900000002</pre>
<h2>Provisioning storage</h2>
<p>To enable the creation of the Apache and MySQL zones it’s necessary to present some storage to the cluster that can be shared between them.</p>
<p>As OpenSolaris is running on the host, take advantage of the in built iSCSI support in ZFS. First create some ZFS Volumes, one for each clustered service. eg.</p>
<pre>opensol-host# zfs create -V 8g rpool/apache
opensol-host# zfs create -V 8g rpool/mysql</pre>
<p>Now enable iSCSI export on them.</p>
<pre>opensol-host# zfs set shareiscsi=on rpool/apache
opensol-host# zfs set shareiscsi=on rpool/mysql</pre>
<p>And confirm this with <tt>iscsitadm list target -v</tt></p>
<pre>opensol-host# iscsitadm list target -v
Target: rpool/apache
iSCSI Name: iqn.1986-03.com.sun:02:29f26a9a-facb-4d29-adf8-adef67b21a00
Alias: rpool/apache
--snip--
Size: 8.0G
Backing store: /dev/zvol/rdsk/rpool/apache
Status: online
Target: rpool/mysql
iSCSI Name: iqn.1986-03.com.sun:02:1a782d05-c7c5-cd74-8ea3-b6c094cb3cf8
Alias: rpool/mysql
--snip--
Size: 8.0G
Backing store: /dev/zvol/rdsk/rpool/mysql
Status: online</pre>
<p>Now configure the nodes to see the presented storage. Do this on both of the nodes, replacing 192.168.0.104 with the IP of your host.</p>
<pre>both-nodes# iscsiadm modify discovery –sendtargets enable
both-nodes# iscsiadm add discovery-address 192.168.0.104
both-nodes# svcadm enable network/iscsi_initiator</pre>
<p>And then to confirm:</p>
<pre>both-nodes# iscsiadm list target -S
Target: iqn.1986-03.com.sun:02:1a782d05-c7c5-cd74-8ea3-b6c094cb3cf8
Alias: rpool/mysql
--snip--
OS Device Name: /dev/rdsk/c2t01000017F202642400002A00484FCCC1d0s2
Target: iqn.1986-03.com.sun:02:29f26a9a-facb-4d29-adf8-adef67b21a00
Alias: rpool/apache
--snip--
OS Device Name: /dev/rdsk/c2t01000017F202642400002A00484FCCBFd0s2</pre>
<p>Make a note of the OS Device Name to Alias matching as you need to put the right LUN into the correct resource group.</p>
<p>You can also confirm the storage is available by running format, eg:</p>
<pre>both-nodes# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0d0
        /pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0
1. c2t01000017F202642400002A00484FCCBFd0
        /scsi_vhci/disk@g01000017f202642400002a00484fccbf
2. c2t01000017F202642400002A00484FCCC1d0
        /scsi_vhci/disk@g01000017f202642400002a00484fccc1</pre>
<p>To make this storage available to the cluster you must populate the DID device database. This is performed via <tt>cldevice</tt> and only needs to be run on one of the nodes:</p>
<pre>cxnode1# cldevice populate
Configuring DID devices
cldevice: (C507896) Inquiry on device “/dev/rdsk/c0d0s2″ failed.
did instance 5 created.
did subpath cxnode1:/dev/rdsk/c2t01000017F202642400002A00484FCCC1d0 created for instance 5.
did instance 6 created.
did subpath cxnode1:/dev/rdsk/c2t01000017F202642400002A00484FCCBFd0 created for instance 6.
Configuring the /dev/global directory (global devices)
obtaining access to all attached disks</pre>
<p>Then list the device database to check the storage is available</p>
<pre>cxnode1# cldevice list -v
DID Device          Full Device Path
----------          ----------------
d1                  cxnode1:/dev/rdsk/c1t0d0
d2                  cxnode1:/dev/rdsk/c0d0
d3                  cxnode2:/dev/rdsk/c1t0d0
d4                  cxnode2:/dev/rdsk/c0d0
d5                  cxnode1:/dev/rdsk/c2t01000017F202642400002A00484FCCC1d0
d5                  cxnode2:/dev/rdsk/c2t01000017F202642400002A00484FCCC1d0
d6                  cxnode1:/dev/rdsk/c2t01000017F202642400002A00484FCCBFd0
d6                  cxnode2:/dev/rdsk/c2t01000017F202642400002A00484FCCBFd0</pre>
<p>Now the basic configuration of the cluster is fairly complete. It’s a good opportunity to shut it down and take a snapshot. When shutting down the entire cluster you must use <tt>cluster shutdown</tt> rather than just shutting down the individual nodes. If you don’t then you must bring up the nodes in the reverse order of shutting them down. For an immediate shutdown do <tt>cluster shutdown -y -g 0</tt>.</p>
<h2>Configuring the Storage</h2>
<p>Originally I was planning to create some SVM metasets and add the disks to those, however this doesn’t appear to be possible with iSCSI LUNs yet, not even if you use the VirtualBox built in iSCSI initiator support, which results in the storage appearing as local disks. So instead I settled on using ZFS-HA to manage the disks. The process for this, as with most zfs stuff, is fairly straightforward.</p>
<p>First create a ZFS storage pool for each clustered service. We’ll use the DID device number here, so make sure you follow list back via <tt>cldevice list -v</tt> and <tt>iscsiadm list target -S</tt> to ensure you put the correct target into the correct ZFS pool.</p>
<p>In order for the storage to be added to ZFS it needs to have a &#8216;fdisk&#8217; partition added to it. One one of the nodes run fdisk against the two devices, accepting the default partition layout.:</p>
<pre>cxnode1# fdisk /dev/rdsk/c2t01000017F202642400002A00484B5467d0p0
No fdisk table exists. The default partition for the disk is:
a 100% “SOLARIS System” partition
Type “y” to accept the default partition,  otherwise type “n” to edit the
partition table.</pre>
<p>The standard SMI label needs to be replaced with an EFI one. When I&#8217;ve been working with ZFS previously this has always happened automatically but it didn&#8217;t work for me this time, possibly because we are going to add the DID device to the zpool rather than a traditional disk device. To change it manually run <tt>format</tt> with the <tt>-e</tt> option.</p>
<pre>cxnode1# format -e
Searching for disks…done

AVAILABLE DISK SELECTIONS:
0. c0d0
        /pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0
1. c2t01000017F202642400002A00484FCCBFd0
        /scsi_vhci/disk@g01000017f202642400002a00484fccbf
2. c2t01000017F202642400002A00484FCCC1d0
        /scsi_vhci/disk@g01000017f202642400002a00484fccc1
Specify disk (enter its number): 2
selecting c2t01000017F202642400002A00484FCCC1d0
[disk formatted]
Error occurred with device in use checking: No such device
format&gt; label
Error occurred with device in use checking: No such device
[0] SMI Label
[1] EFI Label
Specify Label type[0]: 1
Warning: This disk has an SMI label. Changing to EFI label will erase all
current partitions.
Continue? y
format&gt; p
partition&gt; p
Current partition table (default):
Total disk sectors available: 16760798 + 16384 (reserved sectors)

Part      Tag    Flag     First Sector        Size        Last Sector
0        usr    wm                34       7.99GB         16760798
1 unassigned    wm                 0          0              0
2 unassigned    wm                 0          0              0
3 unassigned    wm                 0          0              0
4 unassigned    wm                 0          0              0
5 unassigned    wm                 0          0              0
6 unassigned    wm                 0          0              0
7 unassigned    wm                 0          0              0
8   reserved    wm          16760799       8.00MB         16777182</pre>
<p>If you&#8217;d like to suppress the &#8220;Error occurred with device in use checking: No such device&#8221; warning then set &#8216;NOINUSE_CHECK&#8217; as an environment variable. It seems to be <a href="http://bugs.opensolaris.org/view_bug.do?bug_id=6471301">this bug</a> that&#8217;s causing the warning.</p>
<p>Now the disks can be added to a ZFS pool. Make sure you add the correct DID device here:</p>
<pre>cxnode1# zpool create apache-pool /dev/did/dsk/d6s0
cxnode1# zpool create mysql-pool /dev/did/dsk/d5s0</pre>
<p>Then confirm these are available as expected:</p>
<pre>cxnode1# zpool list
NAME          SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
apache-pool  7.94G   111K  7.94G     0%  ONLINE  -
mysql-pool   7.94G   111K  7.94G     0%  ONLINE  -</pre>
<p>Now create some filesystems in the pools. For each service three file systems are required</p>
<ul>
<li>zone - This will become the zone root</li>
<li>data - This will become /data within the zone and be used to store application data</li>
<li>params - This will be used to store a cluster parameter file</li>
</ul>
<pre>cxnode1# zfs create apache-pool/zone
cxnode1# zfs create apache-pool/data
cxnode1# zfs create apache-pool/params
cxnode1# zfs create mysql-pool/zone
cxnode1# zfs create mysql-pool/data
cxnode1# zfs create mysql-pool/params</pre>
<p>To make the storage usable with the cluster it needs to be configured into a resource group. Create two resource groups, one for each service</p>
<pre>cxnode1# clresourcegroup create apache-rg
cxnode1# clresourcegroup create mysql-rg</pre>
<p>SUNW.HAStoragePlus is the resource type that can manage ZFS storage, along with SVM and VxVM. It needs to be registered with the cluster with <tt>clresourcetype register</tt>, this only needs to be performed on one node.</p>
<pre>cxnode1# clresourcetype register SUNW.HAStoragePlus</pre>
<p>Create clustered resources to manage the ZFS pools:</p>
<pre>cxnode1# clresource create -g apache-rg -t SUNW.HAStoragePlus -p Zpools=apache-pool apache-stor
cxnode2# clresource create -g mysql-rg -t SUNW.HAStoragePlus -p Zpools=mysql-pool mysql-stor</pre>
<p>The resource groups will currently be in &#8216;Unmanaged&#8217; state, you can confirm this with <tt>clresourcegroup status</tt>. To bring them under cluster management bring them online on the first node:</p>
<pre>cxnode1# clresourcegroup online -M -n cxnode1 apache-rg</pre>
<p>Then check the file systems are available are available on the first node but not on the second.</p>
<pre>cxnode1# zfs list
NAME               USED  AVAIL  REFER  MOUNTPOINT
apache-pool        158K  7.81G    21K  //apache-pool
apache-pool/data    18K  7.81G    18K  //apache-pool/data
apache-pool/params 18K  7.81G    18K  //apache-pool/params
apache-pool/zone    18K  7.81G    18K  //apahce-pool/zone</pre>
<pre>cxnode2# zfs list
no datasets available</pre>
<p>Now move the pool to the other node and check that it becomes available on that node</p>
<pre>cxnode1# clresourcegroup switch -n cxnode2 apache-rg</pre>
<pre>cxnode1# zfs list
no datasets available</pre>
<pre>cxnode2#  zfs list
NAME               USED  AVAIL  REFER  MOUNTPOINT
apache-pool        158K  7.81G    21K  //apache-pool
apache-pool/data    18K  7.81G    18K  //apache-pool/data
apache-pool/params 18K  7.81G    18K  //apache-pool/params
apache-pool/zone    18K  7.81G    18K  //apahce-pool/zone</pre>
<p>When you&#8217;re happy switch it back to the first node:</p>
<pre>cxnode1# clresourcegroup switch -n cxnode1 apache-rg</pre>
<p>Then repeat the above online and failover tests for mysql-rg and mysql-pool</p>
<p>As the ZFS pools have now been added as cluster managed resources you must now use the cluster to mange them. Don&#8217;t perform export/import operations manually.</p>
<h2>Preparing Apache and MySQL zones for clustering</h2>
<p>To provide a clustered Apache and MySQL service two zones are going to be created. Whilst these services could equally well be clustered without the use of zones I decided to go down this path so that the benefits of zones could be enjoyed in tandem with the clustering.</p>
<p>A full example run through for configuring MySQL in a clustered zone is provided by Sun in the <a href="http://docs.sun.com/app/docs/doc/819-3059/gchqia?a=view">official documentation</a> if you require further information.</p>
<p>It&#8217;s worth pointing out that if you are following this plan then it will create zones on ZFS devices, currently this is not supported for &#8216;Live Upgrade&#8217; at present, so you are restricting your upgrade paths in the future. If you do decide you need to &#8216;Live Upgrade&#8217; the cluster at some point in the future then you could remove the zones, do the upgrade, and then re-create the zones. If you don&#8217;t want to do this then consider using raw disk slices with the cluster rather than ZFS.</p>
<p>For each zone the pool/zone file system will be used for the zone root, then the pool/data file system will be delegated to the zone&#8217;s control which will be used for the application to store it&#8217;s data, i.e. the MySQL databases or the Apache document root.</p>
<p>To provide IP addressing for the zones SUNW.LogicalHostname resources will be used, rather than directly configuring the zone with an IP addres.</p>
<p>First entries need adding to /etc/hosts on both nodes, eg:</p>
<pre>192.168.0.118 apache-zone
192.168.0.119 mysql-zone</pre>
<p>Then create LogicalHostname resources for each address:</p>
<pre>cxnode1# clreslogicalhostname create -g apache-rg -h apache-zone apache-addr
cxnode1# clreslogicalhostname create -g mysql-rg -h mysql-zone mysql-addr</pre>
<p>Now it&#8217;s time to create the zones. This is a really simple zone configuration, you could add resource controls or other features as desired. <tt>autoboot</tt> must be set to <tt>false</tt> as the cluster will be managing the starting and stopping of the zone.</p>
<pre>cxnode1# zonecfg -z apache
apache: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:apache&gt; create
zonecfg:apache&gt; set zonepath=/apache-pool/zone
zonecfg:apache&gt; set autoboot=false
zonecfg:apache&gt; add dataset
zonecfg:apache:dataset&gt; set name=apache-pool/data
zonecfg:apache:dataset&gt; end
zonecfg:apache&gt; verify
zonecfg:apache&gt; commit
zonecfg:apache&gt; exit
cxnode1# zonecfg -z mysql
mysql: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:mysql&gt; create
zonecfg:mysql&gt; set zonepath=/mysql-pool/zone
zonecfg:mysql&gt; set autoboot=false
zonecfg:mysql&gt; add dataset
zonecfg:mysql:dataset&gt;set name=mysql-pool/data
zonecfg:mysql:dataset&gt; end
zonecfg:mysql&gt; verify
zonecfg:mysql&gt; commit
zonecfg:mysql&gt; exit</pre>
<p>To enable the zones to be installed we must change the permissions on the zone roots:</p>
<pre>cxnode1# chmod 700 /apache-pool/zone
cxnode1# chmod 700 /mysql-pool/zone</pre>
<p>Now install the zones:</p>
<pre># zoneadm -z apache install
Preparing to install zone &lt;apache&gt;.
Creating list of files to copy from the global zone.
Copying &lt;9668&gt; files to the zone.
Initializing zone product registry. Determining zone package initialization order.
Preparing to initialize &lt;1346&gt; packages on the zone.
Initialized &lt;1346&gt; packages on zone.
Zone &lt;apache&gt; is initialized.
Installation of these packages generated warnings:
&lt;sunwvboxguest&gt;
The file &lt;/apache-pool/zone/root/var/sadm/system/logs/install_log&gt; contains a log of the zone installation.
# zoneadm -z mysql install
etc..</pre>
<p>The documentation has this to say about configuring zones:</p>
<blockquote><p>Caution: If the zone is to run in a failover configuration, each node being able to host that zone must have the exact same zone configuration for that zone. After installing the zone on the first node, the zone&#8217;s zone path already exists on the zones&#8217;s disk storage. Therefore it must get removed on the next node prior to successfully create and install the zone.[..] Only the zone&#8217;s zone path created on the last node will be kept as the final zone path for the failover zone. For that reason any configuration and customization within the failover zone should get performed after the failover zone is known to all nodes that should be able to host it.</p></blockquote>
<p>To achieve this the newly created zone must be destroyed and recreated on the second node. To my mind this is a really ugly way of achieving this, the cluster should be able to manage this itself and make suitable configuration changes on a node when the zone is configured into the cluster.</p>
<p>In later releases of Sun Cluster 3.1 the recommended way to manage this configuration was that the /etc/zones files be hacked to replicate the configuration of the zones from one node to another. However this method is not supported any more so the official instructions will be followed.</p>
<p>To do this migrate the storage for the zones to the other node</p>
<pre>cxnode1# clresourcegroup switch -n cxnode2 apache-rg
cxnode1# clresourcegroup switch -n cxnode2 mysql-rg</pre>
<p>Then delete the previously installed zone roots on the second node</p>
<pre>cxnode2# rm -rf /apache-pool/zone/*
cxnode2# rm -rf /mysql-pool/zone/*</pre>
<p>Now repeat the zonecfg and zoneadm steps above to recreate both of the zones.</p>
<p>When the zone installs have completed again move the storage back to the first node.</p>
<pre>cxnode1# clresourcegroup switch -n cxnode1 apache-rg
cxnode1# clresourcegroup switch -n cxnode1 mysql-rg</pre>
<p>The zones can now be booted and configured. Repeat these steps for Apache and the the MySQL zone. Boot the zone:</p>
<pre>cxnode1# zoneadm -z apache boot</pre>
<p>I got this error when booting the zones <tt>Unable to set route for interface lo0 to *??9?x</tt> , I m not sure what this means but it doesn&#8217;t seem to impact anything.</p>
<p>Login to the zone&#8217;s console to configure it:</p>
<p><tt>cxnode1# zlogin -C apache</tt></p>
<p>You&#8217;ll be asked a few questions to configure the zone. Choose language, terminal type and time zone information as appropriate. Enter the same hostname as you used above, eg &#8216;apache-zone&#8217; or &#8216;mysql-zone&#8217;. I received some alerts about avahi-bridge-dsd failing to start when booting, as far as I can tell it&#8217;s some sort of Bonjour networking thing, we don&#8217;t need it here so it&#8217;s ok to disable. You can also disable some other services that are not required to free up some resources</p>
<p><tt>apache-zone# svcadm disable cde-login<br />
apache-zone# svcadm disable sendmail<br />
apache-zone# svcadm disable webconsole<br />
apache-zone# svcadm disable avahi-bridge-dsd<br />
apache-zone# svcadm disable ppd-cache-update</tt></p>
<p>Now mount the zfs file systems that have delegated to the zone to an appropriate place. To do this on the Apache zone:</p>
<p><tt>apache-zone# zfs set mountpoint=/data apache-pool/data</tt></p>
<p>And on the MySQL zone:</p>
<p><tt>mysql-zone# zfs set mountpoint=/data mysql-pool/data</tt></p>
<p>Wait for the zone to finish booting and check you don&#8217;t have any failed services with <tt>svcs -xv</tt>. Then shut the zone down and repeat for the other zone.</p>
<h2>Clustering the zones</h2>
<p>Before proceeding further ensure the storage is available on the first node, fail it over if necessary. Also make sure the zones are shut down.</p>
<p>To enable clustering for the zones they must be registered with the cluster. To do this a script called <tt>sczbt_register</tt> is provided. To use this a configuration file must be completed and then registered. A sample configuration file is provided at <tt>/opt/SUNWsczone/sczbt/util/sczbt_config</tt>, this is also the file that will be read by default by <tt>sczbt_register</tt>. It is recommended to copy this file to some other place for future reference, then run <tt>sczbt_register</tt> against that. Comments are included in the file to explain the options, or see the <a href="http://docs.sun.com/app/docs/doc/819-3069/cacjgdbc?a=view">official docs</a> for more info.</p>
<p>Copy <tt>/opt/SUNWsczone/sczbt/util/sczbt_config</tt> to <tt>/etc/sczbt_config.apache</tt> and <tt>/etc/sczbt_config.mysql</tt> and edit as follows</p>
<pre> /etc/sczbt_config.apache:

RS=apache-zone
RG=apache-rg
PARAMETERDIR=/apache-pool/params
SC_NETWORK=true
SC_LH=apache-addr
FAILOVER=true
HAS_RS=apache-stor
Zonename="apache"
Zonebrand="native"
Zonebootopt=""
Milestone="multi-user-server"
LXrunlevel="3"
SLrunlevel="3"
Mounts=""</pre>
<pre> /etc/sczbt_config.mysql

RS=mysql-zone
RG=mysql-rg
PARAMETERDIR=/mysql-pool/params
SC_NETWORK=true
SC_LH=mysql-addr
FAILOVER=true
HAS_RS=mysql-stor
Zonename="mysql"
Zonebrand="native"
Zonebootopt=""
Milestone="multi-user-server"
LXrunlevel="3"
SLrunlevel="3"
Mounts=""</pre>
<p>The zones can now be registered. First you need to register the SUNW.gds resource type. On one node do:</p>
<pre>cxnode1# clresourcetype register SUNW.gds</pre>
<p>Then register the two zones</p>
<pre>cxnode1# /opt/SUNWsczone/sczbt/util/sczbt_register -f /etc/sczbt_config.apache
sourcing /etc/sczbt_config.apache
Registration of resource apache-zone succeeded.
Validation of resource apache-zone succeeded.</pre>
<pre>cxnode1# /opt/SUNWsczone/sczbt/util/sczbt_register -f /etc/sczbt_config.mysql
sourcing /etc/sczbt_config.mysql
Registration of resource mysql-zone succeeded.
Validation of resource mysql-zone succeeded.</pre>
<p>Then enable the Apache zone and log in to it. You should see the LogicalHostname resource has been assigned to the zone</p>
<pre>cxnode1# clresource enable apache-zone
cxnode1# zoneadm list -cv
ID NAME             STATUS     PATH                           BRAND    IP
0 global           running    /                              native   shared
1 apache           running    /apache-pool/zone              native   shared
- mysql            installed  /mysql-pool/zone               native   shared
cxnode1# zlogin apache
[Connected to zone 'apache' pts/2]
Last login: Tue Jun 17 20:23:08 on pts/2
Sun Microsystems Inc.   SunOS 5.11      snv_86  January 2008
apache-zone# ifconfig -a
lo0:1: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g1:1: flags=201040843 mtu 1500 index 3
inet 192.168.0.118 netmask ffffff00 broadcast 192.168.0.255</pre>
<p>Then test a failover and failback of the zone.</p>
<pre>cxnode1# clresourcegroup switch -n cxnode2 apache-rg
cxnode1# clresourcegroup switch -n cxnode1 apache-rg</pre>
<p>Repeat the same checks for the MySQL zone.</p>
<h2>Installing and configuring MySQL</h2>
<p>MySQL 5.0.45 is installed by default with the Solaris Express install we have performed. This consists of the SUNWmysql5r, SUNWmysql5u and SUNWmysql5test packages.</p>
<p>The installation can be used pretty much unmodified, the only modification needed is to repoint the MySQL data directory to the delegated zfs file system. This is done by modifying the SMF properties for the service, you cannot make this change by modifying my.cfg. Make the change with svccfg:</p>
<pre>mysql-zone# svccfg
svc:&gt; select svc:/application/database/mysql:version_50
svc:/application/database/mysql:version_50&gt; setprop mysql/data = /data/mysql
svc:/application/database/mysql:version_50&gt; refresh
svc:/application/database/mysql:version_50&gt; end</pre>
<p>Then create the directory for the databases and one for some logs</p>
<pre>mysql-zone# mkdir /data/mysql
mysql-zone# mkdir /data/logs
mysql-zone# chown mysql:mysql /data/mysql
mysql-zone# chown mysql:mysql /data/logs</pre>
<p>Now start up the database and check that it starts ok</p>
<pre>mysql-zone# svcadm enable mysql:version_50
mysql-zone# svcs mysql:version_50
STATE          STIME    FMRI
online         10:38:54 svc:/application/database/mysql:version_50</pre>
<p>Now set a password for the root users for the database, it&#8217;s set to &#8216;root&#8217; in this case.</p>
<pre>mysql-zone# /usr/mysql/5.0/bin/mysqladmin -u root password root
mysql-zone# /usr/mysql/5.0/bin/mysqladmin -u root -h localhost -p password root
Enter password:<em>root</em></pre>
<p>The /etc/hosts file in the zone needs to be modified so that &#8216;mysql-zone&#8217; is the name for the clustered IP address for the zone rather than the localhost, also the address for the apache-zone needs to be added.</p>
<pre>127.0.0.1       localhost       loghost
192.168.0.119   mysql-zone
192.168.0.118   apache-zone</pre>
<p>Allow access to the root user to connect from the Apache zone.</p>
<pre>mysql-zone# /usr/mysql/5.0/bin/mysql -p
Enter password: root
mysql&gt; GRANT ALL ON *.* TO 'root'@'apache-zone' identified by 'root';</pre>
<p>MySQL is now configured and ready to be clustered. We&#8217;ll be using a process loosely  based on the one documented <a href="http://docs.sun.com/app/docs/doc/819-3059/gczdj?a=view">here</a>. Alternatively it would be possible to use SMF to manage the service, you can see an example of that method in the Apache configuration later.</p>
<p>First a user for the fault monitor must be created along with a test database for it to use. A script is provided with the agent to do this for you. It will grant the fault monitor user &#8216;PROCESS, SELECT, RELOAD, SHUTDOWN, SUPER&#8217; on all databases, then ALL privileges on the test database.</p>
<p>To create the required users you need to provide a config file. Copy the supplied template into <tt>/etc</tt> and edit it there</p>
<pre>mysql-zone# cp /opt/SUNWscmys/util/mysql_config /etc
mysql-zone# vi /etc/mysql_config</pre>
<p>Use these values, note that MYSQL_DATADIR is the location of the my.cnf, not the directory to the databases. The meaning of DATADIR changed in 5.0.3 to mean the location of the data and not the config directory, but for this configuration it should point to the config directory.</p>
<pre>MYSQL_BASE=/usr/mysql/5.0
MYSQL_USER=root
MYSQL_PASSWD=root
MYSQL_HOST=mysql-zone
FMUSER=fmuser
FMPASS=fmpass
MYSQL_SOCK=/tmp/mysql.sock
MYSQL_NIC_HOSTNAME="mysql-zone"
MYSQL_DATADIR=/etc/mysql/5.0</pre>
<p>Then run the registration script</p>
<pre>mysql-zone# /opt/SUNWscmys/util/mysql_register -f /etc/mysql_config
sourcing /etc/mysql_config and create a working copy under /opt/SUNWscmys/util/mysql_config.work
MySQL version 5 detected on 5.11/SC3.2
Check if the MySQL server is running and accepting connections
Add faulmonitor user (fmuser) with password (fmpass) with Process-,Select-, Reload- and Shutdown-privileges to user table for mysql database for host mysql-zone
Add SUPER privilege for fmuser@mysql-zone
Create test-database sc3_test_database
Grant all privileges to sc3_test_database for faultmonitor-user fmuser for host mysql-zone
Flush all privileges
Mysql configuration for HA is done</pre>
<p>Now shut down the database so it can be bought online by the cluster.</p>
<pre>mysql-zone# svcadm disable mysql:version_50</pre>
<p>Drop back to the global zone and copy the MySQL agent configuration template to /etc</p>
<pre>cxndoe1# cp /opt/SUNWscmys/util/ha_mysql_config /etc/ha_mysql_config</pre>
<p>Use these settings, this time the &#8216;DATADIR&#8217; should be set to point to the actual data location and not the location of the config. Descriptions of the configuration is given in the file:</p>
<pre>RS=mysql-server
RG=mysql-rg
PORT=3306
LH=mysql-addr
HAS_RS=mysql-stor
ZONE=mysql
ZONE_BT=mysql-zone
PROJECT=
BASEDIR=/usr/mysql/5.0
DATADIR=/data/mysql
MYSQLUSER=mysql
MYSQLHOST=mysql-zone
FMUSER=fmuser
FMPASS=fmpass
LOGDIR=/data/logs/
CHECK=NO</pre>
<p>Now register this with the cluster:</p>
<pre>cxnode1# /opt/SUNWscmys/util/ha_mysql_register -f /etc/ha_mysql_config
sourcing /etc/ha_mysql_config and create a working copy under /opt/SUNWscmys/util/ha_mysql_config.work
clean up the manifest / smf resource
sourcing /opt/SUNWscmys/util/ha_mysql_config
disabling the smf service svc:/application/sczone-agents:
removing the smf service svc:/application/sczone-agents:
removing the smf manifest /var/svc/manifest/application/sczone-agents/.xml
sourcing /tmp/ha_mysql_config.work
/var/svc/manifest/application/sczone-agents/mysql-server.xml successfully created
/var/svc/manifest/application/sczone-agents/mysql-server.xml successfully validated
/var/svc/manifest/application/sczone-agents/mysql-server.xml successfully imported
Manifest svc:/application/sczone-agents:mysql-server was created in zone mysql
Registering the zone smf resource
sourcing /opt/SUNWsczone/sczsmf/util/sczsmf_config
Registration of resource mysql-server succeeded.
Validation of resource mysql-server succeeded.
remove the working copy /opt/SUNWscmys/util/ha_mysql_config.work</pre>
<p>Before bringing this online a tweak is needed to the supplied agent scripts. As mentioned briefly above the use of &#8216;DATADIR&#8217; is a bit broken. If you try to bring MySQL online now it will fail as it won&#8217;t be able to find its configuration file. The agent scripts have this hard coded to <tt>${MYSQL_DATADIR}/my.cnf</tt> which is no use for our purposes.</p>
<p>In the zone edit /opt/SUNWscmys/bin/functions and make this replacement, ensure you edit the copy in the MySQL zone and not the one in the global zone.</p>
<pre>MYSQL_DEFAULT_FILE=${MYSQL_DATADIR}/my.cnf</pre>
<p>with</p>
<pre>MYSQL_DEFAULT_FILE=/etc/mysql/5.0/my.cnf</pre>
<p>The mysql-server can now be enabled.</p>
<pre>cxnode1# clresource enable mysql-server</pre>
<h2>Configuring Apache</h2>
<p>Apache is going to be used to provide a web front end to the MySQL install, via the ubiquitous phpMyAdmin. The supplied Apache install (at /usr/apache2/2.2) is going to be used. As Apahce will be running in a zone it can be used unmodified, keeping the configuration in /etc and not worrying about any potential conflicts with other Apache installs.</p>
<p>At present the supplied Apache resource type does not directly support running the resource in a zone, or at least I couldn&#8217;t figure it out. So instead some of the provided zone monitoring tools are going to be used to ensure Apache is up and running. This uses a combination of SMF and a shell script.</p>
<p>To begin Apache must be configured. Bring the zone online on one of the nodes and log in to it. The configuration file for Apache is at <tt>/etc/apache2/2.2/httpd.conf</tt>. Only a small tweak is required to move the document root onto the zfs file system we have prepared for it. You could, if desired, also move other parts of the configuration, such as the log location. For this example just change <tt>DocumentRoot</tt> to be <tt>/data/htdocs</tt> and update the <tt>Directory</tt> stanza a page or so below it. Then do a <tt>mkdir</tt> on <tt>/data/htdocs</tt>. That completes out very simple Apache configuration.</p>
<p>So start it up &#8217;svcadm enable apache22&#8242;. Download phpMyAdmin from <a href="http://www.phpmyadmin.net/home_page/downloads.php">here</a>. Solaris now ships with p7zip to manage 7z files, so you could download that version to save a bit of bandwidth if you like. You can extract them with <tt>pzip -d [filename]</tt>. Once extracted move the extracted directory to <tt>/data/htdocs/phpmyadmin</tt>.</p>
<p>Add <tt>mysql-zone</tt> to /etc/hosts eg</p>
<pre>192.168.0.118    apache-zone</pre>
<p>Modify config.inc.php setting these two values:</p>
<pre>$cfg['Servers'][$i]['host'] = 'mysql-zone';
$cfg['blowfish_secret'] = 'enter a random value here';</pre>
<p>To enable monitoring of the Apache instance we need a simple probe script. Make a directory <tt>/opt/probes</tt> in the zone and create a file called <tt>probe-apache.ksh</tt> with this content:</p>
<pre>#!/usr/bin/ksh
if echo "GET; exit" | mconnect -p 80 &gt; /dev/null 2&gt;&amp;1
then
exit 0
else
exit 100
fi</pre>
<p>Then <tt>chmod 755 /opt/probes/probe-apache.ksh</tt>. All this does is a simple connect on port 80, it could be replaced with something more complex if needed. Finally disable Apache so that the cluster can start it:</p>
<pre>apache-zone# svcadm disable apache22</pre>
<p>Drop back to the global zone and copy <tt>/opt/SUNWsczone/sczsmf/util/sczsmf_config</tt> to <tt>/etc/sczsmf_config.apache</tt> and set the following settings</p>
<pre>RS=apache-server
RG=apache-rg
SCZBT_RS=apache-zone
ZONE=apache
SERVICE=apache22
RECURSIVE=true
STATE=true
SERVICE_PROBE="/opt/probes/probe-apache.ksh"</pre>
<p> Now this can be registered with the cluster:</p>
<pre>cxnode1# /opt/SUNWsczone/sczsmf/util/sczsmf_register -f /etc/sczsmf_config.apache
sourcing /etc/sczsmf_config.apache
Registration of resource apache-server succeeded.
Validation of resource apache-server succeeded.</pre>
<p>Now enable Apache and check that it&#8217;s functioning correctly:</p>
<pre>clresource enable apache-server</pre>
<p>You can now browse to <tt>/phpmyadmin</tt> and check that everything it working!</p>
<h2>Conclusions</h2>
<p>When I started this work I wasn&#8217;t sure whether it was going to be possible or not, but despite a couple of bumps along the way I&#8217;m happy with the end result. Whilst it might not be a perfect match for a real cluster it certainly provides enough opportunity for testing and for use in training.</p>
]]></content:encoded>
			<wfw:commentRss>http://system-log.tyr.org.uk/2008/06/27/building-a-solaris-cluster-express-cluster-in-a-virtualbox-on-opensolaris/feed/</wfw:commentRss>
		</item>
		<item>
		<title>VMware Fusion 2.0 Beta</title>
		<link>http://system-log.tyr.org.uk/2008/05/06/vmware-fusion-20-beta-half-life-2/</link>
		<comments>http://system-log.tyr.org.uk/2008/05/06/vmware-fusion-20-beta-half-life-2/#comments</comments>
		<pubDate>Tue, 06 May 2008 22:34:17 +0000</pubDate>
		<dc:creator>tyr</dc:creator>
		
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://system-log.tyr.org.uk/?p=18</guid>
		<description><![CDATA[VMware Fusion 2.0 Beta is out. It&#8217;s a free upgrade for all current VMware Fusion users. Notable updates include Multiple Monitor support and Direct-X 9 Shader Model 2.
To give the Shader Model 2 a whirl I fired up Half Life 2. It had refused to run in any previous VMware Fusion release but this time it [...]]]></description>
			<content:encoded><![CDATA[<p><a title="VMware Fusion 2.0 Beta" href="http://communities.vmware.com/community/beta/fusion">VMware Fusion 2.0 Beta is out.</a> It&#8217;s a free upgrade for all current VMware Fusion users. Notable updates include Multiple Monitor support and Direct-X 9 Shader Model 2.</p>
<p>To give the Shader Model 2 a whirl I fired up Half Life 2. It had refused to run in any previous VMware Fusion release but this time it runs! Ok, it&#8217;s runs but it&#8217;s nowhere near playable as it&#8217;s getting about &lt;5 FPS. However it&#8217;s a promising development.</p>
<p><a href="http://system-log.tyr.org.uk/wp-content/uploads/2008/05/vmware-fusion-2-beta-half-life-2-train.png"><img class="alignnone size-medium wp-image-19" title="VMware Fusion 2 Beta - Half Life 2 Titles" src="http://system-log.tyr.org.uk/wp-content/uploads/2008/05/vmware-fusion-2-beta-half-life-2-train-300x254.png" alt="" width="300" height="254" /></a></p>
<p><a href="http://system-log.tyr.org.uk/wp-content/uploads/2008/05/vmware-fusion-2-beta-half-life-2-city-17.png"><img class="alignnone size-medium wp-image-20" title="VMware Fusion 2 Beta - Half Life 2 City 17" src="http://system-log.tyr.org.uk/wp-content/uploads/2008/05/vmware-fusion-2-beta-half-life-2-city-17-300x254.png" alt="" width="300" height="254" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://system-log.tyr.org.uk/2008/05/06/vmware-fusion-20-beta-half-life-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OpenSolaris 2008.05 on Mac Pro</title>
		<link>http://system-log.tyr.org.uk/2008/05/06/opensolaris-200805-on-mac-pro/</link>
		<comments>http://system-log.tyr.org.uk/2008/05/06/opensolaris-200805-on-mac-pro/#comments</comments>
		<pubDate>Tue, 06 May 2008 21:46:17 +0000</pubDate>
		<dc:creator>tyr</dc:creator>
		
		<category><![CDATA[Mac]]></category>

		<category><![CDATA[Solaris]]></category>

		<category><![CDATA[macpro]]></category>

		<category><![CDATA[opensolaris]]></category>

		<category><![CDATA[solairs]]></category>

		<guid isPermaLink="false">http://system-log.tyr.org.uk/?p=14</guid>
		<description><![CDATA[Recently I posted about installing Solaris Express on a Mac Pro. This morning OpenSolaris was released, the first release of what was Project Indiana. Prior to this release the outputs of the various OpenSolaris projects were available within Solaris Express, however now they have their own distribution which has several differences notably the use of [...]]]></description>
			<content:encoded><![CDATA[<p>Recently <a title="Solaris Express on Mac Pro" href="http://system-log.tyr.org.uk/2008/01/29/solaris-express-snv_78-on-mac-pro/">I posted</a> about installing Solaris Express on a Mac Pro. This morning <a title="OpenSolaris" href="http://www.opensolaris.com/">OpenSolaris</a> was released, the first release of what was Project Indiana. Prior to this release the outputs of the various OpenSolaris projects were available within Solaris Express, however now they have their own distribution which has several differences notably the use of a new packaging system called IPS (Image Packaging System).</p>
<p>I will look further into the workings of OpenSolaris in some future posts but for now I thought I&#8217;d take a quick look at how the install ran on a bare metal Mac Pro (2006 version).</p>
<p><span id="more-14"></span></p>
<p>OpenSolaris is distributed as a Live CD with an integrated installer to make a permanent install once you&#8217;ve had a chance to poke around and check things like hardware compatibility. You can download the CD from <a title="OpenSolaris download page" href="http://www.opensolaris.com/get/index.html">Sun</a> or from <a title="OpenSolaris mirror sites" href="http://blogs.sun.com/sch/entry/2008_05_more_ways_to">one of these mirrors</a>.</p>
<p>Previously I&#8217;d had some problems with Solaris Express not being able to create a suitable &#8216;fdisk&#8217; partition on the disk I was trying to install to. To see if this was still an issue I erased my existing Solaris Express drive and partitioned it with a standard OS X EFI/GUID partition table and a single HFS+ volume.</p>
<p>Because I&#8217;m rather paranoid about my data I powered down and removed my OS X drives from the machine before trying the OpenSolaris install. Then I booted up from the Live CD which loaded a standard GRUB menu, the banner indicated that this release is on a base of snv_86. I was prompted to pick a keyboard layout and a desktop language, then after a short while a fairly normal looking Gnome desktop poped up.</p>
<p><a href="http://system-log.tyr.org.uk/wp-content/uploads/2008/05/opensolaris-live-cd-desktop.png"><img class="alignnone size-medium wp-image-15" title="Open Solaris Live CD Desktop" src="http://system-log.tyr.org.uk/wp-content/uploads/2008/05/opensolaris-live-cd-desktop-300x225.png" alt="" width="300" height="225" /></a></p>
<p>An item on the desktop that caught my attention was the &#8216;Device Driver Utility&#8217;. This bought up a list all the detected devices in the system and whether an appropriate driver was found for them.<a href="http://system-log.tyr.org.uk/wp-content/uploads/2008/05/screenshot-device-driver-utility.png"><img class="alignnone size-medium wp-image-16" title="OpenSolaris Device Driver Utility" src="http://system-log.tyr.org.uk/wp-content/uploads/2008/05/screenshot-device-driver-utility-300x243.png" alt="" width="300" height="243" /></a></p>
<p>Most devices were detected fine with the following exceptions.</p>
<ul>
<li>Broadcom Corporation BCM4238 802.11/a/b/g/n</li>
<li>ACPI SMBus 1.0 Host Controller</li>
<li>Intel Corporation 6311ESB/6321ESB I/OxAPIC Interrupt Controller</li>
<li>Standard PC COM port - Driver Misconfigured</li>
</ul>
<p>From within the device driver tool there&#8217;s an option to submit the results to the central hardware compatibility list.</p>
<p>I have a dual monitor setup, connected to an ATI 1900XT graphics card. Whilst a full resolution display was shown on the larger monitor both monitors displayed the same image, with the lower resolution display showing the top-left section of the other monitor. The ATI card is showing as using the &#8216;vgatext&#8217; driver which is, presumably, some generic video driver. Unfortunately ATI do not make Solaris drivers for their cards, one reason why I&#8217;m thinking about moving to the 8800GT card that is now available. </p>
<p>Since the LiveCD booted ok it seems fairly likely that a full install should work, providing the disks could be detected properly. The &#8216;Install OpenSolaris&#8217; app is a bright, unmissable icon on the desktop. Picking it bought up with installer which after the initial welcome page displayed the disk chooser.</p>
<p><a href="http://system-log.tyr.org.uk/wp-content/uploads/2008/05/screenshot-opensolaris-200805-installer.png"><img class="alignnone size-medium wp-image-17" title="OpenSolaris 2008.05 Installer Disk Chooser" src="http://system-log.tyr.org.uk/wp-content/uploads/2008/05/screenshot-opensolaris-200805-installer-300x240.png" alt="" width="300" height="240" /></a></p>
<p>The disk was displayed correctly, I picked the option to use the whole disk. Then I went through simple time zone and locale options followed by a screen to set a non-root user and some passwords. That was it for the installer, it really couldn&#8217;t have been any more simple</p>
<p>The install ran for about 20 minutes and completed without error. After it completed I rebooted the machine and it rebooted into a GRUB menu with &#8216;OpenSolaris 2008.05 snv_86_rc3 X86&#8242; as the default, and only, option. This booted fine to a GNOME login prompt.</p>
<p>I&#8217;ll poke around in OpenSolaris more over the coming weeks and will hopefully post some further thoughts here.</p>
]]></content:encoded>
			<wfw:commentRss>http://system-log.tyr.org.uk/2008/05/06/opensolaris-200805-on-mac-pro/feed/</wfw:commentRss>
		</item>
		<item>
		<title>National Express WiFi is satellite based?</title>
		<link>http://system-log.tyr.org.uk/2008/04/15/national-express-wifi-is-satellite-based/</link>
		<comments>http://system-log.tyr.org.uk/2008/04/15/national-express-wifi-is-satellite-based/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 19:54:17 +0000</pubDate>
		<dc:creator>tyr</dc:creator>
		
		<category><![CDATA[Transport]]></category>

		<guid isPermaLink="false">http://system-log.tyr.org.uk/?p=13</guid>
		<description><![CDATA[I&#8217;m on the train! Finally WiFi is free in standard class on the east coast mainline. So that&#8217;s at least one thing National Express have done right so far.
I&#8217;d always assumed that the train WiFi was supported by a 3G network, or something similar. However my outbound IP address is 217.28.34.132 which a whois indicates [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m on the train! Finally WiFi is free in standard class on the east coast mainline. So that&#8217;s at least one thing National Express have done right so far.</p>
<p>I&#8217;d always assumed that the train WiFi was supported by a 3G network, or something similar. However my outbound IP address is 217.28.34.132 which a whois indicates belongs to<br />
<code><br />
inetnum:        217.28.32.0 - 217.28.35.15<br />
netname:        NSAB-NET<br />
descr:          NSAB backbone and address-pools for VPN Services<br />
##########################<br />
In case of improper use, please contact:<br />
&lt;abuse@nsab.se&gt;<br />
##########################<br />
</code></p>
<p>nsab.se redirects to <a title="SES SIRIUS Front Page" href="http://www.ses-sirius.com/english/">SES SIRIUS AB</a> which is a satellite broadband provider. Well there you go.</p>
<p>Now if only the train was on time&#8230;</p>
<p>P.S. Google comes up in Swedish <img src='http://system-log.tyr.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://system-log.tyr.org.uk/2008/04/15/national-express-wifi-is-satellite-based/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WikiVitals: Unofficial Wikipedia Statistics</title>
		<link>http://system-log.tyr.org.uk/2008/04/03/wikivitals-unofficial-wikipedia-statistics/</link>
		<comments>http://system-log.tyr.org.uk/2008/04/03/wikivitals-unofficial-wikipedia-statistics/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 11:14:58 +0000</pubDate>
		<dc:creator>tyr</dc:creator>
		
		<category><![CDATA[Wikipedia]]></category>

		<guid isPermaLink="false">http://system-log.tyr.org.uk/?p=10</guid>
		<description><![CDATA[In the March 8th edition of The Economist this article appeared about Wikipedia. This section piqued my interest
Mr Lih and other inclusionists worry that [the current Wikipedia administration and bureaucracy] deters people from contributing to Wikipedia, and that the welcoming environment of Wikipedia&#8217;s early days is giving way to hostility and infighting. There is already [...]]]></description>
			<content:encoded><![CDATA[<p>In the March 8th edition of The Economist <a title="The Economist: The battle for Wikipedia's soul" href="http://www.economist.com/search/displaystory.cfm?story_id=10789354&amp;CFID=444770&amp;CFTOKEN=89121701">this article</a> appeared about Wikipedia. This section piqued my interest</p>
<blockquote><p>Mr Lih and other inclusionists worry that [the current Wikipedia administration and bureaucracy] deters people from contributing to Wikipedia, and that the welcoming environment of Wikipedia&#8217;s early days is giving way to hostility and infighting. There is already some evidence that the growth rate of Wikipedia&#8217;s article-base is slowing. Unofficial data from October 2007 suggests that users&#8217; activity on the site is falling, when measured by the number of times an article is edited and the number of edits per month. The official figures have not been gathered and made public for almost a year, perhaps because they reveal some unpleasant truths about Wikipedia&#8217;s health.</p></blockquote>
<p>I thought &#8216;perhaps because they reveal some unpleasant truths about Wikipedia&#8217;s health&#8217; was a possibly a bit strong, especially against the lack of any properly referenced statistics. Whilst the official statistics might not be regularly updated at the moment a full export of the Wikipedia is still available at regular intervals. As such it&#8217;s possible, given a bit of work parsing the data, to generate some unofficial statistics. So that&#8217;s what I set out to do.</p>
<p>The results are at <a title="WikiVitals: Unofficial Wikipedia Stats" href="http://wikivitals.newswall.org.uk">wikivitals.newswall.org.uk</a>, or read on for more information about how they were created.</p>
<p><span id="more-10"></span></p>
<p>The official stats for the various Wikipedia statistics can be found <a title="Wikimedia Wikipedia Stats." href="http://stats.wikimedia.org/EN/Sitemap.htm">here</a>, as you can see most editions are updated regularly, it&#8217;s mainly the English edition that is falling behind.  It&#8217;s perhaps not surprising if you consider the size that the English Wikipedia has grown to. If the compression ratios given on the downloads site are accurate then a fully uncompressed version of the XML export of the English edition is going to consume about 1.5TB of space.</p>
<p>Fortunately for us a 7-zip version (along size a bzip2 version) is made available for download which makes working with the data much more feasible. Dumps of the database are provided at regular intervals however it takes almost a month for a full export of the English Wikipedia to be generated. At the time of writing the most recent complete export is the March export which you can find <a title="March 2008 English Wikipedia Export" href="http://download.wikimedia.org/enwiki/20080312/">here</a>.</p>
<p>There are two dumps that can be used to produce the kind of statistical reports I was looking to do. &#8216;pages-meta-history.xml&#8217; and &#8217;stub-meta-history.xml&#8217;. I initially started working with the pages-meta-history which contains a full dump of every page, as you can imagine this makes working with the data rather slow and to perform an initial parse of the data was taking about 8 hours.</p>
<p>The stub-meta-history alternative provides all the revision history of the articles but not the actual article contents, increasing processing speed by about 10 times. However this has the obvious side effect that no decisions can be made about the article contents. Officially Wikipedia only counts articles that contain at least one internal link toward the article count, as we&#8217;re only looking at stubs this distinction isn&#8217;t made. Notably this means that redirects are not distinguished from full articles which increases the total page count dramatically, although, one would hope, proportionately.</p>
<p>To ease the development of the parsing scripts I used the data exports for the <a title="Simple English Wikipedia" href="http://simple.wikipedia.org/wiki/Main_Page">Simple English Wikipedia</a> until I was happy that everything was working as expected. These have the advantage of being much smaller but still being in English. I&#8217;d highly recommend starting with these if you&#8217;re interesting in taking a look at how the data export processes work, they&#8217;re much easier to work with.</p>
<p>The first step of getting the data into a workable format was to parse the data into individual month &#8216;buckets&#8217;. The idea being that all revisions taking place in a specific month are added to that months &#8216;bucket&#8217;. This means that when it comes to generating statistics the generator only has to concern itself with the current &#8216;bucket&#8217; (and potentially any retained information from previous months), rather than having to parse the whole article space each time.</p>
<p>The spec for the XML export can be found <a title="Wikipedia XML Export Schema" href="http://www.mediawiki.org/xml/export-0.3.xsd">here</a>. Initially I wrote a parser using XML::Parser, whilst this has the advantage of robustness due to being a fully fledged XML parser it has the disadvantage of being rather slow, to perform a full parse of the English Wikipedia with XML::Parser would probably take a good few weeks. After ditching that plan I replaced it with a simple line parser. Fortunately the XML data provided is laid out consistently making a line parser straightforward.</p>
<p>When parsing the articles into the monthly &#8216;buckets&#8217; a further division is made into those articles in the main namespace and those that aren&#8217;t. Whilst interesting stats could no doubt be generated from the pages located outside the main namespace they are not processed any further at the moment. The namespaces excluded include:</p>
<ul>
<li>Talk</li>
<li>User &amp; User talk</li>
<li>Wikipedia &amp; Wikipedia talk (used for discussion of Wikipedia policy)</li>
<li>Category &amp; Category talk</li>
<li>Template &amp; Template talk</li>
<li>Image &amp; Image talk</li>
<li>List &amp; List talk</li>
<li>Help &amp; Help talk</li>
<li>MediaWiki &amp; MediaWiki talk</li>
</ul>
<p>Once the data had been split into the monthly &#8216;buckets&#8217; it was straightforward to run some simple reports against it. Currently reports are generated for:</p>
<ul>
<li>The total number of articles at the end of the month</li>
<li>The number of new articles each month</li>
<li>The total number of edits each month</li>
<li>The average number of edits made per article each month</li>
<li>The number of articles receiving at least one edit per month</li>
<li>The total number of Wikipedians making 10 or more edits since they joined</li>
<li>The number of new Wikipedians making their 10th edit each month</li>
<li>The number of Wikipedians making at least one edit in the month</li>
<li>The number of Wikipedians making at least five edits in the month</li>
<li>The number of Wikipedians making 100 or more edits in the month</li>
</ul>
<p>When talking about &#8216;Wikipedians&#8217; we&#8217;re only concerning ourselves with logged in users. Edits made anonymously are not tracked for those reports, however they are included in the total edit counts.</p>
<p>As mentioned above as we&#8217;re using the stubs to generate the stats, as such the total article acount is much higher than the official count.</p>
<p>Some extra reports I&#8217;d like to generate when I have some spare time include:</p>
<ul>
<li>Percentage of edits coming from each decile of active Wikipedians</li>
<li>Number of deleted articles, this information coming from the logging.sql export.</li>
<li>Average number of edits per article</li>
<li>InactiveWikipedians, i.e. the number of Wikipedians who have contributed more than, say 100, edits who haven&#8217;t contributed for 6 months or so.</li>
<li>Please comment if there&#8217;s anything else you&#8217;d like to see&#8230;</li>
</ul>
<p>Once the data was analysed I used <a title="GD::Graph" href="http://search.cpan.org/~bwarfield/GDGraph-1.44/Graph.pm">GD::Graph</a> to produce the graphs. Whilst this is nice and easy to use it doesn&#8217;t generate the most attractive graphs in the world. I came across the <a title="Google Chart API" href="http://code.google.com/apis/chart/">Google Chart API</a> the other day which looks like a nice easy way to generate charts with simple HTTP requests. If nothing else they look a bit prettier that the GD::Graph graphs so I may rewrite with that.</p>
<p>As mentioned the graphs can be found at <a title="WikiVitals: Unofficial Wikipedia Statistics" href="http://wikivitals.newswall.org.uk/">wikivitals.newswall.org.uk</a>they clearly show that the period around March, April 2007 was a particularly popular time for Wikipedia editing, showing a large number of edits from a large number of Wikipedians. Since then it&#8217;s been a gentle decline  in the number of contributing users until the end of 2007 and then showing some increase in 2008.  The total number of article edits has yet to hit their spring 2007 peak again. Whether this is cause for concern or just a sign of a maturing Wikipedia remains to be seen. It will be interesting to continue to track these statistics over the next year or so.</p>
]]></content:encoded>
			<wfw:commentRss>http://system-log.tyr.org.uk/2008/04/03/wikivitals-unofficial-wikipedia-statistics/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Going the fast way down at Arcalis</title>
		<link>http://system-log.tyr.org.uk/2008/03/25/going-the-fast-way-down-at-arcalis/</link>
		<comments>http://system-log.tyr.org.uk/2008/03/25/going-the-fast-way-down-at-arcalis/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 21:56:00 +0000</pubDate>
		<dc:creator>tyr</dc:creator>
		
		<category><![CDATA[Holidays]]></category>

		<category><![CDATA[andora]]></category>

		<category><![CDATA[arcalis]]></category>

		<category><![CDATA[skiing]]></category>

		<guid isPermaLink="false">http://system-log.tyr.org.uk/2008/03/25/going-the-fast-way-down-at-arcalis/</guid>
		<description><![CDATA[Perhaps not the most successful turn of the holiday

]]></description>
			<content:encoded><![CDATA[<p>Perhaps not the most successful turn of the holiday</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="373" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="wmode" value="transparent" /><param name="src" value="http://www.youtube.com/v/gao-5VjmY_g&amp;rel=0&amp;color1=0x006699&amp;color2=0x54abd6&amp;border=1&amp;hl=en" /><embed type="application/x-shockwave-flash" width="425" height="373" src="http://www.youtube.com/v/gao-5VjmY_g&amp;rel=0&amp;color1=0x006699&amp;color2=0x54abd6&amp;border=1&amp;hl=en" wmode="transparent"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://system-log.tyr.org.uk/2008/03/25/going-the-fast-way-down-at-arcalis/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What Facebook Applications Know About You</title>
		<link>http://system-log.tyr.org.uk/2008/03/20/what-facebook-applications-know-about-you/</link>
		<comments>http://system-log.tyr.org.uk/2008/03/20/what-facebook-applications-know-about-you/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 10:18:48 +0000</pubDate>
		<dc:creator>tyr</dc:creator>
		
		<category><![CDATA[Facebook]]></category>

		<guid isPermaLink="false">http://system-log.tyr.org.uk/2008/03/20/what-facebook-applications-know-about-you/</guid>
		<description><![CDATA[For me one of the most interesting aspects of the modern internet (Web 2.0, if you like) is the high availability and feature depth of APIs that websites make available to enable integration into a variety of systems. These range across the whole spectrum of websites from flickr to BetFair.
One API that has particularly taken [...]]]></description>
			<content:encoded><![CDATA[<p>For me one of the most interesting aspects of the modern internet (Web 2.0, if you like) is the high availability and feature depth of APIs that websites make available to enable integration into a variety of systems. These range across the whole spectrum of websites from flickr to BetFair.</p>
<p>One API that has particularly taken my interest of late is the <a title="Facebook Developers Site" href="http://developers.facebook.com/">Facebook Developers API</a>, this is the API used to build all Facebook applications. What is particularly interesting, and perhaps surprising, about this API is the amount of personal information that is made available about Facebook users.</p>
<p>In order to increase awareness of the information that Facebook makes available about you and your friends to every applicaiton you install I created a &#8216;What Applications Know About You&#8217; application. Read on for more details.</p>
<p><span id="more-8"></span></p>
<p>Facebook makes no secret about the information that it makes available to applications. The full documentation is available <a title="Facebook API Documentation" href="http://developers.facebook.com/documentation.php">here</a>. However neither do they go out of their way to let users view exactly what information they&#8217;re making available.</p>
<p>Information that Facebook applications have access to includes:</p>
<ul>
<li>Your Profile</li>
<li>Your Friends and their profiles</li>
<li>Your Events</li>
<li>Your Groups</li>
<li>Your Markeplace Posts</li>
<li>Photos of you</li>
<li>Photos you have uploaded</li>
</ul>
<p>Significantly, and fortunately, applications do NOT have access to any of your contact information. Also if you set your birthday to &#8216;only me&#8217; then it is excluded from application visibility.</p>
<p>Two things surprised me when I was looking into the API</p>
<ul>
<li>If you set your profile visibility to &#8216;Only My Friends&#8217; applications can still see your profile.</li>
<li>Applications <em>your friends</em> install also have access to your profile.</li>
</ul>
<p>Applications installed by one of your friends are referred to as &#8216;Other Applications&#8217;. Privacy settings <a title="Other Application Privacy Settings" href="http://www.facebook.com/privacy/?view=platform&amp;tab=other">are available</a> to control the level of access you give to your data to these &#8216;Other Applications&#8217; but by default the settings are fairly wide, including your education and work histories, photos of you etc. If you have installed any applications then you <em>must</em> share your name, networks and list of friends to <em>any</em> applications your friends install. To select &#8216;do not share any information&#8217; you must remove <em>all</em> applications from your profile.</p>
<p>What&#8217;s particulary interesting is that in this kind of social network an application doesn&#8217;t really have to achieve a  massive penetration before if can build up access to a significant subset of Facebook member profiles if so inclined. For applicaitons with a large install base such as Fun Wall or Super Poke everyone must have at least one friend with one of these applications installed.</p>
<p>Whilst the Facebook developers <a title="Facebook developers terms of service" href="http://www.facebook.com/developers/tos.php">Terms of Service</a> includes the statement; &#8220;You can only cache user information for up to 24 hours to assist with performance.&#8221;, they have no method to enforce this other than relying on the honesty of the developers themselves. As all third party applications are hosted externally from Facebook they do not have access to audit how personal data is used one it leaves their network.</p>
<p>If you&#8217;re interested in seeing what information you&#8217;re exposing to third parties when you install their applications then I&#8217;ve put together an application that reflects this information back to you. <a title="What Applications Know About You" href="http://www.facebook.com/apps/application.php?id=8497458121">What Applications Know About You</a> is a simple application that displays a significant subset of the data that applcations have access to.  Whilst you have to login or add the application to use it no information is retained about you, not even the fact that you have it installed. All the information you see is dynamically generated when you request the page. The application contains no adverts and does not generate any money, it&#8217;s just there for informational purposes.</p>
<p>If you&#8217;ve got any comments on it then post here or on the applications <a title="What Applications Know About You" href="http://www.facebook.com/apps/application.php?id=8497458121">about</a> page.</p>
<p>-Comments now closed due to too much spam, particularly for this post. Please post any comments on the applications about page.</p>
]]></content:encoded>
			<wfw:commentRss>http://system-log.tyr.org.uk/2008/03/20/what-facebook-applications-know-about-you/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Solaris Express Live Upgrade (Part 2)</title>
		<link>http://system-log.tyr.org.uk/2008/03/03/solaris-express-live-upgrade-part-2/</link>
		<comments>http://system-log.tyr.org.uk/2008/03/03/solaris-express-live-upgrade-part-2/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 22:46:46 +0000</pubDate>
		<dc:creator>tyr</dc:creator>
		
		<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://system-log.tyr.org.uk/2008/03/03/solaris-express-live-upgrade-part-2/</guid>
		<description><![CDATA[A while ago I showed how I upgraded my Solaris Express system using Live Upgrade. Now it&#8217;s time to upgrade again. This time we do it a bit differently as a boot environment for the upgrade is already available. Read on for the full story.
First a recap of the current boot environments
bash-3.2# lustatus
Boot Environment  [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago <a href="http://system-log.tyr.org.uk/2008/02/05/solaris-express-live-upgrade/" title="Solaris Express Live Upgrade">I showed</a> how I upgraded my Solaris Express system using Live Upgrade. Now it&#8217;s time to upgrade again. This time we do it a bit differently as a boot environment for the upgrade is already available. Read on for the full story.</p>
<p><span id="more-7"></span>First a recap of the current boot environments</p>
<pre>bash-3.2# lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
snv_78                     yes      no     no        yes    -
snv_81                     yes      yes    yes       no     -</pre>
<p>What we want to do is move to a system running snv_83.  To do this we&#8217;ll update the unused snv_78 environment.</p>
<p>To do this we need to get familiar with lurename and lumake.</p>
<p>First off lets rename the BE so we know what&#8217;s what.</p>
<pre>bash-3.2# lurename -e snv_78 -n snv_83
Renaming boot environment (snv_78) to (snv_83).
Changing the name of BE in the BE definition file.
Changing the name of BE in configuration file.
Updating compare databases on boot environment (snv_83).
Changing the name of BE in Internal Configuration Files.
Propagating the boot environment name change to all BEs.
Boot environment (snv_78) renamed to (snv_83).</pre>
<p>Now update this BE to bring it in sync with our current environment.</p>
<pre>bash-3.2# lumake -n snv_83 -s snv_81

Creating configuration for boot environment (snv_83).
Source boot environment is (snv_81).
Determining the split file systems of (/).
Determining the merge point of (/).
Determining the size and inode count for the split filesystem of (/).
Creating boot environment (snv_83).
Checking for GRUB menu on boot environment (snv_83).
Saving GRUB menu on boot environment (snv_83).
Creating file systems on boot environment (snv_83).
Creating (ufs) file system for (/) in zone (global) on (/dev/dsk/c2d0s0).
Mounting file systems for boot environment (snv_83).
Calculating required sizes of file systems for boot environment (snv_83).
Populating file systems on boot environment (snv_83).
Checking selection integrity.
Integrity check OK.
Populating contents of mount point (/).
Copying.
--- go for lunch ---
Creating shared file system mount points.
Creating compare databases for boot environment (snv_83).
Creating compare database for file system (/).
Updating compare databases on boot environment (snv_83).
Making boot environment (snv_83) bootable.
Updating bootenv.rc on ABE (snv_83).
Restoring GRUB menu.
The GRUB menu has been restored on device (/dev/dsk/c2d0s0).
Updating GRUB menu default setting
Population of boot environment (snv_83) successful.</pre>
<p>Now it can just be upgraded as before (with mounted media obviously)</p>
<pre>
bash-3.2# luupgrade -u -n snv_83 -s /mnt

bash-3.2# luactivate snv_83</pre>
]]></content:encoded>
			<wfw:commentRss>http://system-log.tyr.org.uk/2008/03/03/solaris-express-live-upgrade-part-2/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
