You are on page 1of 31

PLANETLAB

CanterburyUserManual
TheDepartmentofComputerScienceandSoftwareEngineering

UniversityofCanterbury

By
FarzanaYasmeen

October2008 Credits
GregEwing,JoffreHorlor,TonyDale,AdriaanSchmidt,AdamChang

Acknowledgements
Dr.KrzysztofPawlikowski,Dr.DonMcNickle,Dr.HarshaSirisena

INTRODUCTION

TheOriginalVision
In2002,ahandfulofresearchersoftheNetworkSystemsGroupatPrincetonUniversityanticipatedthat anewclassofgeographicallydistributednetworkserviceswereemerging,andthatthemosteffective waytodesign,evaluate,anddeploytheseserviceswouldbebyusinganoverlaybasedtestbed.
Anoverlaynetworkisacomputernetworkwhichisbuiltontopofanothernetwork.Nodesinthe overlaycanbethoughtofasbeingconnectedbyvirtualorlogicallinks,eachofwhichcorrespondsto a path, perhaps through many physical links, in the underlying network. Overlay networks can be constructed in order to permit routing messages to destinations not specified by an IP address. Additionally, overlay networks can be incrementally deployed on endhosts running the overlay protocol software, without requiring modification on the routers. The overlay has no control over howpacketsareroutedintheunderlyingnetworkbetweentwooverlaynodes,butitcancontrol,for example,thesequenceofoverlaynodesamessagetraversesbeforereachingitsdestination. Atestbedisaplatformforexperimentationforlargedevelopmentprojectsinanenvironmentthatis shieldedfromthehazardsoftestinginaliveproductionenvironment.

Unlike conventional testbeds however, the aim of the testbed was to both support researchers that want to develop new services, and clients that want to use them. Thus rather than view the overlay strictly as a testbed, the longterm view was taken in which the overlay would be both a research testbedandadeploymentplatform. Asaresearchtestbed,theoverlaysvalueistogiveresearchersaccessto(1)alargesetofgeographically distributedmachines;(2)arealisticnetworksubstratethatexperiencescongestion,failures,anddiverse linkbehaviors;and(3)thepotentialforarealisticclientworkload.Itsvalueasadeploymentplatformis toprovide(1)researcherswithadirecttechnologytransferpathforpopularnewservices,and(2)users withaccesstothosenewservices. Thisdualuse,inturn,suggestsfourdesignprinciplesthatarenotwidelysupportedinexistingtestbeds: (1)servicesshouldbeabletoruncontinuouslyandaccessasliceoftheoverlay'sresources,(2)control overresourcesshouldbedistributed,(3)overlaymanagementservicesshouldbeunbundledandrunin theirownslices,and(4)APIsshouldbedesignedtopromoteapplicationdevelopment. PlanetLab was built to adhere to these design principals. Today, more than 1,000 researchers at top academicinstitutionsandindustrialresearchlabshaveusedPlanetLabtodevelopnewtechnologiesfor distributed storage, network mapping, peertopeer systems, distributed hash tables, and query processing.PlanetLabcurrentlyconsistsof912nodesacross473sitesaroundtheworld.PlanetLabhas beensupportedinpartbytheNationalScienceFoundation*andbyDARPA.Supportisalsoprovidedby companiesthatjointhePlanetLabConsortium.

ThingsHappening
PeertoPeerApplications
A PeertoPeer (P2P) network utilizes the workstations and network resources of participants in a networkcomparedtoconventionalcentralizedarchitecturewhereserversprovideservices.ApureP2P networktreatseveryusertobebothaserverandaclientdependingonifafilerequestwasreceivedor sent. In contrast, a centralized network will have severs accommodating users requests. There also exists a hybrid P2P network, where servers are placed to provide indexing services. P2P traffic is becomingoneofthelargestbandwidthconsumersamongISPsbecauseofitseaseindeploymentand usageincontentdistribution.

P2PonPlanetLab
PlanetLab nodes are connected to the Internet and experiments have a more realistic testbed where delays,bandwidthetcaresubjecttochange;thisadvantagecangiveresearchersabetterideaofhowa particularP2Pserviceisgoingtoperformonceutilizedbythepublic.Toolsarealsoavailabletoaidin conductingexperimentsanddatacollection.

