Mar 22

The future of scalable, distributed computing is in the cloud. This is a nebulous concept that’s supposed to describe a cloud’s perpetual elasticity in providing online storage, processing and bandwidth. There are user-facing cloud services such as Google’s web-based applications, the Ulteo online desktop and Canonical’s One service for silently cross-computer folder synchronicity. And there are the more ambitious services of Amazon’s EC2 platform, enabling websites like Facebook to expand and contract their resource requirements in realtime, catering for peaks and troughs in demand and only paying for the capacity and the CPU cycles it actually uses.

Tux: the ideal combination of experienced mountain climber and feathered networking expert.

This latter kind of cloud is a big enterprise oriented subject, and Facebook-like scenarios are way off the scale when it comes to the ordinary Linux user. But Linux is at the heart of many of these installations, and there’s plenty of enterprise cloud technology left lying around for us mortals to play with. Incredibly, considering it’s user-friendly approach to Linux, that includes the latest release of Ubuntu.

Ubuntu 9.10 bundles something called ‘Eucalyptus’, an open source tool for generating private clouds that can dynamically connect to Amazon EC2. Eucalyptus, an acronym for ‘Elastic Utility Computing Architecture Linking Your Programs To Useful Systems’, originated as an ambitious project run by the Computer Science Department at the University of California. But it quickly became apparent that the technology it was developing was in great demand, and professor Rich Wolski, as well as many of his students took sabbatical leave from their day jobs and founded Eucalyptus. So far, they haven’t gone back.

STEP 1: Getting Started

Before trying Eucalyptus for yourself, there are some demanding requirements. Installation is relatively straightforward, but you will need to use the Linux command line, and possibly, troubleshoot any problems by reading the log files.

You will need at least two machines. One for front-end management and another to act as a single nodes on the cluster. Clouds like these rely on virtualisation to provide the elasticity and software scaleability of the hardware doing the processing. They run virtualised instances, called images, of your chosen operating system. In the case of Eucalyptus, virtualisation is handled by either KVM or Xen at the kernel level, which is why you need a VT-enabled CPU for the node machines, along with plenty of horsepower, memory and storage. It also means that you will need to configure your cloud to do something useful after you’ve got it working, just as you would a standard Ubuntu server installation.

You’ll be given the option of installing a new cluster or adding a node to an existing one.

The machine used to control and manage your cloud is usually referred to as the backend, and to get started you need to insert the Ubuntu 9.10 Server into its drive and reboot. When you see the boot menu, select a language followed by ‘Install Ubuntu Enterprise Cloud’. Choose language, location and keyboard layout, then enter a host name, we used ubuntu1. The next step will ask whether you want to create a ‘Cluster’ or a ‘Node’, and you need to select the first option, ‘Cluster’.

You will then need to work through the standard Ubuntu partition options. Ideally, use the entire disk for the installation unless you need to keep data on the machine, and leave the most options at their default values. The installer will then go off and create the partitions it needs then download and install a few packages. After this, it will ask for the default username and password for the machine, and whether you need your home directory encrypting. Skip the HTTP proxy question and leave the automatic updates off for now, and set Postfix to ‘No Configuration’.

STEP 2: Network and Nodes

We now have a couple of questions that deal specifically with the Eucalyptus configuration. The first asks for a cluster name, and you can call it what you like. This is the name people will see if they access your cloud. The second question asks for a range of IP addresses on your LAN that Eucalyptus can safely use to assign to each node. To answer this, you need to know the range of addresses that your router is using.

Many routers on a home network, for example, will issue IP addresses in the range of 192.168.1.2 – 192.168.1.100, or similar. You need to find this information from your router and enter a range that isn’t going to be assigned automatically from the router but is on the same domain. ‘192.168.1.100-192.168.1.200’ would work with our previous example. But for the sake of our experiment, you only need to find a couple of spare addresses on the same domain.

It’s best to assign a range of currently-free IP addresses to make up your cluster. It saves a lot of hassle later on.

After entering these details, the remainder of the packages will be installed and you’ll be asked to reboot the machine without the disc in the drive. When the backend reboots, login to your account. You should see the IP address for the server displayed and the message about documentation, and you need to make sure this address in within your network’s range.

