tag:blogger.com,1999:blog-36667921405326998552024-03-16T12:57:03.150+05:30Install With Me !Dhyanhttp://www.blogger.com/profile/14843781913134330016noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-3666792140532699855.post-18016647716826300402014-10-20T14:06:00.001+05:302015-01-16T15:59:31.210+05:30How to Install CloudSim in Ubuntu (in 3 easy steps)<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Trebuchet MS, sans-serif;">The contents of this DIY has been tested on Ubuntu 12.04 LTS x64 with CloudSim 3.0.3 beta and JDK8u11 x64. It should work similarly on other distros of Ubuntu and for different version of JDK as long as you use Java version 1.5 or newer. The text shown in </span><span style="color: red; font-family: 'Trebuchet MS', sans-serif;">RED </span><span style="font-family: 'Trebuchet MS', sans-serif;">in the DIY represents the values that will differ depending upon your JDK version and locations.</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">CloudSim is a framework for modelling and simulating cloud computing infrastructure and services. In this DIY we will see how to install CloudSim in Windows easily and efficiently. A more detailed description, APIs and research papers related to CloudSim can be found <a href="https://adf.ly/t2j1n" target="_blank">here</a>. Let us begin.</span><br />
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 1: Setting up the Prerequisites</span></u></b><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> First of all we need to download the CloudSim and latest version of the Java Development Toolkit (JDK). CloudSim can be found <a href="https://adf.ly/t2jfl" target="_blank">here</a>.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> CloudSim requires a working Java installation. So, open up a terminal and run the following</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo add-apt-repository ppa:webupd8team/java</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get update && sudo apt-get install oracle-java8-installer</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: 'Trebuchet MS', sans-serif;">It will take some time to download and install so sit back and wait. Once it’s done then we have to add the JAVA_HOME to the Ubuntu environment. Run the following in a terminal to open up the </span><i style="font-family: 'Trebuchet MS', sans-serif;">/etc/environment</i><span style="font-family: 'Trebuchet MS', sans-serif;"> file.</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo gedit /etc/environment</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Now, append the following at the end of the file and save it:</span><br />
<br />
<table align="center" border="1" cellpadding="8" rules="cols"><tbody>
<tr> <td><span style="font-family: Verdana, sans-serif;">JAVA_HOME="/usr/lib/jvm/java-8-oracle"</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>3.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Now its time to install the CloudSim. Unpack the downloaded 'CloudSim-3.0.3.tar.gz' or 'CloudSim-3.0.3.zip' (let the name of the unpacked folder be 'cloudsim-3.0.3'). As you can see there is no makefile or install file inside the folder so it doesn't need to be compiled. Later if you want to remove the CloudSim, just remove the whole 'cloudsim-3.0.3' directory.</span><br />
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 2: Setting up the Environment</span></u></b><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Now comes the critical part, the most important part of the CloudSim setup is the setting up the paths to different classes and jar files correctly or you won't be able to run your programs efficiently.</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">We need to set the 'CLASSPATH' variable which will contain the location of the class files and will be used by the CloudSim while executing an application. So we have to set two consecutive locations first one is the location of <i>gridsim.jar</i> file provided in the CloudSim and is used exclusively by the CloudSim applications and second one is the location where we have stored our programs.</span><br />
<br />
<span style="font-family: 'Trebuchet MS', sans-serif;">We will set the CLASSPATH in the<i> .bashrc</i> file of the current user so open a terminal and run the following</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo gedit /home/<span style="color: red;">dhyan</span>/.bashrc</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: 'Trebuchet MS', sans-serif;">Provide the password and add the following lines at the end of the opened file and save it.</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr><td><span style="font-family: Verdana, sans-serif;">CLASSPATH=".:<span style="color: red;">/home/dhyan/Desktop</span>/cloudsim-3.0.3/jars/*:</span><br />
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">/home/dhyan/Desktop</span>/cloudsim-3.0.3/examples"</span><br />
<span style="font-family: Verdana, sans-serif;">export CLASSPATH</span></td></tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Now we need to reload the .bashrc file so close the all opened terminals (if any) and run the following</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">source ~/.bashrc</span></td> </tr>
</tbody></table>
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 3: Testing the Setup (Compiling and Executing a CloudSim Application)</span></u></b><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Finally now we can test whether our installation is successful or not. CloudSim includes some test example programs in the 'CloudSim\examples\gridsim\' folder that we can use to test our setup.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1. Compiling a CloudSim program:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> If you have followed this DIY then compiling a CloudSim program is pretty straightforward; the basic syntax for compilation is just similar to that of Java programs i.e. </span><span style="font-family: Courier New, Courier, monospace;">javac filename.java</span><span style="font-family: Trebuchet MS, sans-serif;"> or </span><span style="font-family: Courier New, Courier, monospace;">javac file_location/filename.java</span><span style="font-family: Trebuchet MS, sans-serif;">. Let us compile the <i>Example2.java</i> included in 'CloudSim/examples/gridsim/example02/' folder. We will now run the following command in a new command prompt</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">javac <span style="color: red;">/home/dhyan/Desktop</span>/cloudsim-3.0.3/examples/org/cloudbus/cloudsim/examples/CloudSimExample1.java</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2. Running the compiled program:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> The syntax for running a compiled CloudSim program is similar to that of running a program in Java i.e. </span><span style="font-family: Courier New, Courier, monospace;">java filename</span><span style="font-family: Trebuchet MS, sans-serif;">. In our case we have to type (see image 1)</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">java org.cloudbus.cloudsim.examples.CloudSimExample1</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: 'Trebuchet MS', sans-serif;">OR if you want to save the output of your program to a file you can use the following</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">java org.cloudbus.cloudsim.examples.CloudSimExample1 > output.txt</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>Note:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> The examples given in the CloudSim uses the concept of packages hence it is advisable to go through the basics of packages in Java for a better understanding of the above stated commands.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGFoW5qo4iEJEdis3Hu5vZ1eii4M_joOi7DOdhoL0PgMPdxBWzPiR4qBJrw7Zj_s2VPyfdIPYJUhvOY5tFqY8OWNbPIRoFGu1OP_Ldz6k03m2teXDYMxPVXHP0a4nKyPihyphenhyphenrT9fdU8P9sK/s1600/success+cloudsim.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGFoW5qo4iEJEdis3Hu5vZ1eii4M_joOi7DOdhoL0PgMPdxBWzPiR4qBJrw7Zj_s2VPyfdIPYJUhvOY5tFqY8OWNbPIRoFGu1OP_Ldz6k03m2teXDYMxPVXHP0a4nKyPihyphenhyphenrT9fdU8P9sK/s1600/success+cloudsim.png" height="561" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 1. Testing the Setup.</td></tr>
</tbody></table>
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Some Important Points</span></u></b><br />
<br />
<ul style="text-align: left;">
<li><span style="font-family: Trebuchet MS, sans-serif;">It is important to set the CLASSPATH correctly, if you make any mistake you might get a <i>class not found error</i> and if you want to supply the classpath externally while compiling or executing using </span><span style="font-family: Courier New, Courier, monospace;">-cp</span><span style="font-family: Trebuchet MS, sans-serif;"> or </span><span style="font-family: Courier New, Courier, monospace;">-classpath; </span><span style="font-family: Trebuchet MS, sans-serif;">then for some reason it might not work and you would still get the same errors.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">Remember to change the 2nd and 3rd CLASSPATH values if you later decide to move the jar files of the CLoudSim or location of your own programs to some other location, respectively and accordingly.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">You can also use CloudSim with the Eclipse IDE.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">For more information kindly refer the <i>readme.txt</i> and <i>examples.txt</i> provided with the CloudSim.</span></li>
</ul>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Goodluck !</span><br />
— * — * — * — * —</div>
Dhyanhttp://www.blogger.com/profile/14843781913134330016noreply@blogger.com5tag:blogger.com,1999:blog-3666792140532699855.post-52875570768115334982014-10-20T13:49:00.001+05:302015-01-16T15:59:22.917+05:30How to Install CloudSim in Windows (in 3 easy steps)<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Trebuchet MS, sans-serif;">The contents of this DIY has been tested on Windows 7 Ultimate x64 with CloudSim 3.0.3 and JDK8u11 x64. It should work similarly on other Windows OS and for different version of JDK as long as you use Java version 1.6 or newer. The text shown in</span><span style="color: red; font-family: 'Trebuchet MS', sans-serif;"> RED </span><span style="font-family: 'Trebuchet MS', sans-serif;">in the DIY represents the values that will differ depending upon your JDK version and locations.</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">CloudSim is a framework for modelling and simulating cloud computing infrastructure and services. In this DIY we will see how to install CloudSim in Windows easily and efficiently. A more detailed description, APIs and research papers related to CloudSim can be found <a href="https://adf.ly/t2j1n" target="_blank">here</a>. Let us begin.</span><br />
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 1: Setting up the Prerequisites</span></u></b><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> First of all we need to download the CloudSim and latest version of the Java Development Toolkit (JDK). These can be found here:</span><br />
<ul style="text-align: left;">
<li><a href="https://adf.ly/t2jfl" target="_blank"><span style="font-family: Trebuchet MS, sans-serif;">CloudSim 3.0.3</span></a></li>
<li><a href="https://adf.ly/szMZ3" target="_blank"><span style="font-family: Trebuchet MS, sans-serif;">JDK latest version for Windows</span></a></li>
</ul>
<span style="font-family: Georgia, Times New Roman, serif;"><b>Note:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> It is advisable that you must download the appropriate version of the JDK for your system i.e. x86 version for x86 systems and x64 version for x64 systems.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> CloudSim requires a working JRE, so install the JDK.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>3.</b></span><span style="font-family: Trebuchet MS, sans-serif;"></span><span style="font-family: 'Trebuchet MS', sans-serif;"> Now its time to install the CloudSim. Unpack the downloaded 'CloudSim-3.0.3.tar.gz' or 'CloudSim-3.0.3.zip' (let the name of the unpacked folder be 'cloudsim-3.0.3'). As you can see there is no executable file inside the folder so there is no special program to install the CloudSim. Later if you want to remove the CloudSim, then remove the whole 'cloudsim-3.0.3' directory.</span><br />
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 2: Setting up the Environment</span></u></b><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Now comes the critical part, the most important part of the CloudSim setup is the setting up the paths to different classes and jar files correctly or you won't be able to run your programs efficiently.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> The first path to be set is the 'Path' variable which will contain the location of executable java files such as 'javac' and 'java' and will be used by the CloudSim while compiling and running a CloudSim or Java program.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> The second path to be set is the 'CLASSPATH' variable which will contain the location of the class files and will be used by the CloudSim while executing an application. So we have to set three consecutive values first one for location of JDK executables, second one is the location of jar files provided in the CloudSim and is used exclusively by the CloudSim applications and third one is the location where we have stored our programs.</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">To set the paths go to the properties of 'My Computer' <b>—></b> 'Advanced system settings' <b>—></b> 'Advanced' tab <b>—></b> 'Environment Variables...' <b>—></b> under the 'System variables' <b>—></b> 'New...' <b>—></b> in the popped up box set the 'Variable name' and 'Variable Value' as shown and click 'OK'.</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td align="center" bgcolor="#cccccc"></td> <td align="center" bgcolor="#cccccc"><b><span style="font-family: Georgia, Times New Roman, serif;">Variable name</span></b></td> <td align="center" bgcolor="#cccccc"><b><span style="font-family: Georgia, Times New Roman, serif;">Variable value</span></b></td> </tr>
<tr> <td align="center" bgcolor="#cccccc"><b><span style="font-family: Georgia, Times New Roman, serif;">1</span></b></td><td><span style="font-family: Verdana, sans-serif;">Path</span></td> <td><span style="font-family: Verdana, sans-serif;">C:\Program Files\Java\<span style="color: red;">jdk1.8.0_11</span>\bin;</span></td> </tr>
<tr> <td align="center" bgcolor="#cccccc"><b><span style="font-family: Georgia, Times New Roman, serif;">2</span></b></td><td><span style="font-family: Verdana, sans-serif;">CLASSPATH</span></td> <td><span style="font-family: Verdana, sans-serif;">C:\Program Files\Java\</span><span style="color: red; font-family: Verdana, sans-serif;">jdk1.8.0_11</span><span style="font-family: Verdana, sans-serif;">\bin;</span><br />
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">C:\Users\Dhyan\Desktop</span>\cloudsim-3.0.3\jars\*;<br />
<span style="color: red;"> C:\Users\Dhyan\Desktop</span>\cloudsim-3.0.3\examples;</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>Note:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> We have to close all the opened command prompt windows, if any.</span><br />
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 3: Testing the Setup (Compiling and Executing a CloudSim Application)</span></u></b><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Finally now we can test whether our installation is successful or not. CloudSim includes some test example programs in the 'CloudSim\examples\gridsim\' folder that we can use to test our setup.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1. Compiling a CloudSim program:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> If you have followed this DIY then compiling a CloudSim program is pretty straightforward; the basic syntax for compilation is just similar to that of Java programs i.e. </span><span style="font-family: Courier New, Courier, monospace;">javac filename.java</span><span style="font-family: Trebuchet MS, sans-serif;"> or </span><span style="font-family: Courier New, Courier, monospace;">javac file_location\filename.java</span><span style="font-family: Trebuchet MS, sans-serif;">. Let us compile the <i>Example2.java</i> included in 'CloudSim\examples\gridsim\example02\' folder. We will now run the following command in a new command prompt</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">javac <span style="color: red;">C:\Users\Dhyan\Desktop</span>\cloudsim-3.0.3\examples\org\cloudbus\cloudsim\examples\CloudSimExample1.java</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2. Running the compiled program:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> The syntax for running a compiled CloudSim program is similar to that of running a program in Java i.e. </span><span style="font-family: Courier New, Courier, monospace;">java filename</span><span style="font-family: Trebuchet MS, sans-serif;">. In our case we have to type (see image 1)</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">java org.cloudbus.cloudsim.examples.CloudSimExample1</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">OR if you want to save the output of your program to a file you can use the following</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">java org.cloudbus.cloudsim.examples.CloudSimExample1 > output.txt</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>Note:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> The examples given in the CloudSim uses the concept of packages hence it is advisable to go through the basics of packages in Java for a better understanding of the above stated commands.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrgqZtN5tA9wAqpw27E25TRIqzq-2oGVa9WDUCIM9oad7Ifopg-AIOq5Dw0aNFCtncd7SGs_gJ6pPfP2TjAV1v7TCdfCgE04mrjVlzhCKYFFgo76E7LEowxamiclpBKoyJ-jwdxcLoObR6/s1600/Success.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrgqZtN5tA9wAqpw27E25TRIqzq-2oGVa9WDUCIM9oad7Ifopg-AIOq5Dw0aNFCtncd7SGs_gJ6pPfP2TjAV1v7TCdfCgE04mrjVlzhCKYFFgo76E7LEowxamiclpBKoyJ-jwdxcLoObR6/s1600/Success.png" height="435" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 1. Testing the Setup.</td></tr>
</tbody></table>
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Some Important Points</span></u></b><br />
<br />
<ul style="text-align: left;">
<li><span style="font-family: Trebuchet MS, sans-serif;">It is important to set the CLASSPATH correctly, if you make any mistake you might get a <i>class not found error</i> and if you want to supply the classpath externally while compiling or executing using </span><span style="font-family: Courier New, Courier, monospace;">-cp</span><span style="font-family: Trebuchet MS, sans-serif;"> or </span><span style="font-family: Courier New, Courier, monospace;">-classpath; </span><span style="font-family: Trebuchet MS, sans-serif;">then for some reason it might not work and you would still get the same errors.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">Remember to change the 2nd and 3rd CLASSPATH values if you later decide to move the jar files of the CLoudSim or location of your own programs to some other location, respectively and accordingly.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">You can also use CloudSim with the Eclipse IDE.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">For more information kindly refer the <i>readme.txt</i> and <i>examples.txt</i> provided with the CloudSim.</span></li>
</ul>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Goodluck !</span><br />
— * — * — * — * —</div>
Dhyanhttp://www.blogger.com/profile/14843781913134330016noreply@blogger.com5tag:blogger.com,1999:blog-3666792140532699855.post-6315210574743415002014-10-19T21:40:00.001+05:302015-01-16T15:59:10.767+05:30How to Install GridSim in Ubuntu (in 3 easy steps)<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Trebuchet MS, sans-serif;">The contents of this DIY has been tested on Ubuntu 12.04 LTS x64 with GridSim 5.2 beta and JDK8u11 x64. It should work similarly on other distros of Ubuntu and for different version of JDK as long as you use Java version 1.5 or newer. The text shown in </span><span style="color: red; font-family: 'Trebuchet MS', sans-serif;">RED </span><span style="font-family: 'Trebuchet MS', sans-serif;">in the DIY represents the values that will differ depending upon your JDK version and locations.</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">GridSim is a simulation toolkit for simulating resource modelling and application scheduling for parallel and distributed computing. Simulation is the only feasible way to analyse algorithms on large-scale distributed systems of heterogeneous resources. In this DIY we will see how to install GridSim in Ubuntu easily and efficiently. A more detailed description, APIs and research papers related to GridSim can be found <a href="https://adf.ly/szHyQ" target="_blank">here</a>. Let us begin.</span><br />
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 1: Setting up the Prerequisites</span></u></b><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> First of all we need to download the GridSim and latest version of the Java Development Toolkit (JDK). GridSim can be found <a href="https://adf.ly/szMft" target="_blank">here</a>.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> GridSim requires a working Java installation. So, open up a terminal and run the following</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo add-apt-repository ppa:webupd8team/java</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get update && sudo apt-get install oracle-java8-installer</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: 'Trebuchet MS', sans-serif;">It will take some time to download and install so sit back and wait. Once it’s done then we have to add the JAVA_HOME to the Ubuntu environment. Run the following in a terminal to open up the </span><i style="font-family: 'Trebuchet MS', sans-serif;">/etc/environment</i><span style="font-family: 'Trebuchet MS', sans-serif;"> file.</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo gedit /etc/environment</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Now, append the following at the end of the file and save it:</span><br />
<br />
<table align="center" border="1" cellpadding="8" rules="cols"><tbody>
<tr> <td><span style="font-family: Verdana, sans-serif;">JAVA_HOME="/usr/lib/jvm/java-8-oracle"</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>3.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Now its time to install the GridSim. Unpack the downloaded 'GridSim5-2.zip' (let the name of the unpacked folder be 'GridSim'). As you can see there is no makefile or install file inside the folder so it doesn't need to be compiled. Later if you want to remove the GridSim, just remove the whole 'GridSim' directory.</span><br />
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 2: Setting up the Environment</span></u></b><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Now comes the critical part, the most important part of the GridSim setup is the setting up the paths to different classes and jar files correctly or you won't be able to run your programs efficiently.</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">We need to set the 'CLASSPATH' variable which will contain the location of the class files and will be used by the GridSim while executing an application. So we have to set two consecutive locations first one is the location of <i>gridsim.jar</i> file provided in the GridSim and is used exclusively by the GridSim applications and second one is the location where we have stored our programs.</span><br />
<br />
<span style="font-family: 'Trebuchet MS', sans-serif;">We will set the CLASSPATH in the<i> .bashrc</i> file of the current user so open a terminal and run the following</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo gedit /home/<span style="color: red;">dhyan</span>/.bashrc</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: 'Trebuchet MS', sans-serif;">Provide the password and add the following lines at the end of the opened file and save it.</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr><td><span style="font-family: Verdana, sans-serif;">CLASSPATH=".:<span style="color: red;">/home/dhyan/Desktop</span>/GridSim/jars/*:</span><br />
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">/home/dhyan/Desktop</span>/GridSim/examples"</span><br />
<span style="font-family: Verdana, sans-serif;">export CLASSPATH</span></td></tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Now we need to reload the .bashrc file so close the all opened terminals (if any) and run the following</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">source ~/.bashrc</span></td> </tr>
</tbody></table>
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 3: Testing the Setup (Compiling and Executing a GridSim Application)</span></u></b><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Finally now we can test whether our installation is successful or not. GridSim includes some test example programs in the 'GridSim\examples\gridsim\' folder that we can use to test our setup.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1. Compiling a GridSim program:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> If you have followed this DIY then compiling a GridSim program is pretty straightforward; the basic syntax for compilation is just similar to that of Java programs i.e. </span><span style="font-family: Courier New, Courier, monospace;">javac filename.java</span><span style="font-family: Trebuchet MS, sans-serif;"> or </span><span style="font-family: Courier New, Courier, monospace;">javac file_location/filename.java</span><span style="font-family: Trebuchet MS, sans-serif;">. Let us compile the <i>Example2.java</i> included in 'GridSim/examples/gridsim/example02/' folder. We will now run the following command in a new command prompt</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">javac <span style="color: red;">/home/dhyan/Desktop</span>/GridSim/examples/gridsim/example02/Example2.java</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2. Running the compiled program:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> The syntax for running a compiled GridSim program is similar to that of running a program in Java i.e. </span><span style="font-family: Courier New, Courier, monospace;">java filename</span><span style="font-family: Trebuchet MS, sans-serif;">. In our case we have to type (see image 1)</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">java gridsim.example02.Example2</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: 'Trebuchet MS', sans-serif;">OR if you want to save the output of your program to a file you can use the following</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">java gridsim.example02.Example2 > output.txt</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>Note:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> The examples given in the GridSim uses the concept of packages hence it is advisable to go through the basics of packages in Java for a better understanding of the above stated commands.</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikAVeWPOUu1haUEb5HSR18wWY1mTxGHz16fIjef_MrQ4wcuyOYYI5trKnI8hpW3lqYdLT8Keqvt6h98R3wyKD2enyVgWbimRXzrEC6rr04DYpiz1ZnTnpLb-JuNFRqDAd7PAl7aM0cH45p/s1600/success+gridsim.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikAVeWPOUu1haUEb5HSR18wWY1mTxGHz16fIjef_MrQ4wcuyOYYI5trKnI8hpW3lqYdLT8Keqvt6h98R3wyKD2enyVgWbimRXzrEC6rr04DYpiz1ZnTnpLb-JuNFRqDAd7PAl7aM0cH45p/s1600/success+gridsim.png" height="409" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 1. Setup Test Successful.</td></tr>
</tbody></table>
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Some Important Points</span></u></b><br />
<br />
<ul style="text-align: left;">
<li><span style="font-family: Trebuchet MS, sans-serif;">It is important to set the CLASSPATH correctly, if you make any mistake you might get a <i>class not found error</i> and if you want to supply the classpath externally while compiling or executing using </span><span style="font-family: Courier New, Courier, monospace;">-cp</span><span style="font-family: Trebuchet MS, sans-serif;"> or </span><span style="font-family: Courier New, Courier, monospace;">-classpath </span><span style="font-family: Trebuchet MS, sans-serif;">then for some reason it might not work and you would still get the same errors.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">Remember to change the CLASSPATH values if you later decide to move <i>gridsim.jar</i> file or location of your own programs to some other location; accordingly.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">Running GridSim requires a lot of memory since there are many objects to be created. Therefore, it is recommended to have at least 512 MB RAM or increase JVM heap size when running Java for large simulation experiments. For example to set max. heap size as 300 MB:</span></li>
</ul>
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">java -Xmx300m gridsim.example02.Example2</span></td> </tr>
</tbody></table>
<br />
<ul style="text-align: left;">
<li><span style="font-family: Trebuchet MS, sans-serif;">You can also use GridSim with the Eclipse IDE, JBuilder or JCreator. For more instructions you might want to head <a href="https://adf.ly/szHyQ" target="_blank">here</a>.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">For more information kindly refer the <i>readme.txt</i> and <i>faq.txt</i> provided with the GridSim.</span></li>
</ul>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Goodluck !</span><br />
— * — * — * — * —</div>
Dhyanhttp://www.blogger.com/profile/14843781913134330016noreply@blogger.com2tag:blogger.com,1999:blog-3666792140532699855.post-53574935115862416802014-10-19T01:17:00.000+05:302015-01-16T15:59:01.144+05:30How to Install GridSim in Windows (in 3 easy steps)<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Trebuchet MS, sans-serif;">The contents of this DIY has been tested on Windows 7 Ultimate x64 with GridSim 5.2 beta and JDK8u11 x64. It should work similarly on other Windows OS and for different version of JDK as long as you use Java version 1.5 or newer. The text shown in</span><span style="color: red; font-family: 'Trebuchet MS', sans-serif;"> RED </span><span style="font-family: 'Trebuchet MS', sans-serif;">in the DIY represents the values that will differ depending upon your JDK version and locations.</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">GridSim is a simulation toolkit for simulating resource modelling and application scheduling for parallel and distributed computing. Simulation is the only feasible way to analyse algorithms on large-scale distributed systems of heterogeneous resources. In this DIY we will see how to install GridSim in Windows easily and efficiently. A more detailed description, APIs and research papers related to GridSim can be found <a href="https://adf.ly/szHyQ" target="_blank">here</a>. Let us begin.</span><br />
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 1: Setting up the Prerequisites</span></u></b><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> First of all we need to download the GridSim and latest version of the Java Development Toolkit (JDK). These can be found here:</span><br />
<ul style="text-align: left;">
<li><a href="https://adf.ly/szMft" target="_blank"><span style="font-family: Trebuchet MS, sans-serif;">GridSim 5.2 beta</span></a></li>
<li><a href="https://adf.ly/szMZ3" target="_blank"><span style="font-family: Trebuchet MS, sans-serif;">JDK latest version for Windows</span></a></li>
</ul>
<span style="font-family: Georgia, Times New Roman, serif;"><b>Note:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> It is advisable that you must download the appropriate version of the JDK for your system i.e. x86 version for x86 systems and x64 version for x64 systems.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> GridSim requires a working JRE so install the JDK.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>3.</b></span><span style="font-family: Trebuchet MS, sans-serif;"></span><span style="font-family: 'Trebuchet MS', sans-serif;"> Now its time to install the GridSim. Unpack the downloaded 'GridSim5-2.zip' (let the name of the unpacked folder be 'GridSim'). As you can see there is no executable file inside the folder so there is no special program to install the GridSim. Later if you want to remove GridSim, then remove the whole 'GridSim' directory.</span><br />
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 2: Setting up the Environment</span></u></b><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Now comes the critical part, the most important part of the GridSim setup is the setting up the paths to different classes and jar files correctly or you won't be able to run your programs efficiently.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> The first path to be set is the 'Path' variable which will contain the location of executable java files such as 'javac' and 'java' and will be used by the GridSim while compiling and running a GridSim or Java program.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> The second path to be set is the 'CLASSPATH' variable which will contain the location of the class files and will be used by the GridSim while executing an application. So we have to set three consecutive values first one for location of JDK executables, second one is the location of <i>gridsim.jar</i> file provided in the GridSim and is used exclusively by the GridSim applications and third one is the location where we have stored our programs.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>3.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> The third path 'GRIDSIM' is optional, it will specify the location of our GridSim programs. You can set this to avoid typing the lengthy location of your programs again and again.</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">To set the paths go to the properties of 'My Computer' <b>—></b> 'Advanced system settings' <b>—></b> 'Advanced' tab <b>—></b> 'Environment Variables...' <b>—></b> under the 'System variables' <b>—></b> 'New...' <b>—></b> in the popped up box set the 'Variable name' and 'Variable Value' as shown and click 'OK'.</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td align="center" bgcolor="#cccccc"></td> <td align="center" bgcolor="#cccccc"><b><span style="font-family: Georgia, Times New Roman, serif;">Variable name</span></b></td> <td align="center" bgcolor="#cccccc"><b><span style="font-family: Georgia, Times New Roman, serif;">Variable value</span></b></td> </tr>
<tr> <td align="center" bgcolor="#cccccc"><b><span style="font-family: Georgia, Times New Roman, serif;">1</span></b></td><td><span style="font-family: Verdana, sans-serif;">Path</span></td> <td><span style="font-family: Verdana, sans-serif;">C:\Program Files\Java\<span style="color: red;">jdk1.8.0_11</span>\bin;</span></td> </tr>
<tr> <td align="center" bgcolor="#cccccc"><b><span style="font-family: Georgia, Times New Roman, serif;">2</span></b></td><td><span style="font-family: Verdana, sans-serif;">CLASSPATH</span></td> <td><span style="font-family: Verdana, sans-serif;">C:\Program Files\Java\</span><span style="color: red; font-family: Verdana, sans-serif;">jdk1.8.0_11</span><span style="font-family: Verdana, sans-serif;">\bin;</span><br />
<span style="font-family: Verdana, sans-serif;"><span style="color: red;">C:\Users\Dhyan\Desktop</span>\GridSim\jars\*;<br />
<span style="color: red;"> C:\Users\Dhyan\Desktop</span>\GridSim\examples; </span></td> </tr>
<tr> <td align="center" bgcolor="#cccccc"><b><span style="font-family: Georgia, Times New Roman, serif;">3</span></b></td><td><span style="font-family: Verdana, sans-serif;">GRIDSIM</span></td> <td><span style="font-family: Verdana, sans-serif;"><span style="color: red;">C:\Users\Dhyan\Desktop</span>\GridSim </span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>Note:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> We have to close all the opened command prompt windows, if any.</span><br />
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 3: Testing the Setup (Compiling and Executing a GridSim Application)</span></u></b><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Finally now we can test whether our installation is successful or not. GridSim includes some test example programs in the 'GridSim\examples\gridsim\' folder that we can use to test our setup.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1. Compiling a GridSim program:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> If you have followed this DIY then compiling a GridSim program is pretty straightforward; the basic syntax for compilation is just similar to that of Java programs i.e. </span><span style="font-family: Courier New, Courier, monospace;">javac filename.java</span><span style="font-family: Trebuchet MS, sans-serif;"> or </span><span style="font-family: Courier New, Courier, monospace;">javac file_location\filename.java</span><span style="font-family: Trebuchet MS, sans-serif;">. Let us compile the <i>Example2.java</i> included in 'GridSim\examples\gridsim\example02\' folder. We will now run the following command in a new command prompt</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">javac <span style="color: red;">C:\Users\Dhyan\Desktop</span>\GridSim\examples\gridsim\example02\Example2.java</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Alternatively you can also run the following command if you have set the 'GRIDSIM' variable in the previous step.</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">javac %GRIDSIM%\examples\gridsim\example02\Example2.java</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2. Running the compiled program:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> The syntax for running a compiled GridSim program is similar to that of running a program in Java i.e. </span><span style="font-family: Courier New, Courier, monospace;">java filename</span><span style="font-family: Trebuchet MS, sans-serif;">. In our case we have to type (see image 1)</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">java gridsim.example02.Example2</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">OR if you want to save the output of your program to a file you can use the following</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">java gridsim.example02.Example2 > output.txt</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>Note:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> The examples given in the GridSim uses the concept of packages hence it is advisable to go through the basics of packages in Java for a better understanding of the above stated commands.</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6P55vRIALIaz19doVbSua8hmD4t7rfs5rQSUR3vlqPettPjaAr13VR7Cw6eQyoyHfjm68n_NGatnZcsMVxaUcMsO5x7vmD6Qxl4RnHyz0-9nMneCuIEg2cQU3hI_cYz4SildbTf-jvOlm/s1600/run.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6P55vRIALIaz19doVbSua8hmD4t7rfs5rQSUR3vlqPettPjaAr13VR7Cw6eQyoyHfjm68n_NGatnZcsMVxaUcMsO5x7vmD6Qxl4RnHyz0-9nMneCuIEg2cQU3hI_cYz4SildbTf-jvOlm/s1600/run.png" height="311" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 1. Testing the Setup.</td></tr>
</tbody></table>
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Some Important Points</span></u></b><br />
<br />
<ul style="text-align: left;">
<li><span style="font-family: Trebuchet MS, sans-serif;">It is important to set the CLASSPATH correctly, if you make any mistake you might get a <i>class not found error</i> and if you want to supply the classpath externally while compiling or executing using </span><span style="font-family: Courier New, Courier, monospace;">-cp</span><span style="font-family: Trebuchet MS, sans-serif;"> or </span><span style="font-family: Courier New, Courier, monospace;">-classpath; </span><span style="font-family: Trebuchet MS, sans-serif;">then for some reason it might not work and you would still get the same errors.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">Remember to change the 2nd and 3rd CLASSPATH values if you later decide to move <i>gridsim.jar</i> file or location of your own programs to some other location, respectively and accordingly.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">Running GridSim requires a lot of memory since there are many objects to be created. Therefore, it is recommended to have at least 512 MB RAM or increase JVM heap size when running Java for large simulation experiments. For example to set max. heap size as 300 MB:</span></li>
</ul>
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">java -Xmx300m gridsim.example02.Example2</span></td> </tr>
</tbody></table>
<br />
<ul style="text-align: left;">
<li><span style="font-family: Trebuchet MS, sans-serif;">You can also use GridSim with the Eclipse IDE, JBuilder or JCreator. For more instructions you might want to head <a href="https://adf.ly/szHyQ" target="_blank">here</a>.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">For more information kindly refer the <i>readme.txt</i> and <i>faq.txt</i> provided with the GridSim.</span></li>
</ul>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Goodluck !</span><br />
— * — * — * — * —</div>
Dhyanhttp://www.blogger.com/profile/14843781913134330016noreply@blogger.com2tag:blogger.com,1999:blog-3666792140532699855.post-20293271193200078862014-05-11T00:22:00.001+05:302015-01-16T15:58:51.789+05:30How to Integrate Mannasim with NS-2.35<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Trebuchet MS, sans-serif;">The Mannasim framework is a third party Wireless Sensor Network Simulation environment based on the Network Simulator (NS). In this DIY we will learn how we can integrate the Mannasim with the NS-2.35. You can learn more about the Mannasim <a href="https://adf.ly/sDW3e" target="_blank">here</a>.</span><br />
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 1: Prerequisites</span></u></b><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> First of all we need a working NS-2.35, installed on Ubuntu-12.04/13.10/14.04. You can find the DIY on installation of NS-2.35 in Ubuntu-12.04 <a href="https://adf.ly/sDWL5" target="_blank">here</a> and in Ubuntu-13.10/14.04 <a href="https://adf.ly/sDW3f" target="_blank">here</a>.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Second, we need the Mannasim patch files for NS-2.35, which can be downloaded from </span><a href="https://adf.ly/sDW3g" style="font-family: 'Trebuchet MS', sans-serif;" target="_blank">here</a><span style="font-family: Trebuchet MS, sans-serif;">. I assume you have downloaded the "mannasim-NS-2.35.tar.gz" in '/home/</span><span style="color: red; font-family: 'Trebuchet MS', sans-serif;">user_name</span><span style="font-family: Trebuchet MS, sans-serif;">/Documents' and have your NS-2.35</span><span style="font-family: 'Trebuchet MS', sans-serif;">installed </span><span style="font-family: 'Trebuchet MS', sans-serif;">in '/home/<span style="color: red;">user_name</span>/Documents/ns-allinone-2.35/'.</span><br />
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 2: Integrating Mannasim with NS-2.35</span></u></b><br />
<br />
<b><span style="font-family: Georgia, Times New Roman, serif;"> 1.</span></b><span style="font-family: Trebuchet MS, sans-serif;"> Extract the downloaded Mannasim patch either using the right click context menu "Extract here" or using the following command from a terminal:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">tar -xvzf /home/<span style="color: red;">user_name</span>/Documents/ns-allinone-2.35.tar.gz</span></td> </tr>
</tbody></table>
<br />
<b><span style="font-family: Georgia, Times New Roman, serif;">2.</span></b><span style="font-family: Trebuchet MS, sans-serif;"> Go to the directory where you have extracted the package, in our case its '/home/</span><span style="color: red; font-family: 'Trebuchet MS', sans-serif;">user_name</span><span style="font-family: Trebuchet MS, sans-serif;">/Documents'. Now move the extracted "mannasim" folder inside the already installed "ns-allinone-2.35/ns-2.35".</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>3.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Inside the mannasim folder there will be a "ns-modified-folder" that contains set of files to be pasted to different locations (image 1).</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_8r2klUCgeja06x8dO1M5WT8WotRZacNbRNVx35QHezP7xdTTrgmZ6HYXZldEO4pl8C6QtBIQ6T-ikkYHoHqvaQs_UBpgHV8gE1tUL2B0iR0BLhB-ka7NYwwSCfCKgtDA-gvKgzmSCm6b/s1600/5.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_8r2klUCgeja06x8dO1M5WT8WotRZacNbRNVx35QHezP7xdTTrgmZ6HYXZldEO4pl8C6QtBIQ6T-ikkYHoHqvaQs_UBpgHV8gE1tUL2B0iR0BLhB-ka7NYwwSCfCKgtDA-gvKgzmSCm6b/s1600/5.png" height="440" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 1. ns-modified-files</td></tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Copy these files and paste (replace) them in following locations:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td align="center" bgcolor="#cccccc"><b><span style="font-family: Georgia, Times New Roman, serif;">File</span></b></td> <td align="center" bgcolor="#cccccc"><b><span style="font-family: Georgia, Times New Roman, serif;">Copy to</span></b></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">udp.cc</span></td> <td><span style="font-family: Verdana, sans-serif;">ns-allinone-2.35/ns-2.35/apps/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">ns-process.h </span></td> <td><span style="font-family: Verdana, sans-serif;">ns-allinone-2.35/ns-2.35/common/ </span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">packet.cc</span></td> <td><span style="font-family: Verdana, sans-serif;">ns-allinone-2.35/ns-2.35/common/ </span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">packet.h</span></td> <td><span style="font-family: Verdana, sans-serif;">ns-allinone-2.35/ns-2.35/common/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">ns-default.tcl </span></td> <td><span style="font-family: Verdana, sans-serif;">ns-allinone-2.35/ns-2.35/tcl/lib/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">ns-lib.tcl</span></td> <td><span style="font-family: Verdana, sans-serif;">ns-allinone-2.35/ns-2.35/tcl/lib/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">Makefile.in</span></td> <td><span style="font-family: Verdana, sans-serif;">ns-allinone-2.35/ns-2.35/</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>4.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Once everything is done, go to the terminal and move to the "ns-allinone-2.35/ns-2.35" directory. Now run the following commands one by one:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">./configure</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2</span></td> <td><span style="font-family: Courier New, Courier, monospace;">make clean</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">3</span></td> <td><span style="font-family: Courier New, Courier, monospace;">make</span></td> </tr>
</tbody></table>
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 3: Test the Integration</span></u></b><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">To test Mannasim installation two simulation scripts are provided below. The first one simulates a flat network of homogeneous sensors and the second a hierarchical network composed of two different classes of sensor nodes.</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Click on the links to get the TCL code:</span><br />
<span style="font-family: Trebuchet MS, sans-serif;">1. <a href="https://adf.ly/sDW3i" target="_blank">Flat homogeneous network TCL Script</a>.</span><br />
<span style="font-family: Trebuchet MS, sans-serif;">2. <a href="https://adf.ly/sDWRe" target="_blank">Hierarchical heterogeneous network TCL Script</a>.</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">You can run these files using:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">ns mannasim-rede-plana.tcl</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2</span></td> <td><span style="font-family: Courier New, Courier, monospace;">ns mannasim-rede-hierarquica.tcl</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">You should get output as shown in image 2.</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhyphenhyphenej6-XzWbw9C0JFYZzN23XY8Y31bcpeWNlw1yWzUU6zypxAW_sbNIAvVJwnHH5QrT8wPFuNhERBS-TzvJVdkvn0ioWIyVknRQmKqcVzS7-Ua069hOGnv454NqHLY4T7K4fJJT0QfhGY0/s1600/6.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhyphenhyphenej6-XzWbw9C0JFYZzN23XY8Y31bcpeWNlw1yWzUU6zypxAW_sbNIAvVJwnHH5QrT8wPFuNhERBS-TzvJVdkvn0ioWIyVknRQmKqcVzS7-Ua069hOGnv454NqHLY4T7K4fJJT0QfhGY0/s1600/6.png" height="424" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 2. Testing the Integration.</td></tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">You have successfully integrated the Mannasim with NS-2.35. Congratulations !! Have fun !</span><br />
<br />
— * — * — * — * —<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Source</span></u></b><br />
<ul style="text-align: left;">
<li><span style="font-family: Trebuchet MS, sans-serif;"><a href="https://adf.ly/sDW3l">http://www.mannasim.dcc.ufmg.br/index.htm</a></span></li>
</ul>
</div>
Dhyanhttp://www.blogger.com/profile/14843781913134330016noreply@blogger.com65tag:blogger.com,1999:blog-3666792140532699855.post-63027431017264012412014-05-10T21:43:00.000+05:302015-05-21T00:52:18.654+05:30How to Install NS-2.35 in Ubuntu-13.10 / 14.04 (in 4 easy steps)<div dir="ltr" style="text-align: left;" trbidi="on"><span style="font-family: Trebuchet MS, sans-serif;">In this DIY we will learn how to install Network Simulator (NS)-2.35 in Ubuntu 13.10 OR Ubuntu 14.04. If you found yourself here then I assume you already know about the NS, so I will skip the introduction part. And if you don't then you may want to follow this <a href="https://adf.ly/sDWxR" target="_blank">link</a>.</span><br />
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 1: Setting up the Prerequisites</span></u></b><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> First of all, download Network Simulator (NS-2.35) from <a href="https://adf.ly/sDX0A" target="_blank">here</a>.I assume you have downloaded it into your '/home/<span style="color: red;">user_name/Documents</span>' directory.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2 [Optional].</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Now we have to update the Ubuntu with its latest components. Open up a terminal and run these commands:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get update</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get dist-upgrade</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">3</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get update</span></td> </tr>
</tbody></table><br />
<span style="font-family: Trebuchet MS, sans-serif;">Make sure that your Ubuntu is fully updated ( i.e. there should be no pending updates in your Ubuntu Software Center and in Software Updater).</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>3.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Before installing the NS we have to install some essential packages required by the NS. So run the following commands:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get install build-essential autoconf automake</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get install tcl8.5-dev tk8.5-dev</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">3</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get install perl xgraph libxt-dev libx11-dev libxmu-dev</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">4</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get install gcc-4.4</span></td> </tr>
</tbody></table><br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 2: Extract and Install NS</span></u></b><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Extract the downloaded NS package either using the right click context menu "Extract here" or using the following commands from a terminal:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">cd /home/<span style="color: red;">user_name/Documents</span></span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2</span></td> <td><span style="font-family: Courier New, Courier, monospace;">tar -xvzf ns-allinone-2.35.tar.gz</span></td> </tr>
</tbody></table><br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> After extracting the "ns-allinone-2.35" folder, open up the file "/ns-allinone-2.35/ns-2.35/linkstate/ls.h" in an editor. You can do it either from the terminal or from the file explorer (Nautilus). We have to make some changes in the ls.h file else it will show an error while installing the NS. Once you have opened the file move to the line 137 and replace the <i>erase</i> (image 1) with <i>this—>erase</i> (image 2) and save the file.</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicdODFn7R937-MGi3XTA5z5H1909O1S5A8-_it6jOloUSR__-usHq-pQ8JA75aNoJi7gtjgwypobU6ywXV6c09oIAC55Z3eIdWgK3A0LI-3TEBLHit4U6QTmjzdHw1wPxe-au27Bc4RpAz/s1600/3.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicdODFn7R937-MGi3XTA5z5H1909O1S5A8-_it6jOloUSR__-usHq-pQ8JA75aNoJi7gtjgwypobU6ywXV6c09oIAC55Z3eIdWgK3A0LI-3TEBLHit4U6QTmjzdHw1wPxe-au27Bc4RpAz/s1600/3.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 1. Replace <i>erase</i>.</td></tr>
</tbody></table><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfW32jEQp9Uv3iGPDsZJrLK0l3fB_6FZsQYWOoY_98PSO043NmSVH_dCjjnQMwfhmAYCneGdYZBFi7cbmRxiThSnMtXnzS7dHzsSYrcQNagfUgQwf2VroK80L_lPEf8gyhEdUe7pTnmpFR/s1600/4.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfW32jEQp9Uv3iGPDsZJrLK0l3fB_6FZsQYWOoY_98PSO043NmSVH_dCjjnQMwfhmAYCneGdYZBFi7cbmRxiThSnMtXnzS7dHzsSYrcQNagfUgQwf2VroK80L_lPEf8gyhEdUe7pTnmpFR/s1600/4.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 2. With <i>this->erase</i>.</td></tr>
</tbody></table><br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>NOTE:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> If you don't make the above stated change then you will see an error while installing the NS (image 3).</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2UM_Qe-NADnpxAdiGLaNBi2WNyIbsPYLEnmkM0nntZCjjBnnDwpY3FL2kpk1DeYGUshRrYX2TWyHESxG3oO7riAySQ5WASa5Z5GrkDJ4xSmrKuElwdBwkvexeswmwB1g9zSvuQXniu2OI/s1600/2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="408" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2UM_Qe-NADnpxAdiGLaNBi2WNyIbsPYLEnmkM0nntZCjjBnnDwpY3FL2kpk1DeYGUshRrYX2TWyHESxG3oO7riAySQ5WASa5Z5GrkDJ4xSmrKuElwdBwkvexeswmwB1g9zSvuQXniu2OI/s1600/2.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 3. Error (Please Follow the Previous Step).</td></tr>
</tbody></table><br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>3.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Now its time to finally install the NS. Open up a terminal and move to the directory where you have extracted the package, in our case its '/home/user_name/Documents' and install NS using the following commands (image 4):</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">cd /home/<span style="color: red;">user_name/Documents</span>/ns-allinone-2.35</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo ./install</span></td> </tr>
</tbody></table><br />
<span style="font-family: Trebuchet MS, sans-serif;">It will take around 15 minutes so have patience.</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdC7ESJS1lamco7BSP59hPkXQJYHKq3kqRWEaJpVlYHPNB8uwysB78Rx1UP59LiMvcYhUTWAxq5qr4XeiBjWmkXSsDfnJtOo-p2Tm8sQsulSjKqOPaM-DQdUKFTmEASJ9m7TeLo7d33ryz/s1600/2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="433" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdC7ESJS1lamco7BSP59hPkXQJYHKq3kqRWEaJpVlYHPNB8uwysB78Rx1UP59LiMvcYhUTWAxq5qr4XeiBjWmkXSsDfnJtOo-p2Tm8sQsulSjKqOPaM-DQdUKFTmEASJ9m7TeLo7d33ryz/s1600/2.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 4. Installation in Progress.</td></tr>
</tbody></table><br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 3: Set the Environment Variables</span></u></b><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Assuming everything went well in the previous step and you have successfully installed your NS. Now that NS is installed, there are some environment variables that need to be added to your profile. This can be done by editing the <i>.bashrc</i> file. Open a new terminal and open the file using:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo gedit .bashrc</span></td> </tr>
</tbody></table><br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>NOTE:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> You may want to create a backup of the <i>.bashrc</i> before editing, the easiest way is to copy the file to a different location. Later you can replace the edited <i>.bashrc</i> with the copied one in case something goes sideways or if you want to remove the NS.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Add the following lines AT THE END of the file. Be sure to change "<span style="color: red;">/path_to</span>" to the path of where you have extracted the NS (e.g. '/home/<span style="color: red;">user_name</span>/Documents').</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td><span style="font-family: Verdana, sans-serif;"># LD_LIBRARY_PATH</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">OTCL_LIB=<span style="color: red;">/path_to</span>/ns-allinone-2.35/otcl-1.14/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">NS2_LIB=<span style="color: red;">/path_to</span>/ns-allinone-2.35/lib/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">USR_Local_LIB=/usr/local/lib/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$USR_Local_LIB</span><br />
<span style="font-family: Verdana, sans-serif;"><br />
</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"># TCL_LIBRARY</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">TCL_LIB=<span style="color: red;">/path_to</span>/ns-allinone-2.35/tcl8.5.10/library/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">USR_LIB=/usr/lib/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">export TCL_LIBRARY=$TCL_LIBRARY:$TCL_LIB:$USR_LIB</span><br />
<span style="font-family: Verdana, sans-serif;"><br />
</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"># PATH</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">XGRAPH=<span style="color: red;">/path_to</span>/ns-allinone-2.35/xgraph-12.2/:<span style="color: red;">/path_to</span>/ns-allinone-2.35/bin/:<span style="color: red;">/path_to</span>/ns-allinone-2.35/tcl8.5.10/unix/:<span style="color: red;">/path_to</span>/ns-allinone-2.35/tk8.5.10/unix/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">NS=<span style="color: red;">/path_to</span>/ns-allinone-2.35/ns-2.35/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">NAM=<span style="color: red;">/path_to</span>/ns-allinone-2.35/nam-1.15/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">export PATH=$PATH:$XGRAPH:$NS:$NAM</span></td> </tr>
</tbody></table><br />
<span style="font-family: 'Trebuchet MS', sans-serif;">Save the file and restart the system, alternatively you can just reload the <i>.bashrc</i> as:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">source ~/.bashrc</span></td> </tr>
</tbody></table><br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 4: Validate the Installation</span></u></b><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">You need to validate NS to check if everything is OK but keep in mind that it will take a lot of time (about 1:30 hrs). Open up a terminal and move to the directory ‘/home/<span style="color: red;">user_name/Documents</span>/ns-allinone-2.35/ns-2.35/' and run:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">./validate</span></td> </tr>
</tbody></table><br />
<span style="font-family: Trebuchet MS, sans-serif;">And That is it ! You can now run ns from a terminal window by executing: </span><span style="font-family: Courier New, Courier, monospace;">ns</span><br />
<span style="font-family: Trebuchet MS, sans-serif;"> If you received the "%" sign, it means that NS is running (image 5). Congratulations !!</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1GtDk2J429aMFj7A5rZPllTkM35otNvnIU_PwBmOZCiUKPL8E7thjZWQhbujILlDr-40Bu1SJjS4yjj_aGFVfM-JXjYBQFZAYM-xAyjZfEDXBPTvdAfTOBNpKIKekTbzK21IGccWxgPyI/s1600/3.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="224" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1GtDk2J429aMFj7A5rZPllTkM35otNvnIU_PwBmOZCiUKPL8E7thjZWQhbujILlDr-40Bu1SJjS4yjj_aGFVfM-JXjYBQFZAYM-xAyjZfEDXBPTvdAfTOBNpKIKekTbzK21IGccWxgPyI/s1600/3.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 5. Installation Successful.</td></tr>
</tbody></table><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif; font-size: large;"><b>* <u>Uninstalling the NS</u></b></span><br />
<br />
<span style="font-family: 'Trebuchet MS', sans-serif;">If you want to remove the NS from your system then follow these steps:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Verdana, sans-serif;">1</span></td> <td><span style="font-family: Verdana, sans-serif;">Delete the directory 'ns-allinone-2.35'.</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Verdana, sans-serif;">2</span></td> <td><span style="font-family: Verdana, sans-serif;">Delete the ns related files from '/user/local/bin'.</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Verdana, sans-serif;">3</span></td> <td><span style="font-family: Verdana, sans-serif;">Edit the '.bashrc file' and remove the paths that you have added during the installation.</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Verdana, sans-serif;">4</span></td> <td><span style="font-family: Verdana, sans-serif;">Restart the system and run following commands one by one:</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">5</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get autoremove</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">6</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get clean</span></td> </tr>
</tbody></table><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif; font-size: large;"><b>* <u>Some Common Problems</u></b></span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1.</b></span><span style="font-family: 'Trebuchet MS', sans-serif;"> Many people are getting the following error when they run the </span><span style="font-family: Courier New, Courier, monospace;">ns</span><span style="font-family: 'Trebuchet MS', sans-serif;"> after the installation:</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCpw0u_krdQsOLCvsAAlfd40D9sAWwTyU-k14V8AIUhSxwZMbzseb3ynb-wAZIa_XRv-aVPbh-JQQV3qjtEb356TW7P_W5Dms4KiOI83OnBsF11IAk4ag1CdBUsJo8qmjFfNfHriYF0Ksi/s1600/ns+not+found.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="161" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCpw0u_krdQsOLCvsAAlfd40D9sAWwTyU-k14V8AIUhSxwZMbzseb3ynb-wAZIa_XRv-aVPbh-JQQV3qjtEb356TW7P_W5Dms4KiOI83OnBsF11IAk4ag1CdBUsJo8qmjFfNfHriYF0Ksi/s1600/ns+not+found.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 6. Error: 'ns' is currently not installed.</td></tr>
</tbody></table><br />
<span style="font-family: Trebuchet MS, sans-serif;">If you get this error then kindly ensure that you have set the path (as in step 3) correctly and try restarting the system. If the error persists then try running the </span><span style="font-family: Courier New, Courier, monospace;">ns</span><span style="font-family: Trebuchet MS, sans-serif;"> from '/ns-allinone-2.35/ns-2.35/bin/'.</span><br />
<br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">You can start working on NS now, the standard Marc Greis' tutorial on NS can be found <a href="https://adf.ly/sDX2R" target="_blank">here</a>. Another tutorial is 'NS by example' by Jae Chung and Marc Claypool, and is available <a href="https://adf.ly/sDX4U" target="_blank">here</a>.</span><br />
<br />
<br />
<span style="font-family: Georgia, Times New Roman, serif; font-size: large;"><b>P.S.</b></span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">I am not working on ns anymore, if you face any problems then feel free to contact, comment but it's guaranteed that I would be able to help you. Also go through the comments before making your query. Thank you!</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Have Fun !!</span><br />
— * — * — * — * —</div>Dhyanhttp://www.blogger.com/profile/14843781913134330016noreply@blogger.com186tag:blogger.com,1999:blog-3666792140532699855.post-35192359958852390272014-05-10T21:23:00.001+05:302015-03-08T13:59:29.227+05:30How to Install NS-2.35 in Ubuntu-12.04 (in 4 easy steps)<div dir="ltr" style="text-align: left;" trbidi="on"><span style="font-family: Trebuchet MS, sans-serif;">In this DIY we will learn how to install Network Simulator (NS)-2.35 in Ubuntu 12.04. If you found yourself here then I assume you already know about the NS, so I will skip the introduction part. And if you don't then you may want to follow this <a href="https://adf.ly/sDWxR" target="_blank">link</a>.</span><br />
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 1: Setting up the Prerequisites</span></u></b><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1. </b></span><span style="font-family: Trebuchet MS, sans-serif;"> First of all, download Network Simulator (NS- 2.35) from <a href="https://adf.ly/sDX0A" target="_blank">here</a>.I assume you have downloaded it into your '/home/<span style="color: red;">user_name</span>/Documents' directory.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Now we have to update the Ubuntu with its latest components. Open up a terminal and run these commands:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get update</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get dist-upgrade</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">3</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get update</span></td> </tr>
</tbody></table><br />
<span style="font-family: Trebuchet MS, sans-serif;">Make sure that your Ubuntu is fully updated ( i.e. there should be no pending updates in your Ubuntu Software Center and in Software Updater).</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>3.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Before installing the NS we have to install some essential packages required by the NS. So run the following commands:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get install build-essential autoconf automake</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get install tcl8.5-dev tk8.5-dev</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">3</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get install perl xgraph libxt-dev libx11-dev libxmu-dev</span></td> </tr>
</tbody></table><br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 2: Extract and Install NS</span></u></b><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Extract the downloaded NS package either using the right click context menu "Extract here" or using the following command from a terminal:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">cd /home/<span style="color: red;">user_name</span>/Documents</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2</span></td> <td><span style="font-family: Courier New, Courier, monospace;">tar -xvzf ns-allinone-2.35.tar.gz</span></td> </tr>
</tbody></table><br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Now its time to finally install the NS. Open up a terminal and move to the directory where you have extracted the package, in our case its ‘/home/user_name/Documents’ and install NS using the following command (image 1):</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">cd /home/<span style="color: red;">user_name</span>/Documents/ns-allinone-2.35</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2</span></td> <td><span style="font-family: Courier New, Courier, monospace;">./install</span></td> </tr>
</tbody></table><br />
<span style="font-family: Trebuchet MS, sans-serif;">It will take around 15 minutes so have patience.</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdC7ESJS1lamco7BSP59hPkXQJYHKq3kqRWEaJpVlYHPNB8uwysB78Rx1UP59LiMvcYhUTWAxq5qr4XeiBjWmkXSsDfnJtOo-p2Tm8sQsulSjKqOPaM-DQdUKFTmEASJ9m7TeLo7d33ryz/s1600/2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdC7ESJS1lamco7BSP59hPkXQJYHKq3kqRWEaJpVlYHPNB8uwysB78Rx1UP59LiMvcYhUTWAxq5qr4XeiBjWmkXSsDfnJtOo-p2Tm8sQsulSjKqOPaM-DQdUKFTmEASJ9m7TeLo7d33ryz/s1600/2.png" height="433" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 1. Installation in Progress.</td></tr>
</tbody></table><br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 3: Set the Environment Variables</span></u></b><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Assuming everything went well in the previous step and you have successfully installed your NS. Now that NS is installed, there are some environment variables that need to be added to your profile. This can be done by editing the ".bashrc" file. Open a new terminal and open the file using:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo gedit .bashrc</span></td> </tr>
</tbody></table><br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>NOTE:</b></span><span style="font-family: Trebuchet MS, sans-serif;"> You may want to create a backup of the .bashrc before editing, the easiest way is to copy the file to a different location. Later you can replace the edited .bashrc with the copied one in case something goes sideways or if you want to remove the NS.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2.</b></span><span style="font-family: Trebuchet MS, sans-serif;"> Add the following lines AT THE END of the file. Be sure to change "<span style="color: red;">/path_to</span>" to the path of where you have extracted the NS (e.g. '/home/<span style="color: red;">user_name</span>/Documents').</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td><span style="font-family: Verdana, sans-serif;"># LD_LIBRARY_PATH</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">OTCL_LIB=<span style="color: red;">/path_to</span>/ns-allinone-2.35/otcl-1.14/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">NS2_LIB=<span style="color: red;">/path_to</span>/ns-allinone-2.35/lib/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">USR_Local_LIB=/usr/local/lib/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$USR_Local_LIB</span><br />
<span style="font-family: Verdana, sans-serif;"><br />
</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"># TCL_LIBRARY</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">TCL_LIB=<span style="color: red;">/path_to</span>/ns-allinone-2.35/tcl8.5.10/library/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">USR_LIB=/usr/lib/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">export TCL_LIBRARY=$TCL_LIBRARY:$TCL_LIB:$USR_LIB</span><br />
<span style="font-family: Verdana, sans-serif;"><br />
</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"># PATH</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">XGRAPH=<span style="color: red;">/path_to</span>/ns-allinone-2.35/xgraph-12.2/:<span style="color: red;">/path_to</span>/ns-allinone-2.35/bin/:<span style="color: red;">/path_to</span>/ns-allinone-2.35/tcl8.5.10/unix/:<span style="color: red;">/path_to</span>/ns-allinone-2.35/tk8.5.10/unix/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">NS=<span style="color: red;">/path_to</span>/ns-allinone-2.35/ns-2.35/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">NAM=<span style="color: red;">/path_to</span>/ns-allinone-2.35/nam-1.15/</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">export PATH=$PATH:$XGRAPH:$NS:$NAM</span></td> </tr>
</tbody></table><br />
<span style="font-family: 'Trebuchet MS', sans-serif;">Save the file and restart the system, alternatively you can just reload the .bashrc as:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">source ~/.bashrc</span></td> </tr>
</tbody></table><br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 4: Validate the Installation</span></u></b><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">You need to validate NS to check if everything is OK but keep in mind that it will take a lot of time (about 1:30 hrs). Open up a terminal and move to the directory '/home/<span style="color: red;">user_name</span>/Documents/ns-allinone-2.35/ns-2.35/' and run:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">./validate</span></td> </tr>
</tbody></table><br />
<span style="font-family: Trebuchet MS, sans-serif;">And That's it ! You can now run ns from a terminal window by executing: </span><span style="font-family: Courier New, Courier, monospace;">ns</span><br />
<span style="font-family: Trebuchet MS, sans-serif;"> If you received the "%" sign, it means that NS is running (image 2). Congratulations !!</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1GtDk2J429aMFj7A5rZPllTkM35otNvnIU_PwBmOZCiUKPL8E7thjZWQhbujILlDr-40Bu1SJjS4yjj_aGFVfM-JXjYBQFZAYM-xAyjZfEDXBPTvdAfTOBNpKIKekTbzK21IGccWxgPyI/s1600/3.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1GtDk2J429aMFj7A5rZPllTkM35otNvnIU_PwBmOZCiUKPL8E7thjZWQhbujILlDr-40Bu1SJjS4yjj_aGFVfM-JXjYBQFZAYM-xAyjZfEDXBPTvdAfTOBNpKIKekTbzK21IGccWxgPyI/s1600/3.png" height="224" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 2. Installation Successful.</td></tr>
</tbody></table><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif; font-size: large;"><b>* <u>Uninstalling the NS</u></b></span><br />
<br />
<span style="font-family: 'Trebuchet MS', sans-serif;">If you want to remove the NS from your system then follow these steps:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Verdana, sans-serif;">1</span></td> <td><span style="font-family: Verdana, sans-serif;">Delete the directory 'ns-allinone-2.35'.</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Verdana, sans-serif;">2</span></td> <td><span style="font-family: Verdana, sans-serif;">Delete the ns related files from '/user/local/bin'.</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Verdana, sans-serif;">3</span></td> <td><span style="font-family: Verdana, sans-serif;">Edit the '.bashrc file' and remove the paths that you have added during the installation.</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Verdana, sans-serif;">4</span></td> <td><span style="font-family: Verdana, sans-serif;">Restart the system and run following commands one by one:</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">5</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get autoremove</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">6</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get clean</span></td> </tr>
</tbody></table><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif; font-size: large;"><b>P.S.</b></span><br />
<br />
<span style="font-family: 'Trebuchet MS', sans-serif;">Many people are getting the following error when they run the </span><span style="font-family: Courier New, Courier, monospace;">ns</span><span style="font-family: 'Trebuchet MS', sans-serif;"> after the installation:</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCpw0u_krdQsOLCvsAAlfd40D9sAWwTyU-k14V8AIUhSxwZMbzseb3ynb-wAZIa_XRv-aVPbh-JQQV3qjtEb356TW7P_W5Dms4KiOI83OnBsF11IAk4ag1CdBUsJo8qmjFfNfHriYF0Ksi/s1600/ns+not+found.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCpw0u_krdQsOLCvsAAlfd40D9sAWwTyU-k14V8AIUhSxwZMbzseb3ynb-wAZIa_XRv-aVPbh-JQQV3qjtEb356TW7P_W5Dms4KiOI83OnBsF11IAk4ag1CdBUsJo8qmjFfNfHriYF0Ksi/s1600/ns+not+found.png" height="161" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 3. Error: 'ns' is currently not installed.</td></tr>
</tbody></table><br />
<span style="font-family: Trebuchet MS, sans-serif;">If you get this error then kindly ensure that you have set the path (as in step 3) correctly and try restarting the system. If the error persists then try running the </span><span style="font-family: Courier New, Courier, monospace;">ns</span><span style="font-family: Trebuchet MS, sans-serif;"> from '/ns-allinone-2.35/ns-2.35/bin/'.</span><br />
<br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">You can start working on NS now, the standard Marc Greis' tutorial on NS can be found <a href="http://www.isi.edu/nsnam/ns/tutorial/" target="_blank">here</a>. Another tutorial is 'NS by example' by Jae Chung and Marc Claypool, and is available <a href="http://nile.wpi.edu/NS/" target="_blank">here</a>.</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Have Fun !!</span><br />
— * — * — * — * —</div>Dhyanhttp://www.blogger.com/profile/14843781913134330016noreply@blogger.com14tag:blogger.com,1999:blog-3666792140532699855.post-30314288918097273032014-04-24T01:36:00.005+05:302015-01-16T15:58:06.972+05:30Running a MapReduce Job (WordCount) on Hadoop Single-Node Cluster<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Trebuchet MS, sans-serif;">In the <a href="https://adf.ly/sDXMc" target="_blank"><span style="color: blue;">previous post</span></a> we’ve seen how to install Hadoop on Ubuntu, now it’s time to run our first Hadoop MapReduce job. We will use the <a href="https://adf.ly/sDXSC" target="_blank"><span style="color: blue;">WordCount example job</span></a> which reads text files and counts how often words occur. The input is text files and the output is text files, each line of which contains a word and the count of how often it occurred, separated by a tab.</span><br />
<br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1. Download example input data</b></span><br />
<span style="font-family: Trebuchet MS, sans-serif;">We will use three ebooks from Project Gutenberg for this example:</span><br />
<ul style="text-align: left;">
<li><a href="https://adf.ly/sDXT9" target="_blank"><span style="color: blue; font-family: Trebuchet MS, sans-serif;">The Outline of Science, Vol. 1 (of 4) by J. Arthur Thomson</span></a></li>
<li><a href="https://adf.ly/sDXXe" target="_blank"><span style="color: blue; font-family: Trebuchet MS, sans-serif;">The Notebooks of Leonardo Da Vinci</span></a></li>
<li><a href="https://adf.ly/sDXeA" target="_blank"><span style="color: blue; font-family: Trebuchet MS, sans-serif;">Ulysses by James Joyce</span></a></li>
</ul>
<span style="font-family: Trebuchet MS, sans-serif;"><br />
</span> <span style="font-family: Trebuchet MS, sans-serif;">Download each ebook and store the files in a local temporary directory of choice, for example ‘/tmp/gutenberg’. Now we have tochange the file ownership to <i>hduser</i>. Open a terminal and run:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo chown –R hduser:hadoop /tmp/gutenberg</span></td> </tr>
</tbody></table>
<br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2. Restart the Hadoop cluster</b></span><br />
<span style="font-family: Trebuchet MS, sans-serif;">Open a new terminal and restart your Hadoop cluster if it’s not running already</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">su - hduser</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2</span></td> <td><span style="font-family: Courier New, Courier, monospace;">/usr/local/hadoop/bin/start-all.sh</span></td> </tr>
</tbody></table>
<br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>3. Copy local example data to HDFS</b></span><br />
<span style="font-family: Trebuchet MS, sans-serif;">Before we run the actual MapReduce job, we first have to copy the files from our local file system to Hadoop’s HDFS. </span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">cd /usr/local/hadoop</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2</span></td> <td><span style="font-family: Courier New, Courier, monospace;">bin/hadoop dfs –copyFromLocal /tmp/gutenberg /user/hduser/gutenberg</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">We can also check whether our files are copied correctly (see image 1).</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">bin/hadoop dfs –ls /user/hduser</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2</span></td> <td><span style="font-family: Courier New, Courier, monospace;">bin/hadoop dfs –ls /user/hduser/gutenberg</span></td> </tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY9DVYN-Z529RVxgnOYvAMcZk8SzHsI4Tv46IZvu8GT_6Jy1tENi73Mpo3i_dJxzmSDy2mUlVex1l2ja1xFjmWyHtHtfQasj8hoofhNl_R7SrgujCgbimDVpm2z0-BWY3dyOcppPnidOcH/s1600/1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY9DVYN-Z529RVxgnOYvAMcZk8SzHsI4Tv46IZvu8GT_6Jy1tENi73Mpo3i_dJxzmSDy2mUlVex1l2ja1xFjmWyHtHtfQasj8hoofhNl_R7SrgujCgbimDVpm2z0-BWY3dyOcppPnidOcH/s1600/1.png" height="312" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 1. Files Copied Successfully.</td></tr>
</tbody></table>
<br />
<br />
<b><span style="font-family: Georgia, Times New Roman, serif;">4. Run the MapReduce job</span></b><br />
<span style="font-family: Trebuchet MS, sans-serif;">Now, we actually run the WordCount example job (image 2).</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">bin/hadoop jar hadoop*example*.jar wordcount /user/hduser/gutenberg /user/hduser/gutenberg-output</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">This command will read all the files in the HDFS directory '/user/hduser/gutenberg', process it, and store the result in the HDFS directory '/user/hduser/gutenberg-output'.</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5xcMYPDOLcq9i68cBaJZ7vwEOFQSQpYPjLEPH3c0yivmxQ293zkqNTd83TWrseEOKyI0qsZ9-v6BbOFKPkYdfKRy5k7BOJ2friQ19sPxq_FtV9MmzOspdfdGcu0z7z_-svBjWl-KrXr2g/s1600/2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5xcMYPDOLcq9i68cBaJZ7vwEOFQSQpYPjLEPH3c0yivmxQ293zkqNTd83TWrseEOKyI0qsZ9-v6BbOFKPkYdfKRy5k7BOJ2friQ19sPxq_FtV9MmzOspdfdGcu0z7z_-svBjWl-KrXr2g/s1600/2.png" height="484" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 2. Running WordCount.</td></tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Check if the result is successfully stored in HDFS directory '/user/hduser/gutenberg-output' (image 3):</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">bin/hadoop dfs –ls /user/hduser</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2</span></td> <td><span style="font-family: Courier New, Courier, monospace;">bin/hadoop dfs –ls /user/hduser/gutenberg</span></td> </tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9S-0Qv21BaYKX1iXct6LHRGQsTB_h936upqthG4OJZeZi5ugF9zjdsj8_kJs9kbS8eh22gYEqYu3VD5kylktWMjZBmMEQ33ImOCb811lBjVFrpmYU-UAoYViN8OFnlw_uRpHtSU0_SD-2/s1600/3.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9S-0Qv21BaYKX1iXct6LHRGQsTB_h936upqthG4OJZeZi5ugF9zjdsj8_kJs9kbS8eh22gYEqYu3VD5kylktWMjZBmMEQ33ImOCb811lBjVFrpmYU-UAoYViN8OFnlw_uRpHtSU0_SD-2/s1600/3.png" height="320" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 3. Results Stored Successfully.</td></tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">If you want to modify some Hadoop settings on the fly like increasing the number of Reduce tasks, you can use the "-D" option:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">bin/hadoop jar hadoop*example*.jar wordcount –D /user/hduser/gutenberg mapred.reduce.tasks=16 /user/hduser/gutenberg-output</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>Note:</b></span> <span style="font-family: Trebuchet MS, sans-serif;"><a href="https://adf.ly/sDXig" target="_blank"><span style="color: blue;"> Hadoop does not honor <i>mapred.map.tasks</i></span></a> beyond considering it a hint. But it accepts the user specified <i>mapred.reduce.tasks</i> and doesn’t manipulate that. You cannot force <i>mapred.map.tasks</i> but you can specify <i>mapred.reduce.tasks</i>.</span><br />
<br />
<br />
<b><span style="font-family: Georgia, Times New Roman, serif;">5. Retrieve the job result from HDFS</span></b><br />
<span style="font-family: Trebuchet MS, sans-serif;">You can use the command</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">bin/hadoop dfs –cat /user/hduser/gutenberg-output/part-r-00000</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">to read the file directly from HDFS. Or alternatively you can copy it from HDFS to the local file system</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">mkdir /tmp/gutenberg-output</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2</span></td> <td><span style="font-family: Courier New, Courier, monospace;">bin/hadoop dfs –getmerge /user/hduser/gutenberg-output /tmp/gutenberg-output</span></td> </tr>
</tbody></table>
<br />
<b><span style="font-family: Georgia, Times New Roman, serif;">Note:</span></b> <span style="font-family: Trebuchet MS, sans-serif;"> The command <i>dfs -getmerge</i> will simply concatenate any files it finds in the directory you specify. This means that the merged file might (and most likely will) not be sorted.</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Now we can view the whole output file by opening it in any editor, open a new terminal and run:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1</span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo gedit /tmp/gutenberg-output/gutenberg-output</span></td> </tr>
</tbody></table>
<br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>6. Hadoop Web Interfaces</b></span><br />
<span style="font-family: Trebuchet MS, sans-serif;">Hadoop comes with several web interfaces which are by default (see conf/hadoop-default.xml ) available at these locations:</span><br />
<br />
<ul style="text-align: left;">
<li><a href="http://localhost:50070/" style="font-family: 'Trebuchet MS', sans-serif;"><span style="color: blue;">http://localhost:50070/</span></a><span style="font-family: 'Trebuchet MS', sans-serif;">– web UI of the NameNode daemon</span></li>
<li><a href="http://localhost:50030/" style="font-family: 'Trebuchet MS', sans-serif;"><span style="color: blue;">http://localhost:50030/</span></a><span style="font-family: 'Trebuchet MS', sans-serif;">– web UI of the JobTracker daemon</span></li>
<li><a href="http://localhost:50060/" style="font-family: 'Trebuchet MS', sans-serif;"><span style="color: blue;">http://localhost:50060/</span></a><span style="font-family: 'Trebuchet MS', sans-serif;"> – web UI of the TaskTracker daemon</span></li>
</ul>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">These web interfaces provide concise information about what’s happening in your Hadoop cluster. You might want to give them a try.</span><br />
<br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>I. NameNode Web Interface (HDFS layer)</b></span><br />
<span style="font-family: Trebuchet MS, sans-serif;">The name node web UI shows you a cluster summary including information about total/remaining capacity, live and dead nodes. Additionally, it allows you to browse the HDFS namespace and view the contents of its files in the web browser. It also gives access to the local machine’s Hadoop log files.</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">By default, it’s available at <a href="http://localhost:50070/"><span style="color: blue;">http://localhost:50070/</span></a>.</span><br />
<br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>II. JobTracker Web Interface (MapReduce layer)</b></span><br />
<span style="font-family: Trebuchet MS, sans-serif;">The JobTracker web UI provides information about general job statistics of the Hadoop cluster, running/completed/failed jobs and a job history log file. It also gives access to the ‘‘local machine’s’’ Hadoop log files (the machine on which the web UI is running on).</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">By default, it’s available at <a href="http://localhost:50030/"><span style="color: blue;">http://localhost:50030/</span></a>.</span><br />
<br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>III. TaskTracker Web Interface (MapReduce layer)</b></span><br />
<span style="font-family: Trebuchet MS, sans-serif;">The task tracker web UI shows you running and non-running tasks. It also gives access to the "local machine's" Hadoop log files.</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">By default, it’s available at <span style="color: blue;">http://localhost:50060/</span>.</span><br />
<br />
— * — * — * — * —<br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>Sources</b></span><br />
<ul style="text-align: left;">
<li><a href="https://adf.ly/sDXkq"><span style="color: blue;">http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/</span></a></li>
</ul>
</div>
Dhyanhttp://www.blogger.com/profile/14843781913134330016noreply@blogger.com0tag:blogger.com,1999:blog-3666792140532699855.post-58892013207230817182014-04-24T00:59:00.000+05:302015-01-16T15:57:48.549+05:30How to Install Hadoop-1.2.1 (Single-Node Cluster) on Ubuntu-12.04, with JDK 8<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Trebuchet MS, sans-serif;">In this DIY we will see how to set up a <i>single-node</i> Hadoop cluster backed by the <i>Hadoop Distributed File System</i> (HDFS), running on Ubuntu-12.04. The main goal of this tutorial is to get a simple Hadoop installation up and running so that you can play around with the software and learn more about it.</span><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">This tutorial has been tested with the following software versions:</span><br />
<ul style="text-align: left;">
<li><span style="font-family: Trebuchet MS, sans-serif;">Ubuntu -12.04 (LTS)</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">Hadoop- 1.2.1, released Aug, 2013</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;">JDK- 8 update 5</span></li>
</ul>
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 1: Prerequisites</span></u></b><br />
<br />
<b><span style="font-family: Georgia, Times New Roman, serif;">1. Download Hadoop</span></b><br />
<span style="font-family: Trebuchet MS, sans-serif;">Hadoop-1.2.1 can be downloaded from <a href="https://adf.ly/sDXtm"><span style="color: blue;">here</span></a>. Select a mirror, then select 'hadoop-1.2.1/' directory and download <i>hadoop-1.2.1.tar.gz</i>. I assume you have downloaded it into your '/home/<span style="color: red;">user_name</span>/Downloads' directory.</span><br />
<br />
<b><span style="font-family: Georgia, Times New Roman, serif;">2. Install JDK 8</span></b><br />
<span style="font-family: Trebuchet MS, sans-serif;">Hadoop requires a working Java installation. So, open up a terminal and run the following</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo add-apt-repository ppa:webupd8team/java</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get update && sudo apt-get install oracle-java8-installer</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">It will take some time to download and install so sit back and wait. Once it's done then we have to add the JAVA_HOME to the Ubuntu environment. Run the following in a terminal to open up the <i>/etc/environment</i> file.</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo gedit /etc/environment</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Now, append the following at the end of the file and save it:</span><br />
<br />
<table align="center" border="1" cellpadding="8" rules="cols"><tbody>
<tr> <td><span style="font-family: Verdana, sans-serif;">JAVA_HOME="/usr/lib/jvm/java-8-oracle"</span></td> </tr>
</tbody></table>
<br />
<b><span style="font-family: Georgia, Times New Roman, serif;">3. Adding a dedicated Hadoop system user</span></b><br />
<span style="font-family: Trebuchet MS, sans-serif;">We will use a dedicated Hadoop user account for running Hadoop. While that’s not required it is recommended because it helps to separate the Hadoop installation from other software applications and user accounts running on the same machine. Following commands are used for our purpose, image 1 shows a typical output screen of the same.</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo addgroup hadoop</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo adduser --ingroup hadoop hduser</span></td> </tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsX6a25EpwEX3jGWvYcObzXAIv6H_9pYrJixJEx1VbSWiKw9V-IsloB9Nozy-rKBeMJrL689DvuUjOrG2tYmIUPWc4bCI7CNt4fus1mg1wqMx195Yx5E0j2ikGWs1vzd7Re8T8GVQXjrWS/s1600/1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsX6a25EpwEX3jGWvYcObzXAIv6H_9pYrJixJEx1VbSWiKw9V-IsloB9Nozy-rKBeMJrL689DvuUjOrG2tYmIUPWc4bCI7CNt4fus1mg1wqMx195Yx5E0j2ikGWs1vzd7Re8T8GVQXjrWS/s1600/1.png" height="425" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 1. Adding a Hadoop System User.</td></tr>
</tbody></table>
<br />
<b><span style="font-family: Georgia, Times New Roman, serif;">4. Installing and configuring SSH Server</span></b><br />
<span style="font-family: Trebuchet MS, sans-serif;">Hadoop requires SSH access to manage its nodes, i.e. remote machines plus your local machine if you want to use Hadoop on it (which is what we want to do in this short tutorial). For our single-node setup of Hadoop, we therefore need to configure SSH access to localhost for the hduser user we created in the previous section. Install openssh server as:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo apt-get install openssh-server</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Now, open a new terminal and switch to hduser then we have to generate an SSH key for the hduser user</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">su - hduser</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">ssh-keygen -t rsa -P ""</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">The second line will create an RSA key pair with an empty password. Generally, using an empty password is not recommended, but in this case it is needed to unlock the key without your interaction (you don’t want to enter the pass-phrase every time Hadoop interacts with its nodes). The output will look like this:</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRK7alEod9XN0yUffM4NIaYhvl-4v8f8Gg6bnSGwfayQAiENdsLH-MfL422EuOVdSd4mSmuCDwzaj9wskc5TnXOG7exj0o2yI5bM910-fiduUGrbEFGa5wv0Wy6rZhsEQOC5yG3h2__bHC/s1600/2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRK7alEod9XN0yUffM4NIaYhvl-4v8f8Gg6bnSGwfayQAiENdsLH-MfL422EuOVdSd4mSmuCDwzaj9wskc5TnXOG7exj0o2yI5bM910-fiduUGrbEFGa5wv0Wy6rZhsEQOC5yG3h2__bHC/s1600/2.png" height="408" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 2. Creating an RSA Key Pair.</td></tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Now we have to enable SSH access to your local machine with this newly created key.</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">The final step is to test the SSH setup by connecting to our local machine with the hduser user. The step is also needed to save our local machine’s host key fingerprint to the hduser user's known_hosts file.</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">ssh localhos</span>t</td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">The output will look like this:</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdjuNLY7t2K_i7IOyps1weNzqhNokYTbcukJ91avGx2TBWNZgwt6zguLCpifYv3z3PH1T6r8El2NSyvQvftoYD0XfAlqkXoEEoPP3sfvPXiT7h24rgAyQLN_xb8m6zOyGRcog3AFhCOsS5/s1600/4.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdjuNLY7t2K_i7IOyps1weNzqhNokYTbcukJ91avGx2TBWNZgwt6zguLCpifYv3z3PH1T6r8El2NSyvQvftoYD0XfAlqkXoEEoPP3sfvPXiT7h24rgAyQLN_xb8m6zOyGRcog3AFhCOsS5/s1600/4.png" height="376" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 3. Testing the ssh Setup.</td></tr>
</tbody></table>
<br />
<b><span style="font-family: Georgia, Times New Roman, serif;">NOTE:</span></b><span style="font-family: Trebuchet MS, sans-serif;"> If you get an error saying “</span><i style="font-family: 'Trebuchet MS', sans-serif;">ssh: connect to host localhost port 22: Connection refused</i><span style="font-family: Trebuchet MS, sans-serif;">”, then you have not installed the ‘openssh-server’ properly, install it first.</span><br />
<br />
<b><span style="font-family: Georgia, Times New Roman, serif;">5. Disabe IPv6</span></b><br />
<span style="font-family: Trebuchet MS, sans-serif;">Close the current terminal by repeatedly typing "</span><span style="font-family: Courier New, Courier, monospace;">exit</span><span style="font-family: Trebuchet MS, sans-serif;">" until it doesn't get closed. Open a new terminal and open the file /etc/sysctl.conf </span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo gedit /etc/sysctl.conf</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Now append the following lines at the end of the file and save it.</span><br />
<br />
<table align="center" border="1" cellpadding="3" rules="cols"><tbody>
<tr> <td><span style="font-family: Verdana, sans-serif;">net.ipv6.conf.all.disable_ipv6 = 1</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">net.ipv6.conf.default.disable_ipv6 = 1</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">net.ipv6.conf.lo.disable_ipv6 = 1</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">You have to restart your system in order to make the changes take effect. You can check whether IPv6 is enabled on your machine with the following command:</span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">cat /proc/sys/net/ipv6/conf/all/disable_ipv6</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">A return value of 0 means IPv6 is enabled (image 4), a value of 1 means disabled (image 5, that’s what we want).</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3tRzIFIHjddOlT0ol7fyXtvLiC932HdXMXjL1Ksa9y_ln-I7lN5_UF2csPJRyqJL3Ba-Q8Yp49wtVqYH_lNL6a2bVxEsiNbQ4qZaIzctXbT_bkKukHM-_u_yrnD85RdOUWi0CpFrauD6X/s1600/5.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3tRzIFIHjddOlT0ol7fyXtvLiC932HdXMXjL1Ksa9y_ln-I7lN5_UF2csPJRyqJL3Ba-Q8Yp49wtVqYH_lNL6a2bVxEsiNbQ4qZaIzctXbT_bkKukHM-_u_yrnD85RdOUWi0CpFrauD6X/s1600/5.png" height="90" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 4. IPv6 Enabled.</td></tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">After restart</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8SQereQF8a67F0NRA1xaTRe4HHfCytOMMRu1r9QISUqw2yefr3oDxr2hiqUtUREmei5xZtL3dRUppf26YhrZJH2py1hjC2XJ_Qm-QHlynsU9q7ypP4R8mzJOt6uLqiwgmdJyrydDWvT0a/s1600/6.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8SQereQF8a67F0NRA1xaTRe4HHfCytOMMRu1r9QISUqw2yefr3oDxr2hiqUtUREmei5xZtL3dRUppf26YhrZJH2py1hjC2XJ_Qm-QHlynsU9q7ypP4R8mzJOt6uLqiwgmdJyrydDWvT0a/s1600/6.png" height="90" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 5. IPv6 Disabled.</td></tr>
</tbody></table>
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 2: Install Hadoop</span></u></b><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1. Extract Hadoop and modify the permissions</b></span><br />
<span style="font-family: Trebuchet MS, sans-serif;">Extract the contents of the Hadoop package to a location of your choice. Say ‘/usr/local/hadoop’. Make sure to change the owner of all the files to the<i> hduser</i> user and <i>hadoop</i> group. But first move the downloaded <i>hadoop-1.2.1.tar.gz</i> to ‘/user/local/’ (image 6). </span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo mv /home/<span style="color: red;">user_name</span>/Downloads/hadoop-1.2.1.tar.gz /usr/local</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">cd /usr/local</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">3 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo tar xzf hadoop-1.2.1.tar.gz</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">4 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo mv hadoop-1.2.1 hadoop</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">5 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo chown –R hduser:hadoop hadoop</span></td> </tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh13C1BQj556sw35zkubt2lH3azf1UASWQj-Ws7NpXjWlpLDcZdn-NDDW92TAtSOIjvAbIgWbylh1d7KAjMnUXsopKOIgVeQO0ETs5aWAIIztdo8Jr4Un4983Eqn5HUskhsLeBxU3cJwAXq/s1600/7.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh13C1BQj556sw35zkubt2lH3azf1UASWQj-Ws7NpXjWlpLDcZdn-NDDW92TAtSOIjvAbIgWbylh1d7KAjMnUXsopKOIgVeQO0ETs5aWAIIztdo8Jr4Un4983Eqn5HUskhsLeBxU3cJwAXq/s1600/7.png" height="170" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 6. Extracting and Modifying the Permissions.</td></tr>
</tbody></table>
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2. Update '$HOME/.bashrc' of hduser</b></span></div>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Open the <i>$HOME/.bashrc</i> file of user <i>hduser</i></span><br />
<br />
<table align="center" border="1" cellpadding="4" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo gedit /home/hduser/.bashrc</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">and add the following lines at the end:</span><br />
<br />
<table align="center" border="1" cellpadding="3" rules="cols"><tbody>
<tr> <td><span style="font-family: Verdana, sans-serif;"># Set Hadoop-related environment variables</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">export HADOOP_PREFIX=/usr/local/hadoop</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"># Set JAVA_HOME (we will also configure JAVA_HOME directly for Hadoop later on)</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">export JAVA_HOME=/usr/lib/jvm/java-8-oracle</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"># Some convenient aliases and functions for running Hadoop-related commands</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">unalias fs &> /dev/null</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">alias fs="hadoop fs"</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">unalias hls &> /dev/null</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">alias hls="fs -ls"</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"># If you have LZO compression enabled in your Hadoop cluster and</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"># compress job outputs with LZOP (not covered in this tutorial):</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"># Conveniently inspect an LZOP compressed file from the command</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"># line; run via:</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">#</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"># $ lzohead /hdfs/path/to/lzop/compressed/file.lzo</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">#</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"># Requires installed 'lzop' command.</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">#</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">lzohead () {</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">hadoop fs -cat $1 | lzop -dc | head -1000 | less</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">}</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"># Add Hadoop bin/ directory to PATH</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">export PATH=$PATH:$HADOOP_PREFIX/bin</span></td> </tr>
</tbody></table>
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 3: Configuring Hadoop</span></u></b><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Now we have to configure the directory where Hadoop will store its data files, the network ports it listens to, etc. Our setup will use Hadoop’s Distributed File System, HDFS, even though our little <i>cluster</i> only contains our single local machine.</span><br />
<br />
<b><span style="font-family: Georgia, Times New Roman, serif;">1. Setting up the working directory</span></b><br />
<span style="font-family: Trebuchet MS, sans-serif;">We will use the directory ‘/app/hadoop/tmp’ in this tutorial. Hadoop’s default configurations use <i>hadoop.tmp.dir</i> as the base temporary directory both for the local file system and HDFS, so don’t be surprised if you see Hadoop creating the specified directory automatically on HDFS at some later point. Now we create the directory and set the required ownerships and permissions:</span><br />
<br />
<table align="center" border="1" cellpadding="3" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo mkdir -p /app/hadoop/tmp</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo chown hduser:hadoop /app/hadoop/tmp</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">3 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo chmod 750 /app/hadoop/tmp</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">If you forget to set the required ownerships and permissions, you will see a <i>java.io.IOException</i> when you try to format the name node in the next section.</span><br />
<br />
<b><span style="font-family: Georgia, Times New Roman, serif;">2. Configuring Hadoop setup files</span></b><br />
<br />
<b><span style="font-family: Trebuchet MS, sans-serif;">I. hadoop-env.sh</span></b><br />
<span style="font-family: Trebuchet MS, sans-serif;">The only required environment variable we have to configure for Hadoop is JAVA_HOME. Open <i>conf/hadoop-env.sh</i> (if you used the installation path in this tutorial, the full path is /usr/local/hadoop/conf/hadoop-env.sh) and set the JAVA_HOME environment variable to the java8 directory.</span><br />
<br />
<table align="center" border="1" cellpadding="3" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo gedit /usr/local/hadoop/conf/hadoop-env.sh</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Replace</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiroErjseguOeKxCFvKoi-7KMHDp-7CRmyrKSAxsICORU0ch5FJR1eyvf8kh6j3BCr1jpBZlamz53e62K-B69jOUv4jDcHaxypFlqegUOHB6A_trw5ohGcG5SD8q4D-iFNL7dyCQengIr3O/s1600/8.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiroErjseguOeKxCFvKoi-7KMHDp-7CRmyrKSAxsICORU0ch5FJR1eyvf8kh6j3BCr1jpBZlamz53e62K-B69jOUv4jDcHaxypFlqegUOHB6A_trw5ohGcG5SD8q4D-iFNL7dyCQengIr3O/s1600/8.png" height="132" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 7. Replace <i>this </i>.</td></tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">With</span><br />
<br />
<table align="center" border="1" cellpadding="3" rules="cols"><tbody>
<tr> <td><span style="font-family: Verdana, sans-serif;"># The java implementation to use. Required.</span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;">export JAVA_HOME=/usr/lib/jvm/java-8-oracle</span></td> </tr>
</tbody></table>
<br />
<b><span style="font-family: Trebuchet MS, sans-serif;">II. core-site.xml</span></b><br />
<span style="font-family: Trebuchet MS, sans-serif;">Open up the file <i>/usr/local/hadoop/conf/core-site.xml</i></span><br />
<br />
<table align="center" border="1" cellpadding="3" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo gedit /usr/local/hadoop/conf/core-site.xm</span><span style="font-family: Arial, Helvetica, sans-serif;">l</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">and add the following snippet between <configuration>...</configuration> tags (see image 8). You can leave the settings below “as is” with the exception of the <i>hadoop.tmp.dir</i> parameter – this parameter you must change to a directory of your choice.</span><br />
<br />
<table align="center" border="1" cellpadding="3" rules="cols"><tbody>
<tr> <td><span style="font-family: Verdana, sans-serif;"><property></span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"><name>hadoop.tmp.dir</name></span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"><value>/app/hadoop/tmp</value></span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"><description>A base for other temporary directories.</description></span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"></property></span></td> </tr>
<tr><td><span style="font-family: Verdana, sans-serif;"><br />
</span></td></tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"><property></span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"><name>fs.default.name</name></span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"><value>hdfs://localhost:54310</value></span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"><description>The name of the default file system. A URI whose</span><br />
<span style="font-family: Verdana, sans-serif;">scheme and authority determine the FileSystem implementation. The</span><br />
<span style="font-family: Verdana, sans-serif;">uri's scheme determines the config property (fs.SCHEME.impl) naming</span><br />
<span style="font-family: Verdana, sans-serif;">the FileSystem implementation class. The uri's authority is used to</span><br />
<span style="font-family: Verdana, sans-serif;">determine the host, port, etc. for a filesystem.</description></span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"></property></span></td> </tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguYIJHtwOuyiLGz4YIDor7i0vqnjwUzuRqYqSlpi_aR7hhJSGTq8cmX9-V2dtQ2TqKK8veEQOTeXj0pxjlA75DZUoJhY5w5F1_LgCBFmT4i0F8zJVEO4FxK5xiBJ4vDG4yhhoNsgGo58Ws/s1600/9.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguYIJHtwOuyiLGz4YIDor7i0vqnjwUzuRqYqSlpi_aR7hhJSGTq8cmX9-V2dtQ2TqKK8veEQOTeXj0pxjlA75DZUoJhY5w5F1_LgCBFmT4i0F8zJVEO4FxK5xiBJ4vDG4yhhoNsgGo58Ws/s1600/9.png" height="347" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 8. Add as Shown.</td></tr>
</tbody></table>
<br />
<b><span style="font-family: Trebuchet MS, sans-serif;">III. mapred-site.xml</span></b><br />
<span style="font-family: Trebuchet MS, sans-serif;">Open up the file <i>/usr/local/hadoop/conf/mapred-site.xml</i></span><br />
<br />
<table align="center" border="1" cellpadding="3" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo gedit /usr/local/hadoop/conf/mapred-site.xml</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">add the following snippet between <configuration>...</configuration> tags.</span><br />
<br />
<table align="center" border="1" cellpadding="3" rules="cols"><tbody>
<tr> <td><span style="font-family: Verdana, sans-serif;"><property></span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"><name>mapred.job.tracker</name></span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"><value>localhost:54311</value></span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"><description>The host and port that the MapReduce job tracker runs</span><br />
<span style="font-family: Verdana, sans-serif;">at. If "local", then jobs are run in-process as a single map and reduce task.</description></span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"></property></span></td> </tr>
</tbody></table>
<br />
<b><span style="font-family: Trebuchet MS, sans-serif;">IV. hdfs-site.xml</span></b><br />
<span style="font-family: Trebuchet MS, sans-serif;">Open up the file <i>/usr/local/hadoop/conf/hdfs-site.xml</i></span><br />
<br />
<table align="center" border="1" cellpadding="3" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo gedit /usr/local/hadoop/conf/hdfs-site.xml</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">add the following snippet between <configuration>...</configuration> tags.</span><br />
<br />
<table align="center" border="1" cellpadding="3" rules="cols"><tbody>
<tr> <td><span style="font-family: Verdana, sans-serif;"><property></span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"><name>dfs.replication</name></span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"><value>1</value></span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"><description>Default block replication. The actual number of replications can be specified when the file is created. The default is used if replication is not specified in create time.</description></span></td> </tr>
<tr> <td><span style="font-family: Verdana, sans-serif;"></property></span></td> </tr>
</tbody></table>
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 4: Formatting the HDFS Filesystem via the Namenode</span></u></b><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">The first step to starting up your Hadoop installation is formatting the Hadoop filesystem which is implemented on top of the local filesystem of your “cluster” (which includes only your local machine if you followed this tutorial). You need to do this the first time you set up a Hadoop cluster. </span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>NOTE:</b> </span><span style="font-family: Trebuchet MS, sans-serif;">Do not format a running Hadoop filesystem as you will lose all the data currently in the cluster (in HDFS)!</span><br />
<span style="font-family: Trebuchet MS, sans-serif;"><br />
</span> <span style="font-family: Trebuchet MS, sans-serif;">To format the filesystem (which simply initializes the directory specified by the dfs.name.dir variable), run the commands in a new terminal</span><br />
<br />
<table align="center" border="1" cellpadding="3" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">su - hduser</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">/usr/local/hadoop/bin/hadoop namenode -format</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">The output will look like this:</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTjkd3kQl_tCNHNwsxD3ZFBidC-pcu0Keob7yGMUAYpPSa0bLcKQf-PIJjd4KHLi_VL5hHj92qbEinWEmYWaD3y8c1uHI538P2KkRqjRXozszRBR_fVhyphenhyphenhd5UvC1PLWWB6SA6nFFopz2_J/s1600/10.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTjkd3kQl_tCNHNwsxD3ZFBidC-pcu0Keob7yGMUAYpPSa0bLcKQf-PIJjd4KHLi_VL5hHj92qbEinWEmYWaD3y8c1uHI538P2KkRqjRXozszRBR_fVhyphenhyphenhd5UvC1PLWWB6SA6nFFopz2_J/s1600/10.png" height="450" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 9. Formatting Namenode.</td></tr>
</tbody></table>
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 5: Starting your Single-Node Cluster</span></u></b><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>1. Run the command:</b></span><br />
<br />
<table align="center" border="1" cellpadding="3" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">/usr/local/hadoop/bin/start-all.sh</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">This will start a Namenode, a Datanode, a Jobtracker and a Tasktracker on your machine. The output will look like this:</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghyphenhyphenK3bPsVqGHFzs4sK1y5nSZhTghnf-X-cDq1H1cab2MDV5nKep437MOMkUSZhqawAcOmP2cINGEBIRNFahJXoHwjZffLRTsgnyKP4wHVcJP4Bl4gW5s1RzQJHoFhNYrVDR2df9OWFSRK4/s1600/11.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghyphenhyphenK3bPsVqGHFzs4sK1y5nSZhTghnf-X-cDq1H1cab2MDV5nKep437MOMkUSZhqawAcOmP2cINGEBIRNFahJXoHwjZffLRTsgnyKP4wHVcJP4Bl4gW5s1RzQJHoFhNYrVDR2df9OWFSRK4/s1600/11.png" height="266" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 10. Starting the Single-Node Cluster.</td></tr>
</tbody></table>
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>2. Check whether the expected Hadoop processes are running:</b></span><br />
<br />
<table align="center" border="1" cellpadding="3" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">cd /usr/local/hadoop</span></td> </tr>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">2 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">jps</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">The output will look like this (Process ids and ordering of processes may differ):</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGcnufKsOEKhyphenhyphenp8bsftqRNm60bTTrR0jOkn8h7GgbGyNsrp8Bn56MP-08v246ridG_QRFHJ1fMX_M4D1ytg9Zbc8gPBnLIi3My_IwACpcou9KLvhEBEqG0u79PGf0EW-vgRyYdJYegjZpk/s1600/12.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGcnufKsOEKhyphenhyphenp8bsftqRNm60bTTrR0jOkn8h7GgbGyNsrp8Bn56MP-08v246ridG_QRFHJ1fMX_M4D1ytg9Zbc8gPBnLIi3My_IwACpcou9KLvhEBEqG0u79PGf0EW-vgRyYdJYegjZpk/s1600/12.png" height="178" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 11. Running Hadoop Processes.</td></tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">If all the six processes are running then your Hadoop is working fine.</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><b>3. You can also check if Hadoop is listening on the configured ports. Open a new terminal and run</b></span><br />
<br />
<table align="center" border="1" cellpadding="3" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">sudo netstat -plten | grep java</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Output will look like this:</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit5oCoxvsm3pLxCMRNVA_SfXbWl9gbFkLdLSy23v4CgosmV6qhyphenhyphenk0SWWts0XRravwXeaaD-540arbE1C2i8UH38fg9pN6EvhDyTkh1tSMuwYF7lbahvF6kAHPBzmt6fJjLfbVsM2MYFhEo/s1600/13.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit5oCoxvsm3pLxCMRNVA_SfXbWl9gbFkLdLSy23v4CgosmV6qhyphenhyphenk0SWWts0XRravwXeaaD-540arbE1C2i8UH38fg9pN6EvhDyTkh1tSMuwYF7lbahvF6kAHPBzmt6fJjLfbVsM2MYFhEo/s1600/13.png" height="302" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 12. Hadoop is Listening.</td></tr>
</tbody></table>
<br />
<br />
<b><u><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Step 6: Stopping your Single-Node Cluster</span></u></b><br />
<br />
<span style="font-family: Trebuchet MS, sans-serif;">To stop all the daemons running on your machine, run the command:</span><br />
<br />
<table align="center" border="1" cellpadding="3" rules="cols"><tbody>
<tr> <td bgcolor="#cccccc"><span style="font-family: Courier New, Courier, monospace;">1 </span></td> <td><span style="font-family: Courier New, Courier, monospace;">/usr/local/hadoop/bin/stop-all.sh</span></td> </tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">The output will look like this:</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfoNon05_9yjfHa1iGA9rP-dvnusY3G9yxU073dsus0Yg2UqGMxwKlHR1ZiaXGKkAETGKBkGz05FSMlrYw2fWibPdnEP09qw4YA_UWex2wFrwe8x5OQ0Dy4qOO2x4b_l-WoR878Y4BTflN/s1600/14.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfoNon05_9yjfHa1iGA9rP-dvnusY3G9yxU073dsus0Yg2UqGMxwKlHR1ZiaXGKkAETGKBkGz05FSMlrYw2fWibPdnEP09qw4YA_UWex2wFrwe8x5OQ0Dy4qOO2x4b_l-WoR878Y4BTflN/s1600/14.png" height="186" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image 13. Stopping the Single-Node Cluster.</td></tr>
</tbody></table>
<br />
<span style="font-family: Trebuchet MS, sans-serif;">Congratulations! You have successfully installed your Hadoop. You can start working with Hadoop now; just remember to start your cluster first. Happy Hadooping !</span><br />
<br />
— * — * — * — * —<br />
<br />
<b><u><span style="font-family: Verdana, sans-serif;">Sources</span></u></b><br />
<ul style="text-align: left;">
<li><span style="font-family: Trebuchet MS, sans-serif;"><a href="https://adf.ly/sDXkq">http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/</a></span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;"><a href="https://adf.ly/sDY1r">http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html</a></span></li>
</ul>
<br />Dhyanhttp://www.blogger.com/profile/14843781913134330016noreply@blogger.com12tag:blogger.com,1999:blog-3666792140532699855.post-14137075992939728092014-03-31T00:00:00.001+05:302017-01-19T23:55:44.527+05:30Disclaimer / Disclosure / Terms of UseThis blog (<span style="font-family: "courier new" , "courier" , monospace;"><b>http://installwithme.blogspot.in/</b></span>) is a personal blog written and edited by me (<span style="font-family: "courier new" , "courier" , monospace;"><b>Dhyan Singh</b></span>).<br />
<br />
Copyright © 2017, Dhyan Singh<br />
<br />
These DIYs are free documents; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.<br />
<br />
These DIYs are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. GNU General Public License version 2 can be found here: <a href="http://www.gnu.org/licenses/gpl-2.0.html"><span style="font-family: "courier new" , "courier" , monospace;">http://www.gnu.org/licenses/gpl-2.0.html</span></a><br />
<br />
All content provided on this blog is for informational purposes only. The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site.<br />
<br />
The owner of the blog will not be liable for any errors or omissions in this information nor for the availability of this information. The owner will not be liable for any losses, injuries, or damages from the display or use of this information.<br />
<br />
<b>Links to external websites</b><br />
We do not link to external sites in return for cash, services or any other consideration in kind.<br />
<br />
We link to sites purely on their relevance. These will most often be free to access, but users may sometimes be asked to register or subscribe before viewing content.<br />
<br />
External links are selected and reviewed when the post is published. However, we are not responsible for the content of external websites. This is because:<br />
<br />
- <b style="font-family: 'Courier New', Courier, monospace;">http://installwithme.blogspot.in/</b> does not produce them or maintain/update them<br />
- <b style="font-family: 'Courier New', Courier, monospace;">http://installwithme.blogspot.in/</b> cannot change them<br />
- they can be changed without the <b style="font-family: 'Courier New', Courier, monospace;">http://installwithme.blogspot.in/</b>'s knowledge or agreement.<br />
<br />
The inclusion of a link to an external website from <b style="font-family: 'Courier New', Courier, monospace;">http://installwithme.blogspot.in/</b> should not be understood to be an endorsement of that website or the site's owners (or their products/services).<br />
<br />
<b>Compensation</b><br />
This blog accepts forms of cash advertising or other forms of compensation.<br />
<br />
The compensation received will never influence the content, topics or posts made in this blog. All advertising is in the form of advertisements generated by a third-party ad network. Those advertisements will be identified as paid advertisements.<br />
<br />
The owner of this blog is not compensated to provide opinion on products, services, websites and various other topics. The views and opinions expressed on this blog are purely the blog owners. If we claim or appear to be experts on a certain topic or product or service area, we will only endorse products or services that we believe, based on our expertise, are worthy of such endorsement. Any product claim, statistic, quote or other representation about a product or service should be verified with the manufacturer or provider.<br />
<br />
This blog may contain content which might present a conflict of interest. This content may not always be identified.<br />
<br />
These terms and conditions are subject to change at any time with or without notice and were last updated on Thursday, January 19th, 2017.<br />
<br />
— * — * — * — * —Dhyanhttp://www.blogger.com/profile/14843781913134330016noreply@blogger.comtag:blogger.com,1999:blog-3666792140532699855.post-46685895978561689422014-03-31T00:00:00.000+05:302017-01-19T23:52:56.167+05:30Privacy PolicyAt <span style="font-family: "courier new" , "courier" , monospace;"><b>http://installwithme.blogspot.in/</b></span>, the privacy of our visitors is of extreme importance to us. This privacy policy document outlines the types of personal information received and collected by <b><span style="font-family: "courier new" , "courier" , monospace;">http://</span><span style="font-family: "courier new" , "courier" , monospace;">installwithme.blogspot.in/</span></b> and how it is used.<br />
<br />
<b>Log Files</b><br />
Like many other Web sites, <b><span style="font-family: "courier new" , "courier" , monospace;">http://</span><span style="font-family: "courier new" , "courier" , monospace;">installwithme.blogspot.in/</span></b> makes use of log files. The information inside the log files includes internet protocol ( IP ) addresses, type of browser, Internet Service Provider ( ISP ), date/time stamp, referring/exit pages, and number of clicks to analyze trends, administer the site, track user’s movement around the site, and gather demographic information. IP addresses, and other such information are not linked to any information that is personally identifiable.<br />
<br />
<b>Cookies and Web Beacons </b><br />
<b><span style="font-family: "courier new" , "courier" , monospace;">http://</span><span style="font-family: "courier new" , "courier" , monospace;">installwithme.blogspot.in/</span></b> uses cookies to store information about visitors' preferences, record user-specific information on which pages the user access or visit, customize Web page content based on visitors' browser type or other information that the visitor sends via their browser.<br />
<br />
<b>DoubleClick DART Cookie </b><br />
- Google, as a third-party vendor, uses cookies to serve ads on <b><span style="font-family: "courier new" , "courier" , monospace;">http://</span><span style="font-family: "courier new" , "courier" , monospace;">installwithme.blogspot.in/</span></b>.<br />
- Google's use of the DART cookie enables it to serve ads to users based on their visit to <b><span style="font-family: "courier new" , "courier" , monospace;">http://</span><span style="font-family: "courier new" , "courier" , monospace;">installwithme.blogspot.in/</span></b> and other sites on the Internet.<br />
- You may opt out of a third-party vendor's use of cookies for personalized advertising by visiting <span style="font-family: "courier new" , "courier" , monospace;"><a href="http://www.aboutads.info/choices/">http://www.aboutads.info/choices/</a></span><br />
<br />
<b>Our Advertising Partners</b><br />
Some of our advertising partners may use cookies and web beacons on our site. Our advertising partners include: Google<span style="font-family: inherit;">.</span><br />
<span style="font-family: inherit;"><br /></span> <span style="font-family: inherit;"><i>While each of these advertising partners has their own Privacy Policy for their site, please visit the following link for Google Privacy Policy:</i> <a href="https://privacy.google.com/#" target="_blank">Google Privacy Policy</a></span><br />
<br />
These third-party ad servers or ad networks use technology to the advertisements and links that appear on <b><span style="font-family: "courier new" , "courier" , monospace;">http://</span><span style="font-family: "courier new" , "courier" , monospace;">installwithme.blogspot.in/</span></b> send directly to your browsers. They automatically receive your IP address when this occurs. Other technologies ( such as cookies, JavaScript, or Web Beacons ) may also be used by the third-party ad networks to measure the effectiveness of their advertisements and/or to personalize the advertising content that you see on this site.<br />
<br />
<b><span style="font-family: "courier new" , "courier" , monospace;">http://</span><span style="font-family: "courier new" , "courier" , monospace;">installwithme.blogspot.in/</span></b> has no access to or control over these cookies that are used by third-party advertisers.<br />
<br />
<b>Third Party Privacy Policies</b><br />
You should consult the respective privacy policies of these third-party ad servers for more detailed information on their practices as well as for instructions about how to opt-out of certain practices. <b><span style="font-family: "courier new" , "courier" , monospace;">http://</span><span style="font-family: "courier new" , "courier" , monospace;">installwithme.blogspot.in/</span></b>'s privacy policy does not apply to, and we cannot control the activities of, such other advertisers or web sites.<br />
<br />
If you wish to disable cookies, you may do so through your individual browser options. More detailed information about cookie management with specific web browsers can be found at the browsers' respective websites. Alternatively, you can always decide which cookies to accept – or whether to accept cookies at all – by going into your browser’s privacy settings.<br />
<br />
<b>Online Privacy Policy Only</b><br />
This privacy policy applies only to our online activities and is valid for visitors to our website and regarding information shared and/or collected there. This policy does not apply to any information collected offline or via channels other than this website.<br />
<br />
<b>Consent</b><br />
By using our website, you hereby consent to our privacy policy and agree to its terms.<br />
<br />
<b>Update</b><br />
This Privacy Policy was last updated on Thursday, January 19th, 2017.<br />
<br />
— * — * — * — * —Dhyanhttp://www.blogger.com/profile/14843781913134330016noreply@blogger.com