P2PPlanetLabProjects
ResearchInstitutes BostonUniversity Projects snstoexaminetheeffectsofselfishoverlaynodes,andcompareitwith unstructuredp2pnetworks.Measurementsconsideredaremultiple performancemetrics,includingdelayandavailablebandwidth.

BrighamYoungUniversity p2pwebtodetermineifawebbrowsercanautomaticallyconverttop2p downloadwhenthemainserverisoverloaded. Delftuniversityof Technology p2p_iptvtomeasuretheperformanceoftheP2PTVnetwork.First, simulateanetworkofnodesrunningaLinuxversionDelftP2PTV implementation(Sopcast)inPlanetLab.Anodewillstreamavideoinloop, andothernodesrunningtheP2PTVclientprogram(Sopcast)andasniffer (tcpdump)totraceandcapturethetraffic. p2psecstructuredp2pnetworksrelyoneachpeertoperformcritical functionssuchasrouting,datastorageandretrieval.Maliciousnodescan interferewiththeoperationofthenetworkbyabusingorneglectingthese responsibilities.Thisprojectseekstodevelopsecuritymechanismsfor structuredoverlaystofunctioninthepresenceofmaliciouspeers.

GeorgiaInstituteof Technology

NationalTsingHua University

nvlab_p2pthisresearchaimstostudythevideoqualityoptimizationover p2pnetworkwithheterogeneousenvironment.Thegoalalsoincludes developingacrosslayerdesignmechanismtoorganizelimitedresources (storage,bandwidth,computingpower)andmanagevideodata importancetoachievefairandeffectivetransmissionandbestuservideo experience. landthegoalistomeasurethepeerbehaviorsintheBitTorrentsystem. ThisresearchgeneratestracesoftheexperimentofmeasuringtheBT protocolwhenclientnodesareinitiatedwithdownloadscripts.

FederalUniversityofRio deJaneiro

UniversityofTurin

likirthefullydecentralizedp2pnetworksareresilientagainstrandom nodefailuresbutalsolackatrustedcentralauthority.Likir(Layered IdentitybasedKademlialikeinfrastructure)isasecurecommunication protocolbuiltontopofKademlia.Thiswillbeaccomplishedwiththe adoptionofacertificationservice,withtheuseofanauthentication protocolbetweennodesandwiththeintroductionofcredentialstomake nonrepudiabletheownershipofthecontentsandmessagesinsertedin theDHT.Thegoaloftheexperimentsistoevaluatetheoverhead introducedbyLikir,totesttheapplicabilityinalargescaledistributed environment.

Others:
NetworkMapping,DistributedProcessing,NetworkmeasurementandMonitoringetc.

InAcademia
Inadditiontoservingasaresearchplatform,PlanetLabisalsobeingusedbycoursesthatgivestudents firsthandexperiencewithbroadcoverageservices.

PurposeofthisManual

This manual was written in retrospect to the steps and actions I performed while newly acquainting myself to PlanetLab whilst my short stay at UC. In this manual I try to direct the reader through the highs and lows from going from a documentation and tutorial studying phase, to setting a user account and acquiring a slice, to finally distributing Akaroa2 in PlanetLab.ThereisalsonotesonhowItriedouttheHelloWorldtutorial,whichgavemean ideaofPlanetLabslongrunningservicesCoMonandCoDeploy. Thedescriptionsgivenineachstepwillusuallybeverybriefandtextthatcanbefoundonother sitesanddocumentationwillnotberepeatedhere,ratheralinkpointingtotheinformationwill begiven.Ifyouhaveanyquestionsregardingthematerialinthismanual,pleasecontactmeat: bonhomie@nii.ac.jp

CONTENTS
UsefulLinks pg.

GettingaPlanetLabAccount AboutaSlice DistributingAkaroa2

AnExample:HelloWorld