It’s now time to tackle the node. Take the same disc you used for the backend and use it to boot your node machine. Choose ‘Install Ubuntu Enterprise Cloud’ from the boot menu again, and go through the first few questions. After entering a new hostname, you should be told that there’s already a Eucalyptus cluster controller on your network, and ‘Node’ will be selected automatically. Just press return. Installation will now be identical to the earlier install, only without any further Eucalyptus questions. Even your user name and password are grabbed from the backend machine, and at the end of the process, you can reboot and the node is now running.

STEP 3: Configuration

On each machine, you should login and type ‘apt-get upgrade’ to download and install the latest package updates for the system. You’ll probably have to reboot each machine again.

We now need to tell the backend about the existence of our single node. Login to the backend machine, and type ‘sudo euca_conf –no-rsync –discover-nodes’. You should see something like the following:

New node found on 192.168.1.62; add it? [Yn]

Just press return, and you should see that the two machines connect and synchronise a pair of keys that will be used to authenticate future connections. Now launch a browser from any other machine on the LAN and go to ‘https://backend_ip:8443’. You will get a security warning about the unverified nature of the certificate used for the connection, but you’ll need to add an exception for this site. Firefox will step you through this process automatically.

You should run the configuration tool as a super user.

You will then see the ‘Eucalyptus Enterprise Cloud’ login screen. Enter ‘admin’ for username and the password, and you’ll be immediately asked to enter a new administrator password, and check the IP address of the server so that a new certificate can be generated. After clicking submit, you’ll find yourself at the Eucalyptus management console, but before we can get stuck into the details, we need to download something called a credentials file, that we can use to authenticate our own tinkering with the server, as well as any other cloud service you may want to use to expand your installed.

STEP 4: Credentials

Click on the Credentials tab followed by the ‘Download Credentials’ button. This will leave you with a zip file that you will need to transfer to your user account on the backend machine. The easiest way is from the command line, using ‘sftp backend_ip’ to connect to the machine, followed by the command ‘put’ with by the path to the zip file, ‘put euca2-admin-x509.zip’ for instance. On the backend, you then need to unzip the file into a hidden folder in your home directory with ‘unzip -d ~/.euca euca2-admin-x509.zip’ and run the script it contains that configures various environmental variables and keys for managing the cloud, ‘. ~/.euca/eucarc’. This script will need to be run whenever you re-connect to your backend system.

Once it’s properly installed, Eucalyptus’ web interface looks after much of the heavy lifting.

To check that everything is working as it should be, type ‘euca-describe-availability-zones verbose’. The output should look like the following:

AVAILABILITYZONE pcp_cloud 192.168.1.48
AVAILABILITYZONE |- vm types free / max cpu ram disk
AVAILABILITYZONE |- m1.small 0002 / 0002 1 128 2
AVAILABILITYZONE |- c1.medium 0002 / 0002 1 256 5

This is important information. The critical data is beneath the free/max columns. This shows the CPU cores available on your cloud for immediate use. The more nodes you have on the network, the higher the number here. If you see only zeros, then there has been a problem with the node starting the appropriate controller, and you’ll need to check its /var/log/eucalyptus’ directory for the log files.

STEP 5: Run an image

It’s now time to create a virtual instance of a machine to run on our node. Eucalyptus makes this very easy because it allows you to download pre-built packages.

Go back to the browser and click on the ‘Store’ tab in the management console and choose a pre-built image to download. We opted for Karmic Koala (i386), which is a 174MB download. You will also have to wait a couple of minutes for the image to be installed after the download has completed, but before long you should see the message ‘How to run?’, and you’re ready to go. We did have problems with our backend machine hanging at this point, but we added more memory to the system and it worked though a hitch.

You’re provided with a selection of pre-configured virtual machines just begging to be run on your new cloud.

Before we go back to the command line, click on the ‘How to run’ link next to the download, and make a note of the ‘emi’ value at the end of the command. This is the unique identifier for the image, and we’ll need to use this when we run it. Back on the command line, type ‘touch ~/.euca/mykey.priv; chmod 0600 ~/.euca/mykey.priv; euca-add-keypair mykey > ~/.euca/mykey.priv’ to create a key pair to authenticate the connection to your running image. Then type ‘euca-describe-groups’ followed by ‘euca-authorize default -P tcp -p 22 -s 0.0.0.0/0’ to enable SSH access to the virtualised machine, and finally, type the following to launch it:

euca-run-instances -k mykey -t c1.medium emi