USEFULLINKS
This section provides links to documentation that you can start reading immediately before evenbecomingauserofPlanetLab.AllyouwillneedistogethookeduptotheInternetand lots of coffee. Ive tried to put them in realtime readingorder so that the preliminary stuff comesfirst. PlanetLabOfficialSite: https://www.planetlab.org/ TheoriginalvisionofPlanetLab: http://www.cs.princeton.edu/nsg/papers/planetlab_hotnets_02/ TocheckouthowPlanetLabeveolvedsincethen(2002),checkthefollowinglink: https://www.planetlab.org/history PlanetLabDesignNotes: https://www.planetlab.org/doc/pdn PlanetLabArchietecture:AnOverview https://www.planetlab.org/files/pdn/PDN06031/pdn06031.pdf PlanetLabTerminology: https://www.planetlab.org/doc/guides/user PlanetLabSitePolicy: https://www.planetlab.org/node/157 The following links point to course web pages for classes and seminars that have used PlanetLab. https://www.planetlab.org/courseware YoumayalsowanttotakealookattheTechnicalsContactGuideat https://www.planetlab.org/node/173 though probably your status will be that of a user. This guide will give you a more solid conceptofthephysicalfeaturesofthenodesonyourPlanetLabsite. OurPlanetLabsiteis:UniversityofCanterbury,NewZealand,currentlyconsistingoftwonodes planetlab3 and planetlab4.You can get a list of all sites hosting PlanetLab nodes at: https://www.planetlab.org/db/pub/sites.php

GETTINGAPLANETLABACCOUNT
Note:Thisdocumentationassumesthattheuserisusinga*nixsystem. Afterskimmingthroughthelinksabove,nowisprobablytherighttimetoregisteryourselfasa user.Checkthefollowingsteps: 1. Youhavetoregisterforauseraccountagainstoneofyouremailaddresses.Minewas bonhomie@nii.ac.jp.Allemailregardingyourwork/actions/notificationsonPlanetLab willbedirectedtothisaccount,sothinkofwhatyoumightwantittobe. 2. Goto:www.planetlab.organdnoticethelogintabontheupperrighthandsideofthe page.Clickcreateanaccount.ThiswilldirectyoutotheAccountRegistrationform. Notice that at the very top of the form, some instructions are give. Pay particular attention to the line Your Email address... ... ...will be used as your PlanetLab username.Thiswillcomeinhandylater. 3. Fillintheformwithappropriatedetails.Makesureyougetthecorrectsitenamefrom thedropdownlistinthesitefield.Tip:clickonthefieldandtypeutobringdownthe listentriesstartingwithu.OursisUniversityofCanterbury,NewZealand. 4. Clicktheregisterbutton.Soon,youwillreceiveanotificationattheemailaddressyou justusedtoregisterstatingthatyouneedtoverifyyouruseraccountbyfollowingalink providedintheemail.OneyouvedonethatanotheremailwillbesenttoyoursitesPIs andtoyoustatingthatyouarenowanewPlanetLabuser. 5. YouwillreceiveyetanotheremailataingthatyouarenowsubscribedtothePlanetLab mailing list Announce@lists.planetlab.org mailing. This auto subscription happens to everyuser.Youwillfindalinkinteemailthatallowsyouunsubscribeanytimeyouwant. Also, nonusers can become members of the mailing list via: https://www.planet lab.org/lists AssumingthatyouarenowaPlanetLabuserandcansuccessfullylogin,thisisperhapsa goodtimetoaskyourPlanetLabsitePItosetyouupwithasliceonyourPlanetLabsite.The personIcontactedforthatwasTonyDale.IsoonreceivedanemailsayingthatIwasadded tocanterbury_slice1.So,wheneverIrefermy/yourslicefromnowon,pleasesubstituteit with:canterbury_slice1. Onethingtokeepinmindisthatyourslicewillexpire2monthsfromitscreationunlessyou renewit.Youwillreceiveanemail5dayspriortotheexpirationofyourslice.Theemailwill tellyouhowtorenewit.Whenrenewingaslice,youdonothavetoreloadyourpublickey.

PLANETLABROLES:
This may be a good point to introduce the different roles in PlanetLab. People involved in PlanetLabcanbecategorizedinto3groups:

PrincipalInvestigator(PI):
The PIs at each site are responsible for managing slices and users at each site. The PI is the only person at a site who can: Enable, disable, and delete user accounts. Create slices. Delete slices. Assign users to slices. Allocate resources to slices.

PIs are legally responsible for the behavior of the slices that they create. Because PIs may create slices across any of the nodes in the PlanetLab network, they may be required to respond to incidents at other sites caused by the behavior of one of their approved slices. The PI should ensure that the users of that site, understand, agree to, and abide by the PlanetLab

Acceptable Use Policy (AUP). A Deputy PI can be assigned to work along with a site PI, but usually, on PlanetLab, theres only one PI per site. The two PIs of our site are Dr. Krys and Tony Dale.

TechnicalContact(TechContact):
Each site is required to have at least one Technical Contact who is responsible for installation, maintenance, and monitoring of the site's nodes. The PI may choose to appoint a Technical Contact for this purpose. Again, s site PI may work as a Tech Contact, but the reverse is not true. Our site has 4 Tech Contacts. The one I was in contact with the most was (Joff): joffre.horlor@canterbury.ac.nz You can find more about this from the My site page when you login with your user account.

User:
A user is anyone who develops and deploys applications on PlanetLab. PIs and Tech Contacts may also be users. To be a user you have to have a valid user account and be assigned a slice to you by your site PI.

ABOUTASLICE
Afteryoureceivetheemail,logintoPlanetLabandexplorethelinksinyouruserinfotab(it replacesthelogintabintheupperrightcorner).Doyounoticethedifferenceinthevarious fieldsbeforeyouwereaddedtoasliceandafter? Userinfo(UFO)Tab

Atthispoint,pleasedownloadtheinvaluablePlanetLabUsersGuide: https://www.planetlab.org/doc/guides/user (YoumayprobablyalreadyhavethisifyoutriedthePlanetLabTerminologylinkintheprevious section).

SLICESANDSLIVERS
Againabitmoreexplanationoftheterminologies:

Site. A site is a physical location where PlanetLab nodes are located (e.g. Princeton University or HP Labs). Abbreviated versions of site names prefix all slice names. The name of our site is: University of Canterbury, New Zealand. The abbreviate name is: Canterbury. A list of all the sites on PlanetLab, along with their abbreviations can be found at: https://www.planet-lab.org/index.php?q=db/sites/ (Our site is on page 14). Node. A node is a dedicated server that runs components of PlanetLab services. We currently have two nodes:

palnetlab3.cosc.canterbury.ac.nz, palnetlab4.cosc.canterbury.ac.nz

Slice. A slice is a set of allocated resources distributed across PlanetLab. To most users, a slice means UNIX shell access to a number of PlanetLab nodes. PIs are responsible for creating slices and assigning them to their users. After being assigned to a slice, a user may then assign nodes to it. After nodes have been assigned to a slice, virtual servers for that slice are created on each of the assigned nodes. Slices have a finite lifetime and must be periodically renewed to remain valid. Sliver. A set of allocated resources on a single PlanetLab node. Slivers are currently implemented as Linux-Vservers, which implements both namespace and performance isolation among slivers on a single machine. Network virtualization of slivers is implemented using VNET.

Forabettervisualizationofwhatslices,nodesandsliversare:

Vis1:
ConsidertheboxestobePlanetLabnodesscattered/distributed/dispersedatdifferentsitesand locations.

The different colors in the shades of each box indicate a different resource type of that particularnode,ieCPU,memory,etc.Supposefortheaboveinstance,wehavetheresources orange,purpleandgreen. Now,supposeinPlanetLabwehavetwousersRedandBlue.RedisauseratourCanterbury

siteandBlueisauseratanothersite,sayinCornell.RedisassignedCanterbury_slice1byhis sitePI,synonymously;Blueisassignedcornell_slice1byhissitePI.

Vis2:
SupposeRedaddssomenodestohisslice,canterbury_slice1,asshowninthefigurebelow.His slicenowconsistsofavirtualnetworkmadeupofthenodeshehasadded.NoticethatRedhas onlybeenassignedapartofthenodesresources(shownasinred)whichiscalledasliver.This sliverhasaseparatenamespace,asmentionedbefore,containsanaggregationofthedifferent typesofresources(orange,purpleandgreen).

Vis3:
NowsupposeBlueaddssomenodestohisslice,cornell_slice1,asshowninthefigurebelow. Hisslicenowalsoconsistsofavirtualnetworkmadeupofthenodeshehasaddedandhis sliversaremarkedinblue.NoticethatBlueandRedarebothusingsomecommonnodes,but theyareassigneddifferentsliversonthosenodes.

The effect of creating slivers for different users sharing the same node is to support virtualizationinthesensethatRedwillalwaysseehimselfasbeingtheonlyuserofthe,aswill Bluethoughtheyareinrealtermssharingthesamenodesresources. Thus,theonlywayausercanexistinPlanetLabistohaveaslicewithnodesaddedtoit. Inthenextsections,IwilltrytodescribehowtoremotelylogintonodesonPlanetLabusingthe sshprotocol(usingport20)andhowtopopulatenodeswithnecessaryresources.

SSH:REMOTELOGIN
BeforeyoucanaccessanyPlanetLabnodes,includingthoseatyourownsite,youmustcreate anSSHkeypairforauthenticationpurposes.TogenerateanSSHkeypair,usethesshkeygen programonanysecureUNIXsystem.YoudonothavetobeloggedintoPlanetLabtodothisstep. 1) OpenaterminalwindowinLinux 2) type:
ssh-keygen -t rsa -f ~/.ssh/id_rsa

3) sshkeygenasksforapassword.Youwillhavetousethispasswordtologintonodes.

4) Asyoucansee.sshisahiddenfileunderyourhomedirectory.Tofindthedirectory wherethepublicandprivatekeypairhavebeencreated,typethefollowinginyour terminal:


id_rsa.pubisthepublickeyandid_rsaistheprivatekey

5) Storeacopyoftheprivatekeyfileid_rsainasafeplace.Remember,ifyourprivatekey fileisstolenandyouraccountusedforillegalactivity,yoursiteandPImaybeheld legallyresponsible.Therefore,beware. 6) NowlogintoyourPlanetLabaccountanduploadthepublickeyfileid_rsa.pubtothe PlanetLabwebsiteusingtheManageMyKeyspage: FromyourUFOtabgotoUser>MyAccount FindtheManageKeyslinkingreen.ThiswilldirectyoutothePeoplepage.Browseto thelocationofyourid_rsa.pubfileandupload.

Accessinganodefromyourslice:
Sinceyouaresetupwithasliceandnowhaveakeypairthatyoucanuseforsecure remotelogin,youcantryaccessinganodeonyoursiteusingthefollowingssh commandsfromaterminalwindow:

ssh2i~/.ssh/id_rsacanterbury_slice1@planetlab3

Here, the 2 indicate the OpenSSH version number and i is the denotation of the identity filepathofthe~/.ssh/id_rsa.Fromnextsshsessionsyoucansimplywritethefollowing:

sshcanterbury_slice1@planetlab3

POPULATINGTHENODES

Onceyouremotelylogintoanode(wewillassumehereplanetlab3),youwillfindthatthereis nothing installed on the nodes except a minimal Fedora Core 8 installation. You will have to populatethenodeswiththeprogramsandapplicationsyouwant. Keepinmindherethatthoughotherpeopleareusingthesamenodes,yourvirtualspaceon thenodeisdifferentfromtheothers.

Installingpackages:
Toinstallstandardpackages,forexamplegccdothefollowing:

sudoyuminstallgcc
Toupdateinstalledpackages:

sudoyumupdate

To install/update/remove any packages in Linux, you usually need to be root. Sudo allows a normal user root privileges. Yum is an automatic updater and package installer/remover for rpmsystems.

Remotelycopyingfiles:
Anothervaluablecommandthatyoucanusetoremotelycopyfilesandapplicationsfromyour currentmachinetooneofyournodesisbyusingtheSecureCopyProtocol(scp).Itisusually usedtocopyfilesbetweenhostsonanetwork. Thestandardformatforscpis:

$scp<localdirectory><yourlogin>@<hostname>:<pathtoremotefile> Youcanthinkofitalternativelyas:$scp<from><to>
Supposeyouhaveafilewritteninc++calledtest.cppinyourlocalhomedirectoryinafolder calledcode.Forme,thepwdwouldreturn: $pwd

/home/cosc/guest/fya27/code/test.cpp
Tocopythisintothenodeplanetlab3;Ididthefollowing: 1)Loggedintoplanetlab3frommysliceusingaterminalwindow 2)wentintothedirectory/home/cosc/guest/fya27/code/fromanotherterminalwindow 3)typed:$scptest.cppcanterbury_slice1@planetlab3:/home/canterbury_slice1

DISTRIBUTINGAKAROA2

Akaroa2isdesignedforrunningquantitativediscreteeventsimulations.Itwasdevelopedbythe SimulationResearchGroupatourdepartmentin1992andusesanMRIP(MultipleReplications inParallel)approachforparallelsimulation. FormoreinformationonAkaroa,visit: http://www.cosc.canterbury.ac.nz/research/RG/net_sim/simulation_group/akaroa/mrip.chtml


AschematicofAkaroa2couldbegivenassuch:

MotivationfordistributiononPlanetlab:
UtilizethepowerofPlanetLab PopularizeAkaroa2inR&Eenvironments

OurinitialplanwastodistributeAkaroainthefollowingprocess:

DeploymentSpiral:
PredeploymentPhase Initialdistributionandtesting Performanceanalysis:scalability,delayoverhead,resiliencyandrobustness Postdeploymentupgrade

HELLOWORLD

HelloworldisatutorialfornewPlanetLabusers,whichishighlyrecommendedtobetriedout fortworeasons: 1)Itprovidesahandsonstepbystepmethodofdeployinganapplicationtomultiplenodes 2)ItintroducestwoveryimportantPlanetLabservice:CoMoNandCoDeploy. Pleasedownloadthetutorialbeforeproceedingwiththissection,asIwillnotrepeatherethe explanationsofthevariousstepsastheyarealreadyinthetutorial. Linktotutorial: https://www.planetlab.org/tutorial

Whatthetutorialdoes:
Inthisdemonstration,ascriptwillbedeployedtoonenodeineachactivesiteinthePlanetLab network.Thisscript,whenrunoneachnode,willgatherinformationaboutthatnodessiteand sendthisinformationbacktoacentralwebserver. Thestepsperformedinthistutorialcanbebrokendownintothefollowingsteps: 1)Populate yourslicewithactivenodes(onefromeachsite)thisis doneusing theCoMon repository YoucanfindmoreinformationonCoMon@http://comon.cs.princeton.edu 2)Afteryoursliceispopulatedwithnodes(youcancheckthis outbyusingthetabsonyour UFO), a script called phonehome.py will be deployed on each of these nodes this is done usingCoDeploy. YoucanfindmoreinformationonCoDeploy@http://codeen.cs.princeton.edu/codeploy 3)Afterthescriptisrun,eachnodewillsendbackitslongitudeandlatitudeinformationtoafile calledphonelog.txt.ThedatafromthisfilewillbeconvertedintoaKMLfilebyphonelog.php. A KML file is synonymous to HTML files, in the sense that a KML file is to a Geographical browserasHTMLfilesaretoWebbrowsers. 4)ThisKMLfilecanbeuploadedtoGoogleEarthtoviewthelocationsofthenodes. Inthebeginningofthetutorial,thereisalotoftextthatstatesrequirements.Sincewehaveall ofthem,youcanproceeddirectlytosection2.3ofthetutorialonpage3.

Addingnodestoyourslice:

Before you start this section, go to your UFO and take a look at the nodes currently on your slice.Assuming,youhaveafreshsliceandhaventaddedanynodesbefore,thenodelistshould beempty.YoucancheckthisfromthemanagenodesmenuunderChooseAction:

AccessAPIwithshell:
Thenperformtheactionsstatedinsection2.3.Aftercreatingthenecessaryfilesanddirectories, andruntheCGIcalltoCoMoninyourwebbrowser: http://comon.cs.princeton.edu/status/tabulator.cgi?table=table_nodeviewshort&format=na meonly&persite=1&select='resptime>0'