Replace the emi value with the identifier you took from the web interface. You should also notice that we’ve specified ‘c1.medium’ as the type of image, and this is a preset for the amount of resources the image is given. These can be viewed and modified using the Configuration page of the web management interface. It may take a while to initialise as there’s a lot of data being copied across the network, but you can check it’s status with the ‘euca-describe-instances’ command, and wait for it’s state to switch to ‘running’ rather than ‘pending’. On our hardware, this took about 20 minutes.

You’ll also see the IP address of the new instance, and you can now connect to your new cloud server by typing ‘ssh -i ~/.euca/mykey.priv ubuntu@ip_address’. You’re now ready to install and run your mind-blowing web 2.0 application!

See also: Amazon EC2

Private clouds, of the kind we’ve started to build above, are an excellent raw resource if you need a dynamic pool of processing power. But the beauty of cloud computing is that it’s designed to be elastic, and this means you needn’t be restricted by the physical limitations of your own setup. With Eucalyptus, for example, you can take exactly the same images you’re running on your local machines, and move them to Amazon’s EC2 service as and when you need the extra horsepower.

This gives you relatively unlimited resources in terms of processing power, storage and network bandwidth, and you only have to pay for what you need, rather than the old model of paying for a rack of servers somewhere that spend most of their time idle. Eucalyptus manages this by building an API that’s compatible with Amazon’s, making the images that you configure on your local network drop-in compatible with the images that run on Amazon’s servers. Also, the tools that you use to manage and maintain your private cloud are the same you use to manage an Amazon-hosted cloud, making the transition between the two almost seamless.

There are other advantages to this compatibility too. You can create, test and experiment with private clouds before committing your concept to the costs and scrutiny of a public cloud running on Amazon’s servers. And private clouds, such as the one we create in the main text, can give you an excellent feel for how the technology works, and how you and your company may find it useful.

Troubleshooting

As you might have noticed, despite the Ubuntu installation being the easiest way of getting a usable cloud system, it’s still far from easy. There are a lot of aspect to the configuration that can go wrong, from the hardware that you choose, to the network that the various machines are communicating across. Another problem is that the Eucalyptus project is only in its infancy, with Ubuntu 9.10 being the first distribution to include packages by default. This means there isn’t a great deal of support, especially if you’re new to the world of clouds.

But there are several things you can do to help solve problems yourself. Firstly, you should run ‘euca-describe-availability-zones verbose’ to check whether your node machine has been detected and added to the cloud. If you have zero resources available, then it hasn’t. The most common cause for this problem is that the synchronisation of the keys from the backend to the node has failed, stopping the node from registering itself. Check ‘/var/lib/eucalyptus/keys’ on both machines to make sure the keys are available. If the keys on the backend are missing, trying running ‘/etc/init.d/eucalyptus-cc-registration restart’ to regenerate the keys, then then try to add the node again using ‘euca_conf –no-rsync –discover-nodes’. If all else fails, try ‘sudo /etc/init.d/eucalyptus-sc-registration restart’ too.

We also had problems trying to register nodes after updating the system with new packages. The solution to this problem is to either add nodes to the cluster before you update any packages, or leave your installation with the packages include with the default install. This shouldn’t matter for an experimental installation. Finally, if all else fails, trawl through files within the /var/log/eucalyptus directory on both machines, as this should give you some idea of where your setup may be failing.

Sep 05

PHP is not limited to creating just HTML output. It can also be used to create and manipulate image files in a variety of different image formats, including GIF, PNG, JPEG, WBMP, and XPM. Even more convenient, PHP can output image streams directly to a browser. You need to install GD Library for this purpose. Simply you can do this.
If you have a LAMP (PHP. APACHE and Mysql) Installation in your System , you can install GD library using the following .

in Ubuntu /Debian Install the package

$ sudo apt-get install php5-gd ( or use synaptic for installing this package )

Now Restart Your apache

$sudo /etc/init.d/apache2 restart

Feb 26

Writen by David Haysom

Data, or information stored on your computer, can either be held on fixed disk drives inside the computer or on removable media such as CD’s that can be inserted and removed. Removable media can be used to transfer files between computers or to backup the data already existing on fixed disk drives. There are three types of removable media: Magnetic, Optical and Flash.

Magnetic Storage Magnetic Storage: Hard disks, floppy disks and digital audiotape are examples of Magnetic storage. They operate through a read/write head, which creates and reads magnetic impressions on the disk.