Thiswillreturnalistofoneactivenodepersite(asshownabove).Copythesenamesfromthe webbrowserandpastethemontothefilecallednodes.txt. Now, the next step will be adding the nodes to your slice. It can be done in two ways (1) accessingAPIwiththePlanetLabshellor,(2)accessingitwithapythonscript.

AccessAPIwithshell:

AccessAPIwithscript:

AddedNodes:
Performinganyoftheabovetwooperationswillhaveresultedinyourslicebeingpopulatedby thenodesyousavedinthefilenodes.txt.Now,yourNodelistshouldlookthis:

InstallingCoDeploy:
Thenexttaskwillbetodeployascripttothesenodesandthengatherinformationbackfrom them.TheCoDeploysoftwarewillassistindoingthis.DownloadtheCoDeploysoftwarefrom http://codeen.cs.princeton.edu/codeployintothedirectory:~/planetlab/hello_worldand dothefollowing:

Afterallthenecessarybinariesarecompiled,youcanaddittothepathinyour/.cshrcfileto avoidlocatingthefullworkingdirectoryeverytimeyouwanttorunCoDeploy.

SettingupaCentralWebServer:
TodothisinsteadofusingApache,Iusedthewebserverprovidedforourstudentscalled studweb.Itcanbefoundat: http://www.cosc.canterbury.ac.nz/help/main/cosc_faq.html Instructionsonhowtosetuptheserveraregivenhere: 1)Setupafolderinyourhomedirectorynamed:public_html 2)Thechangethemodetoallowreadwritepriviledges:$chmodRpublic_html 3)Inpublic_htmlcreateanotherfilecalled:index.html 4)Thisshouldhaveyoureadytogowiththewebserver.Buttotestifitsworkingtryasmall phpscript: $viindex.php >helloworld Saveandclosethefile 5)Now,gotoyourwebbrowserandtype(replacingyourusernamewithmine): http://studweb.cosc.canterbury.ac.nz/~fya27/index.php Youshouldnowseesomethinglikethis:

RunningtheScript:
Makesureyoucratethenecessaryfilesanddirectoriesasstatedinsection3.2and3.3inthe tutorialandsetnecessaryaccesspermissions.Youpublic_htmldirectorystructureatthispoint shouldlooklikethis:

Firewallissues:
Makesurehaveaccesstooutsideportsbybeforestartingdeployment:

RunningCoDeploy:
CoDeploywillnowdeploythescriptphonehome.pytoafoldercalledhellooneachofthe nodesaddedtoyourslicebydoingthefollowing:

Youshouldnowseesomethinglikethis:

ExecutingRemoteScripts:
Now,tostartexecutionoftheremotescripts,weusetheMultiquerycommandgivenonpage 10,inthetutorial:

Whilethisisexecutingyoushouldseesomethinglikethis:

Accordingtothetutorial,afterafewminutesmostofthenodesshouldhavephonedhome, andthelongitudesandlatitudeswillberecordedinKMLformatbythefile ~/public_html/hw_demo/phonelog.php

ViewinGoogleEarth:
Toviewthecoordinates,downloadGoogleEarthfrom: http://earth.google.com/ Now,inyourwebbrowser;executetheKMLfilephonelog.phpby: http://studweb.cosc.canterbury.ac.nz/~fya27/index.php ThisshouldautomaticallypromptyoutoviewthefileinGoogleEarth:

AndyouredoneCongrats!

LessonsLearned:
IhavefoundthatdeploymentofapplicationswithCoDeploydoesntalwaysgowellandyoucan sometimesendupwithgarbageattheremotenodes.So,thebestwaytodeployyour applications(onanumberofmanageablenodes)istousetheoldfashionedway,likewedid whendistributingAkaroa2.Formassivedeployments,thereareothertoolsyoucanexplorelike PlMan,check:http://www.planetlab.org/tools

REFERENCES
1)www.planetlab.org 2)DiveintoPython,byMarkPilgrim 3)earth.google.com

You might also like