The downside…

  • The magnetic impression only lasts for around five years
  • The capacity of most removable magnetic disks is too low for many types of files

Optical storage Optical Storage holds information in digital form that is written and read by a laser. All CD and DVD devices are examples of this.

The upside…

  • Increased capacity: one Optical disc can store the same amount of data as over 500 diskettes
  • Durability: they last up to seven times as long as Magnetic forms of storage

Flash Memory (Solid-State Removable Storage) Solid-state memory (or Flash memory) is a high-performance plug-and-play storage device that contains no moving parts. It is found in digital cameras, video game consoles and digital audio players. You can use it in the form of USB Flash Drives to transfer or backup data. Flash memory is small, light and fast.

Backup Backup is the copying of files onto portable media so that if your computer crashes, data won’t be lost in oblivion. Backup is usually routine in large businesses but is often neglected by individual users. Some suggest backing up data files and duplicating your hard drive weekly. It takes around 45 minutes to backup a 500-megabyte hard disk.

There are two options – local or Internet backup. The following is a list of Local backup options. Most of these also double as devices used to transfer data between computers.

  • Diskettes
  • Zip Drives
  • CD’s
  • DVD’s
  • Flash Drive

Internet Backup Another backup option is sending your files to an Internet site for safekeeping. If your computer crashes you can simply download them from the site. Here are a few examples of such sites: Backup Defender (www.backupdefender.co.nz) and My Backup (www.mybackup.co.nz). N.B. The author does not recommend or endorse any of the above service providers.

Diskette A Diskette is a 3.5-inch removable magnetic disk. The older version, the floppy disk, is 5.25 inches square and flexible. Copying to a diskette is quick and economical.

Ideal for…

  • Those who use their PC for personal finance – the diskette enables you to retrieve checkbook balances etc.
  • Projects that need to be continuously backed up such as a film script, as it is a cheap alternative.

Not so good for…

  • Some newer computer and laptop models that do not have a diskette or floppy drive installed.
  • Large amounts of data as diskettes don’t have a great storage capacity

Zip Drives A Zip drive is a small, square shaped magnetic disk that is ideal for backing up your PC. The 100-megabyte size holds the equivalent of 70 floppy diskettes. They also come in a 250-megabyte size

Ideal for…

  • Duplicating your entire disc drive
  • Archiving
  • Storing graphic images or other large files
  • Transferring large files
  • Keeping certain data separate from files on your hard disk

The downside…

  • They seem to be a fleeting technology – most computers do not have a Zip Disc drive installed and opinion varies on how long they will be around for.

Compact Disks There are different standards of CD’s that have different capabilities. Just to confuse us they are recognized by seemingly similar acronyms; CD-R, CD-RW, CD+RW, DDCD and E-CD.

CD-R CD-R (Compact Disc – Recordable) is a CD that can be recorded to only once. It usually holds 74 minutes of audio or 650 MB of data, although newer versions hold up to 80 minutes of audio (700 MB of data). If your PC has CD burning software and a compatible CD-R or CD-RW drive, the CD-R can be used in the same way as a diskette. However unlike a diskette it cannot be deleted or overwritten. Look out for CD-Rs that have an additional protective layer which make them less susceptible to damage caused through scratching.

Ideal for…

  • Making music CD’s
  • Storing photos
  • Storing permanent data

Not so good for…

  • Transferring files as they can only be used once

CD-RW/CD+RW A CD-RW (Compact Disc Rewritable) and CD+RW can be recorded onto as many times as desired. Data can be overwritten and erased. Other than this, the CD-RW is identical to the CD-R. If it wasn’t for their finite durability CD-RW’s and CD+RW’s could be reused endlessly.

Ideal for…

  • Transferring files
  • Holding temporary data

Not so good for…

  • Holding important permanent files-in case they are accidentally deleted

Double Density CD (DDCD) This disc has a much greater storage capacity than an average CD-R or CD-RW.

Ideal for…

  • Backing up
  • Storing archival data

Enhanced CD Enhanced CD (E-CD) is an audio CD with CD-ROM data added. CD-ROM data is added in the space not taken by audio. Recording artists can use this to include videos, lyrics, interviews or promo material. The E-CD can be played on a CD player but to view additional material you need access to a multimedia-capable device, such as a CD-i player, DVD-ROM, or CD-ROM drive.

Bridge Disks A CD-Bridge disc holds extra information on a CD-ROM XA track. The disc can be played on either a CD-i player attached to a television, or a CD-ROM XA drive attached to a computer. Software such as Photo or a Karaoke CD player can provide lots of fun with the Bridge Disk.

DVD (Digital Versatile Disk) Although DVD’s have become more associated with video, they can also hold audio and computer data; hence their name Digital Versatile Disk. Like the CD, a DVD is a 120-mm by 1.2mm thick disk. However the DVD has more tracks than a CD so holds far more data. CD’s have an unvarying storage capacity of 750MB, whereas DVD’s store up to 17GB.

A range of acronyms is also used to distinguish between the different types and capabilities of DVD’s available. These include DVD-ROM, DVD-R, DVD-RW, DVD+RW and DVD-Audio.

DVD-ROM DVD-ROM (Digital Versatile Disc – Read Only Memory) is similar to a movie DVD, but is designed for computers. The DVD-ROM stores data in the same way that the CD-ROM does and is used in the DVD-ROM drive of your PC.

The upside…

  • Larger storage space – hold more data than a CD
  • Can be filled with nearly everything; video, music or computer specific data
  • A base speed of 1.32 megabytes/sec

The downside…

  • Many older computers do not have a DVD-Rom drive installed
  • Can be recorded on only once

DVD-Audio DVD-Audio (DVD-A) is designed for audio data and high-quality music. Its storage capacity is seven times that of a CD and provides at least twice the sound quality. Like the Enhanced CD, DVD-A can contain other data, providing the listener with extra information such as lyrics or images. DVD-A is predicted by many to replace the standard audio CD in the music industry.

DVD-R Like the CD-R, the DVD-R (Digital Versatile Disc-Recordable) can be recorded on once.

The upside…

  • A DVD-R can contain an assortment of information; video, text, audio and computer data
  • A DVD-R can be played on your normal DVD video player but remember, if you have additional data not of the same format e.g. video and audio together, you will need a DVD-ROM or Multimedia player of some kind
  • A DVD-R is read at the same speed as commercially made DVD’s

DVD-RW and DVD+RW Similar to the CD-RW, a DVD-RW or DVD+RW (Digital Versatile Disc – Rewritable) can be recorded on, rewritten and erased multiple times. Other than this they are identical to the DVD-R. DVD minus and plus are just different versions with the same functionality.

The Future of CD/DVD Storage The majority of the technology industry predicts that soon DVD’s, with their larger storage capacity and faster access time, will replace CD’s. DVD-ROM drives are likely to be sold with new computer systems in the way that CD-ROM drives once were. However we are always on the cusp of newer technologies, such as the HD-ROM.

HD-ROM (High Density-Read Only Memory) HD-ROM uses a more precise particle beam to write data. This enables information to be written on more durable materials such as metal so storage is virtually permanent. HD-ROM has hundreds of times the storage capacity of the CD-ROM.

Flash Drives A Flash drive is a small portable memory stick that holds anywhere from 1Mb to 1GB of data. It is surprisingly lightweight and is often worn around the neck or carried as a funky key chain. They are compatible with any PC that has USB port and with Mac OS 9 and OS X, Windows 2000 and XP or Linux 2.4.17.

The upside…

  • Durable – more so than CD’s or DVD’s
  • No need for batteries or a separate power source
  • Convenient – your computer should recognize the additional drive as soon as you insert it into the USB port
  • Ideal for backup
  • Larger storage capacity then many other portable devices
  • More portable than ZIP drives, CD’s and Diskettes
  • Quick transfer rate (approx. 1Mb/sec)
  • Edit, rewrite, delete as many times as desired
  • Help desk personnel can use Flash Drives as a portable toolkit that includes system updates and recovery tools.

The downside…

  • More expensive than other portable devices
  • Viruses – The portability and compatibility of the Flash Drive increases the chance of spreading viruses. In many cases viruses carried by a Flash Drive will not be detected as most antivirus software is reactive and only recognizes known viruses
  • Theft – a Flash Drive can make it easier for data to be stolen from an unlocked PC
  • Little Security – the size and weight of the Flash drive makes it very easy to misplace. Most have little or no security features and data is accessed easily. Some Flash Drives do have built in security; either a password or in some cases a finger print system – but this comes at a price.

Article by David Haysom. David is the eCommerce Manager for OfficeRocket http://www.officerocket.co.nz/. OfficeRocket is an online store that offers a wide range of office supplies including computer data storage media.