tag:blogger.com,1999:blog-8660690138480752342024-03-17T20:02:27.628-07:00Strive for the BestUnknownnoreply@blogger.comBlogger34125tag:blogger.com,1999:blog-866069013848075234.post-88738500783561044242016-03-28T10:33:00.000-07:002016-03-28T10:33:03.341-07:00Vagrant : An amazing tool to manage VMs<div>
Vagrant is an amazing tool for managing VMs. Why it is so amazing is because of the convenience it adds in the aspect of managing VMs. It can work with VirtualBox which makes it possible to get the advantage of vagrant for free.</div>
If you have installed <a href="https://www.vagrantup.com/downloads.html" target="_blank">Vagrant</a> and <a href="https://www.virtualbox.org/" target="_blank">VirtualBox</a> starting a vagrant and spawning up a virtual machine is super simple. You just need to enter 2 commands below.<br />
<br />
<span style="font-family: menlo; font-size: 11px;">vagrant init hashicorp</span><span style="font-family: menlo; font-size: 11px;">/precise64</span><br />
<span style="font-family: menlo; font-size: 11px;">vagrant up</span><br />
<br />
First command creates a configuration file in your current directory with the name "Vagrantfile" and this file can be used to configure the VMs as required. The second command will create and start the VM with the name "default". With these two commands, you will have your VM up and running in VirtualBox.<br />
<br />
But most of the time we may need to start several VMs and manage them. The Vagrantfile can be used to support that. Given below is a sample Vagrantfile (without comments) that was used to spawn up 3 VMs: vm1, vm2 and vm3 with the specified IPs. The memory of each VM, number of cpus, etc can be configured in the Vagrantfile as required.<br />
<br />
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
Vagrant.configure(2) do |config|</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
config.vm.box = "hashicorp/precise64"</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
config.vm.provider "virtualbox" do |vb|</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
vb.memory = "3072"</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
vb.cpus = 2</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
end</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal; min-height: 13px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
config.hostmanager.enabled = true</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
config.hostmanager.manage_host = false</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
config.hostmanager.ignore_private_ip = false</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
config.hostmanager.include_offline = true</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal; min-height: 13px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
config.vm.define "vm1" do |vm1|</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
vm1.vm.hostname = 'vm1-hostname'</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
vm1.vm.network "private_network", ip: "172.28.128.5"</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
end</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal; min-height: 13px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
config.vm.define "vm2" do |vm2|</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
vm2.vm.hostname = 'vm2-hostname'</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
vm2.vm.network "private_network", ip: "172.28.128.6"</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
end</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal; min-height: 13px;">
<br /></div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
config.vm.define "vm3" do |vm3|</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
vm3.vm.hostname = 'vm3-hostname'</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
vm3.vm.network "private_network", ip: "172.28.128.7"</div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
end</div>
<div style="line-height: normal;">
<div style="font-family: menlo; font-size: 11px;">
end</div>
<div style="font-family: menlo; font-size: 11px;">
<br /></div>
<div style="font-family: menlo; font-size: 11px;">
<br /></div>
Below are some useful commands that are be required to manage these VMs.<br /><ul>
<li>vagrant up vm1 (create vm1 if not created and start the vm1)</li>
<li>vagrant ssh vm1 (ssh into vm1)</li>
<li>vagrant halt vm1 (gracefully shutdown vm1)</li>
<li>vagrant destroy vm1 (destroy vm1)</li>
<li>vagrant status (shows status of the VMs created in current directory)</li>
<li>vagrant global-status (shows status of all the VMs in your host)</li>
</ul>
<div>
<br /></div>
<div>
And one another useful feature is the easiness of copying the files to your VM. You can simply copy whatever the files you need to the same directory where the Vagrantfile is and those files will be available in <span style="font-family: Menlo; font-size: 11px;">/vagrant </span>directory in your VM.</div>
<div>
Give it a try when you need to work with VMs.</div>
</div>
Unknownnoreply@blogger.com34tag:blogger.com,1999:blog-866069013848075234.post-47326412468412252522016-02-05T01:22:00.000-08:002016-02-05T01:22:01.672-08:00Do you want to deploy a cluster in a single click with single configuration file?<div style="-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; line-height: normal;">
<span style="font-family: inherit;"><span style="-webkit-text-stroke-width: initial;">Do you want to create a </span>hadoop<span style="-webkit-text-stroke-width: initial;"> cluster to test your map-reduce job? Are you postponing it thinking about the overhead of setting up the environment? </span><a href="http://www.karamel.io/" target="_blank">Karamel</a><span style="-webkit-text-stroke-width: initial;"> provides you the easiest way to do it. Karamel is a platform which supports convenient deployment orchestration of distributed system deployments. You can set up your cluster in </span>cloud<span style="-webkit-text-stroke-width: initial;"> with few simple steps. </span></span></div>
<div style="-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; line-height: normal; min-height: 13px;">
<span style="font-family: inherit;"><br /></span></div>
<span style="font-family: inherit;">Download the latest version of Karamel <a href="http://www.karamel.io/?q=content/install-karamel-linux" target="_blank">here</a>. You just need a configuration file describing how you need to deploy your cluster. The link provides all required information on setting up Karamel (you just need to extract the .tar file). Following video will help you to have a smooth floor in dealing with Karamel in doing your deployment and running experiments.</span><br />
<br />
<span style="font-family: inherit;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<iframe width="320" height="266" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/tCIA8_2dR14/0.jpg" src="https://www.youtube.com/embed/tCIA8_2dR14?feature=player_embedded" frameborder="0" allowfullscreen></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="font-family: inherit;"><br /><br /><br /><br /></span><br />
<div>
<br /></div>
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-866069013848075234.post-54351490355131429192016-02-04T03:59:00.000-08:002016-02-05T01:22:43.868-08:00Reproducible Stream Processing Benchmark to compare Apache Spark and Apache Flink on Cloud<div style="font-family: helvetica; line-height: normal;">
Stream processing is becoming a crucial requirement with the high volume of data generated and the need for real-time processing of those data. And the data processing platforms are trying to provide smart and efficient approaches for stream processing. </div>
<div style="font-family: helvetica; line-height: normal; min-height: 13px;">
<br /></div>
<div style="font-family: helvetica; line-height: normal;">
Yahoo has recently published a stream processing benchmark and has published the resources <a href="https://github.com/yahoo/streaming-benchmarks" target="_blank">here</a> to run the experiment in a single node. Since benchmarking stream processing is an interesting and important task, we wanted to reproduce the experiment on a clustered setup. </div>
<div style="font-family: helvetica; line-height: normal; min-height: 13px;">
<br /></div>
<div style="font-family: helvetica; line-height: normal;">
We created a reproducible experiment on Amazon EC2 to reproduce yahoo streaming benchmark on a cluster of Apache Spark and Apache Flink. You can find all the resources and in instruction <a href="https://github.com/karamel-lab/stream-processing-comparison" target="_blank">here</a> which will help you to reproduce our experiment. And more importantly, you can reproduce the experiment with different configurations conveniently by following the instruction in above-mentioned link.</div>
<div style="font-family: helvetica; line-height: normal; min-height: 13px;">
<br /></div>
<div style="font-family: helvetica; line-height: normal;">
Following are some of the application-level and system-level performance results that we obtained during the experiment.<br />
<br /></div>
<div style="font-family: helvetica; line-height: normal; min-height: 13px;">
<h4>
Application-level performance:</h4>
</div>
<div style="-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; font-family: Helvetica; font-size: 11px; line-height: normal; min-height: 13px;">
<br /></div>
<div style="font-family: helvetica; line-height: normal; min-height: 13px;">
<div class="separator" style="clear: both; font-size: 11px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUHRJMEDIV3nObBUG5kM13iKY17SouphPqrw89q_DFnZhZqmn0zKRwGgBeh3Dassg5ezvJYraaUO5fDG2so6v6bfrmNZYNqYSr82xQU7GLsE_pevl16LvKa6NpT_J3ZJjCc0ADmgQi2Rc/s1600/Screen+Shot+2016-02-04+at+12.39.04+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="419" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUHRJMEDIV3nObBUG5kM13iKY17SouphPqrw89q_DFnZhZqmn0zKRwGgBeh3Dassg5ezvJYraaUO5fDG2so6v6bfrmNZYNqYSr82xQU7GLsE_pevl16LvKa6NpT_J3ZJjCc0ADmgQi2Rc/s640/Screen+Shot+2016-02-04+at+12.39.04+PM.png" width="640" /></a></div>
<div class="separator" style="clear: both; font-size: 11px; text-align: center;">
<br /></div>
<h4>
System-level performance</h4>
<div>
<br /></div>
<div>
Memory:</div>
<div class="separator" style="clear: both; font-size: 11px; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; font-size: 11px; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; font-size: 11px; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; font-size: 11px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvZ5RUv18noCzCY-fleg5fUYZypf1gtwaDonhncNfXrXhi-o898DErZ3asppAszzQAJN6qg_AWDGulgvkSJ9deVe8GVcLN8KQLI4ZpzHchsMVlml985WBRTdAWqZyazr8ujYrG91Mnc4E/s1600/Screen+Shot+2016-02-04+at+12.39.36+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvZ5RUv18noCzCY-fleg5fUYZypf1gtwaDonhncNfXrXhi-o898DErZ3asppAszzQAJN6qg_AWDGulgvkSJ9deVe8GVcLN8KQLI4ZpzHchsMVlml985WBRTdAWqZyazr8ujYrG91Mnc4E/s640/Screen+Shot+2016-02-04+at+12.39.36+PM.png" width="528" /></a></div>
<div class="separator" style="clear: both; font-size: 11px; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
CPU:</div>
<div style="font-size: 11px;">
<br /></div>
<div class="separator" style="clear: both; font-size: 11px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1m1kp6U1yzDc_-aBABmFNT2yl3fC4uKOw1HrjpdgqrvbdEMYMQh-TswZv0NnVWSX5ulpYm9C-XKoIUtBuE-HKOwUaMd62IRoiwL0-Y6dx0QUpEd39kRzy03giQNCUqF6xK1dZu9O2pQ8/s1600/Screen+Shot+2016-02-04+at+12.39.50+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1m1kp6U1yzDc_-aBABmFNT2yl3fC4uKOw1HrjpdgqrvbdEMYMQh-TswZv0NnVWSX5ulpYm9C-XKoIUtBuE-HKOwUaMd62IRoiwL0-Y6dx0QUpEd39kRzy03giQNCUqF6xK1dZu9O2pQ8/s640/Screen+Shot+2016-02-04+at+12.39.50+PM.png" width="553" /></a></div>
<div style="font-size: 11px;">
<br /></div>
</div>
<div style="-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; font-family: Helvetica; font-size: 11px; line-height: normal; min-height: 13px;">
<span id="goog_162076911"></span><span id="goog_162076912"></span><br /></div>
<div style="-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; font-family: Helvetica; font-size: 11px; line-height: normal; min-height: 13px;">
<br /></div>
<div style="-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; font-family: Helvetica; font-size: 11px; line-height: normal; min-height: 13px;">
<br /></div>
<div style="font-family: helvetica; line-height: normal;">
The configurations and explanation of the results can be found in the stream processing evaluation section of <a href="http://www.scribd.com/doc/297923938/Apache-Spark-vs-Apache-Flink-Reproducible-Experiments-on-cloud" target="_blank">full report</a>.<br />
<br />
We have completed a performance comparison of batch processing as well for Apache Spark and Apache Flink to reproduce <a href="http://eastcirclek.blogspot.se/2015/06/terasort-for-spark-and-flink-with-range.html" target="_blank">DongWong’s performance comparison</a>.</div>
<div style="font-family: helvetica; line-height: normal; min-height: 13px;">
<br /></div>
<div style="font-family: helvetica; line-height: normal;">
The full project report can be found <a href="http://www.scribd.com/doc/297923938/Apache-Spark-vs-Apache-Flink-Reproducible-Experiments-on-cloud" target="_blank">here</a>.<br />
<br />
<h4>
</h4>
<h4>
Acknowledgement</h4>
<br />
<a href="https://www.sics.se/people/jim-dowling" target="_blank">Jim Dowling</a><br />
<a href="https://github.com/kamalhakim" target="_blank">Kamal Hakinzaheh</a><br />
<a href="https://github.com/shelan" target="_blank">Shelan Perera</a></div>
<div style="-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; font-family: Helvetica; font-size: 11px; line-height: normal; min-height: 13px;">
<br /></div>
<div style="-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; font-family: Helvetica; font-size: 11px; line-height: normal; min-height: 13px;">
<br /></div>
<div style="-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; font-family: Helvetica; font-size: 11px; line-height: normal; min-height: 13px;">
<br /></div>
<br />
<div style="-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; font-family: Helvetica; font-size: 11px; line-height: normal; min-height: 13px;">
<br /></div>
Unknownnoreply@blogger.com12tag:blogger.com,1999:blog-866069013848075234.post-63785072244087780262015-12-01T02:46:00.000-08:002015-12-01T02:46:05.337-08:00Computer users, relax your tired eyes using 20-20-20 ruleWe all know that using a computer for a longer time each day, makes your eyes tired. This is a simple rule which may help reduce your eyestrain and let your eyes relax for a while. It is recommended to stand up and stretch once in a while without sitting on your chair all the time. But sometimes it may not be possible to walk in every 30 minutes from your chair. But at least try following 20-20-20 rule to relax your eyes :)<br />
<br />
20-20-20 rule:<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8hW9b40SqRj_tWpMHKLjK8_df90HEGa1-iUEzghG6qw3FTfz-SMIzkZ1GItWxI77DF_1EsEjMWXZLh2Qnua7lt1Mmv8ol0TVm5FxLIGXedpn-bYjQWrhhBFrpTjGM5rvzVjl7TD16RWo/s1600/Screen+Shot+2015-12-01+at+11.40.34+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="125" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8hW9b40SqRj_tWpMHKLjK8_df90HEGa1-iUEzghG6qw3FTfz-SMIzkZ1GItWxI77DF_1EsEjMWXZLh2Qnua7lt1Mmv8ol0TVm5FxLIGXedpn-bYjQWrhhBFrpTjGM5rvzVjl7TD16RWo/s400/Screen+Shot+2015-12-01+at+11.40.34+AM.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And try to blink your eyes more so that it will help your eyes to avoid getting dry. </div>
Unknownnoreply@blogger.com21tag:blogger.com,1999:blog-866069013848075234.post-45235395597520434762015-11-04T00:05:00.000-08:002015-11-04T00:05:36.502-08:00Presentation tips and 10-20-30 Rule for PresentationsWhen it is required to do a presentation either it is business related or academic, we always want to make it attractive and smart. Following are some of the well known methods that I have been using.<br />
<br />
<ul>
<li>Use less text</li>
</ul>
We know that the audience will get board when you have a lot of text in your slides. If they do not get board, they will start reading the slides without listening to your talk. So you miss the change to emphasis what you want. Either way you loose :(<div>
So if you feel that should have text for a particular slide to explain it easier, try point format and be precise. 3, 4 bullet points with up to 6, 7 words per each bullet will be ideal.</div>
<div>
<br /><ul>
<li>Communicate your idea with pictures</li>
</ul>
We know that "A picture is worth a thousand words". It is always easy and clear to convey your idea through a picture than having a lot of text. (This is a very well known fact)</div>
<div>
<br /><ul>
<li>Use simple animations</li>
</ul>
If some complex concept or an algorithm should be presented, make some animated slides which can explain it easily than trying to struggle with all Xs and Ys. You may feel that it will be clear, but believe me it will not. Just try to memorize the very first time you got to know about that concept. Even though you have mastered it now, for the audience it may be the first time :)<div>
<br /></div>
<div>
And of course you should not have these complex explanations in your presentation if you do not think that you MUST have them.</div>
<div>
<br /><ul>
<li>Less slides and good formatting</li>
</ul>
Have some attractive formatting, so your audience will not get board seeing it. But of course I did not mean 'fancy' :)</div>
<div>
<br /><ul>
<li>10-20-30 Rule</li>
</ul>
This was a concept introduced by Guy Kawasaki who is a Silicon Valley marketing executive.</div>
<div>
In brief it says</div>
<div>
10 slides only</div>
<div>
20 minutes presentation time</div>
<div>
30 font size</div>
<div>
<a href="https://www.youtube.com/watch?v=-M13SObffog" target="_blank">Here</a> is his explanation on how it will be effective. </div>
<div>
<br /><div>
<br /></div>
<div>
And I have some final tip for the audience. If your colleague is doing a presentation for academic purposes and you are supposed to give feedback, please provide the real feedback you have. Do not say that it was amazing just because you think that your friend will feel bad if you didn't do so. I specifically mentioned academic because I believe when it comes to business, it is most probable to have the real feedback since it is business. :)</div>
<div>
<br /></div>
<div>
I personally had this practice of being nice and trying to avoid giving bad feedback and suddenly I realized that I am taking away the change of my colleague to further improve his/her presentation skills. This can be something simple like 'You spoke too fast' but if he improve that, it will help a lot to attract more audience next time. You can of course be polite and convey it nicely, so that it will really help the presenter to improve himself/herself. And may be you can give written feedback too.</div>
<div>
<br /></div>
<div>
So good luck with your next presentation :)</div>
<br /></div>
</div>
Unknownnoreply@blogger.com9tag:blogger.com,1999:blog-866069013848075234.post-13781731607237415162015-10-07T07:14:00.000-07:002015-11-03T22:49:38.309-08:00Singleton Pattern<div style="text-align: justify;">
This is one of the simplest, yet very useful design pattern. Singleton design pattern can be used when it is required to create just one object of a class. As an example, if you have a ApplicationManager class in your application where all other components need to get help from, you need to have access to ApplicationManager object. But just think that you need to share some objects through your ApplicationManager. Then of course you do not want to have different object referring to different ApplicationManager objects. You need to have one common object shared with all of them. And singleton pattern is the way to achieve this.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I believe an example code snippet will help a lot in understanding this simply.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
public class ApplicationManager {</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
private static ApplicationManager applicationManager = new ApplicationManager();</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
private ApplicationManager() { }</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
public static ApplicationManager getInstance() {</div>
<div style="text-align: justify;">
return applicationManager;</div>
<div style="text-align: justify;">
}</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
public void yourMethod() {</div>
<div style="text-align: justify;">
//code</div>
<div style="text-align: justify;">
}</div>
<div style="text-align: justify;">
}</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
So you see the constructor is private, so no one can initialize an object of ApplicationManager and if they want to use it, can call getInstance() method and use the already created static ApplicationManager object. So no more than one object is created and global access is provided.</div>
Unknownnoreply@blogger.com6tag:blogger.com,1999:blog-866069013848075234.post-35107209427210025642015-10-05T11:51:00.001-07:002015-10-07T06:03:20.116-07:00Producer Consumer Pattern<div style="text-align: justify;">
Producer Consumer Design Pattern is one of the mainly used design patterns. And I am pretty sure that, many who does not know that this is an example of a design pattern too have used it. This design pattern is mainly used to introduce decoupling between consuming something and the relevant producing procedure. In other words it implements an efficient and smooth data sharing between the producer of the data and the data consumer. This decoupling is mainly done maintaining a queue for the data items.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTxZ77lZagqn2ol8NlnkLtCd9g-xpv7NSWQ0IZni8g_XpjWHrkMwGxD_qWNPeM4e55FLzayHfpS2UZRLa9-PmCgEDk_GIL4eQ7Kto9j7gEpx9l0zzSc9WanhbRqkKWYnNIkmktdYLkycg/s1600/Screen+Shot+2015-10-05+at+8.23.42+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTxZ77lZagqn2ol8NlnkLtCd9g-xpv7NSWQ0IZni8g_XpjWHrkMwGxD_qWNPeM4e55FLzayHfpS2UZRLa9-PmCgEDk_GIL4eQ7Kto9j7gEpx9l0zzSc9WanhbRqkKWYnNIkmktdYLkycg/s640/Screen+Shot+2015-10-05+at+8.23.42+PM.png" width="640" /></a></div>
<br />
<br />
<br />
<div style="text-align: justify;">
By using a queue even the producer and consumer have different rates of producing and consuming data, the data sharing floor will be smooth through the queue. Producer do not have to wait until the consumer finishes data item 1 to deliver data item 2. And producer do not have any overhead of managing the produced items even though there are many consumers as far as all the consumers are consuming the items in that same queue.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
So this design pattern can be easily used to perform data sharing between the producer parties and consumer parties in order to achieve good synchronization among them.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
Unknownnoreply@blogger.com9tag:blogger.com,1999:blog-866069013848075234.post-41989273542558046692015-10-05T10:38:00.000-07:002015-11-03T22:50:27.191-08:00Importance of Design PatternsDesign Patterns is one of the most interesting topics in software development. They give well structured and standard solutions for solving common software implementation problems. To understand the design patterns, you should understand the problem that they solve. If you understand them, when you get some problem related to any of the design patterns you know, you can easily map the solution to your problem.<br />
<br />
But if ‘Design Patterns’ is a new term for you even though you are doing good software implementation may be still you don’t have to worry. Because may be you are already using design patterns without knowing the correct terminology for those patterns. Still knowing them will help you a lot in improving your implementation as well as it will make it easy for others to quickly understand the functionalities of your implementation. And it will help a lot in smoothly communicating your solutions to the others. As an example if you say that you are using Factory method to solve problem X, others will just understand it without you explaining how you are doing it.<br />
<br />
So Design patterns make your code handy, make it more readable and self explanative as well as will be helpful in smooth communication about your implementations.<br />
<br />
Here are some commonly used design patterns<br />
<br />
<ul>
<li><a href="http://blog.ashansa.org/2015/10/producer-consumer-pattern.html" target="_blank">Producer Consumer</a> (Oh... You were using this right? That is why I added it first )</li>
<li><a href="http://blog.ashansa.org/2015/10/singleton-pattern.html" target="_blank">Singleton</a></li>
<li>Factory/Builder</li>
<li>Observer</li>
<li>Decorator</li>
<li>Command</li>
<li>Proxy</li>
<li>Strategy</li>
</ul>
<br />
<!--div style="-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; font-family: Helvetica; font-size: 11px; line-height: normal;"><br />
and you can find examples linked to them which allows you to understand them more easily.</div>
<div style="-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; font-family: Helvetica; font-size: 11px; line-height: normal; min-height: 13px;">
<br />
</div-->Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-866069013848075234.post-17667908471755425052015-04-04T12:19:00.001-07:002015-04-04T12:19:16.701-07:00Avoid tracking your own page viewsAre you interested in finding out the stats of your website? I am sure you do not need to count your own page views (if you like to see the true value). If you are using blogger, it gives a simple option for this. But unfortunately it did not work for me. It says " There was an error while fetching stats. Please reload page."<br />
( you can try logging to your blogger account > Stats and click on "Don't track your own pageviews")<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHvr68UjP3xT5hvgjDhmfjN2ZN4vQ_1bOd2ApZvltrwaexu9k8H7CGLRJwDzZViQF-We5I3G1i02wuKaHjUqL_ptyoFm_HjqiAO71tcZ5YVp2fBWhVO-VVdRRslihyIlD2-E2cRAiCkqo/s1600/Screen+Shot+2015-04-04+at+8.07.06+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHvr68UjP3xT5hvgjDhmfjN2ZN4vQ_1bOd2ApZvltrwaexu9k8H7CGLRJwDzZViQF-We5I3G1i02wuKaHjUqL_ptyoFm_HjqiAO71tcZ5YVp2fBWhVO-VVdRRslihyIlD2-E2cRAiCkqo/s1600/Screen+Shot+2015-04-04+at+8.07.06+PM.png" height="212" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
After some effort could find another solution that could fix my issue and here it is...<br />
<br />
While been logged in to your account, open a new tab in the browser and enter<br />
<br />
<b>http://<span style="color: #e69138;">your_site.com</span>/b/statsBlockingCookie?action=SET&callback=__gwt_jsonp__.P2.onSuccess</b><br />
<br />
(make sure you replace the your_site.com with your site name)<br />
<br />
You will get the following response<br />
<pre style="white-space: pre-wrap; word-wrap: break-word;">// API callback
__gwt_jsonp__.P2.onSuccess({"status":"yes"});</pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;">
</pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><span style="white-space: normal;"><span style="font-family: Times, Times New Roman, serif;">Restart your browser and you can see that your page views are not counted in stats :)</span></span></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;">
</pre>
Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-866069013848075234.post-42056607200296540642015-04-01T15:15:00.000-07:002015-04-01T15:16:07.763-07:00Want to map your keyboard with the keyboard for your VM?Recently I had to work in VMs for few of my projects and the biggest burden is the changes in keyboard. I am using a Mac and wanted to use Windows on a VM for a project. It is really irritating when you have to work in both environments interchangeably. You will definitely press cmd + c to copy in your windows VM and wonder why cmd + v won't work :O<br />
<br />
I could find a simple solution for this with the help of <a href="http://www.autohotkey.com/" target="_blank">autohotkey</a>.<br />
So this is how I map the Mac keyboard to Windows VM. ( and I am using VirtualBox)<br />
<br />
<br />
<h3>
Map the hostkey of the VirtualBox to right command key.</h3>
<br />
Start VirtualBox<br />
Select <b>VirtualBox > Preferences</b> from the top menu<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXo9Q-nPK-sdCJh6-KNkZgjejy-LgZLg06E-WmLTij-J18Vg7fihYRcfJpfIhjtSz1PguilPHJtk3RBX4-BAqPPCgn6QG6Qo89BttPw2p3e_GLaSE5SJPAlCRd4hhGXD7DpWh-ft4zNR4/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXo9Q-nPK-sdCJh6-KNkZgjejy-LgZLg06E-WmLTij-J18Vg7fihYRcfJpfIhjtSz1PguilPHJtk3RBX4-BAqPPCgn6QG6Qo89BttPw2p3e_GLaSE5SJPAlCRd4hhGXD7DpWh-ft4zNR4/s1600/1.png" height="374" width="640" /></a></div>
<br />
<br />
<b>Input > Virtual Machine</b><br />
Search for 'host key combination' and set the right command key for the key combination<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQnj3s2blaDqpoZ8LHvhxuJ2E4k9LiyGqrc2ZLh5qUZ0F8Fj7biHDZnJLkyX6kqyb0wwaCpOMmy1bgxEuhESMNndPVDkbBBxf-QKDfhpRKsx13LkRNi1F7y48zJDvQbF4q9Zuxs-qn32I/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQnj3s2blaDqpoZ8LHvhxuJ2E4k9LiyGqrc2ZLh5qUZ0F8Fj7biHDZnJLkyX6kqyb0wwaCpOMmy1bgxEuhESMNndPVDkbBBxf-QKDfhpRKsx13LkRNi1F7y48zJDvQbF4q9Zuxs-qn32I/s1600/2.png" height="384" width="640" /></a></div>
<br />
<br />
<h3>
Setup the VM to have changes</h3>
<div>
<br /></div>
<div>
Download <a href="http://www.autohotkey.com/" target="_blank">autohotkey</a> to VM</div>
<div>
Create a file in VM with extension .ahk ( ie: script.ahk )</div>
<div>
Following is a sample content for the file with some of the most useful key mappings</div>
<div>
<br /></div>
<div>
<div>
#SingleInstance force</div>
<div>
#r::Send ^r ;reload</div>
<div>
#z::Send ^z ; undo</div>
<div>
#y::Send ^y ; redo</div>
<div>
#f::Send ^f ; find inside apps</div>
<div>
#c::Send ^c ; copy</div>
<div>
#x::Send ^x ; cut</div>
<div>
#v::Send ^v ; paste</div>
<div>
#t::Send ^t ; new tab, Firefox</div>
<div>
#s::Send ^s ; save inside apps</div>
<div>
LWin & Tab::AltTab ; the motherlode, alt-tab!</div>
<div>
#b::Send ^b ; bold / bookmarks in Firefox</div>
<div>
#i::Send ^i ; italic</div>
<div>
#u::Send ^u ; underline</div>
<div>
#a::Send ^a ; select all</div>
</div>
<div>
<br /></div>
<div>
Save the content and save the file.</div>
<div>
Right click on file and do 'run as administrator' and you are ready to go... :)</div>
<div>
<br /></div>
<div>
<br /></div>
<h3>
Add the script to the Startup Programs</h3>
<div>
<br /></div>
<div>
Add your file to Startup folder and you will have no issue with VM restarts...</div>
<div>
<b>Start > Program Files > Startup</b></div>
<div>
<b><br /></b></div>
<div>
Hope you will find your life with VMs much more easier with this.</div>
<div>
<br /></div>
<div>
<!--EndFragment--></div>
<br />Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-866069013848075234.post-14184613198878319782015-03-21T06:02:00.002-07:002015-03-21T06:02:47.295-07:00Need to run many instances of your project in visual studio?<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Solution is simple.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Right click on your solution</div>
<div class="MsoNormal">
<b>Set Startup Projects</b></div>
<div class="MsoNormal">
Select ‘<b>Multiple startup projects</b>’</div>
<div class="MsoNormal">
And select ‘Start’ option for your projects in the list.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
And now when you hit start button, all the project you selected will be started.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Well, you need several instances of the same project to be started?</div>
<div class="MsoNormal">
Right click on the project</div>
<div class="MsoNormal">
<b>Debug > Start New Instance</b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
(This option will be useful to interestingly try out the <a href="http://blog.ashansa.org/2015/03/building-net-remoting-sample-step-by.html" target="_blank">Chat Application</a> we developed previously. Because with more chat clients, it will be more interesting )</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-866069013848075234.post-83626036684537597802015-03-20T17:03:00.000-07:002015-03-20T17:03:59.841-07:00Building .NET Remoting sample (Step by Step)<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
I am new to .Net and for one of my projects I had to use .NET Remoting. It was bit hard to find an end to end sample for a beginner even though there are code snippets describing each functionality. So I felt that it will be useful to share this with you.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
I am going to give step by step details so that someone who is not familiar with visual studio can also follow and build the sample without any issue. (I am going to use visual studio which is most widely used IDE for .NET)</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
.NET Remoting is a mechanism that is used to access the remote services across network. (If you are familiar with WebServices the requirement which Remoting fulfills is similar to a WebService. But Remoting works with remote objects)</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
We are going to implement a simple chat service using .NET Remoting. We will need to implement 3 modules for this. </div>
<div class="MsoNormal">
</div>
<ul>
<li>Shared Library</li>
<li>Server side implementation</li>
<li>Client side implementation </li>
</ul>
<div>
<br /></div>
<br />
<div>
<h3>
Implementing Shared Library</h3>
<div>
</div>
<div>
We will first create the shared library because both the client module and the server module is going to need it.</div>
<div>
The shared library is used to define the remote objects that one party is going to expose to the other party. In our chat example we will need a remote object that server expose to client which allows sending messages. And another object that client expose to server which allows receiving messages. (All this will be very clear when you start building the project, so don’t worry )</div>
<div>
</div>
<div>
So let’s start creating the project.</div>
<div>
</div>
<div>
<b>File > New > Project</b></div>
<div>
Select ‘Class Library’ and give the name as ‘ChatLib’ in the field below.</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA1-n5WYvISr6gp2Oyu-RuZbKkabn5vhH7_SGZZSbUazZEjXPsn-I9EeYkFF142KK0rZou8TIdPaKP-p07XiTttrgwCehOLGDx31os2ESqJOXAf6YM5LQ4I8ERjkAhR1LrFW-p9NDIdkI/s1600/create-library.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA1-n5WYvISr6gp2Oyu-RuZbKkabn5vhH7_SGZZSbUazZEjXPsn-I9EeYkFF142KK0rZou8TIdPaKP-p07XiTttrgwCehOLGDx31os2ESqJOXAf6YM5LQ4I8ERjkAhR1LrFW-p9NDIdkI/s1600/create-library.png" height="388" width="640" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
We need to have 2 Interfaces for the two remote objects exposed by the server and client. So let’s create two classes ClientLib and ServerLib in our Chat lib project.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
In solution explorer, right click on ChatLib</div>
<div class="MsoNormal">
<b>Add > New Item > Interface</b></div>
<div class="MsoNormal">
And give the name for the interface in the textbox below. (In this sample I am going to use IService for the interface name)</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpGaDFhCvKnDxFtnylGhVRocKWK53ki3jhFyXiY-4uf4-iYm12XZ1XxR0STQsb1Mb1NH9mXKE0As7kUyIZ0aUsz2g7As5dqrnl-TLfdidjnxbCSkb6CEpn_P0o0JoO3NqlTqqcfAjAJXM/s1600/IService.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpGaDFhCvKnDxFtnylGhVRocKWK53ki3jhFyXiY-4uf4-iYm12XZ1XxR0STQsb1Mb1NH9mXKE0As7kUyIZ0aUsz2g7As5dqrnl-TLfdidjnxbCSkb6CEpn_P0o0JoO3NqlTqqcfAjAJXM/s1600/IService.png" height="394" width="640" /></a></div>
<br />
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Now add the methods that we are going to expose</div>
<div class="MsoNormal">
<i>Register</i></div>
<div class="MsoNormal">
<i>SendMessage</i></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
using System;</div>
<div class="MsoNormal">
using System.Collections.Generic;</div>
<div class="MsoNormal">
using System.Linq;</div>
<div class="MsoNormal">
using System.Text;</div>
<div class="MsoNormal">
using System.Threading.Tasks;</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
namespace ChatLib</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
public interface IService</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
void register(string userName, string url);</div>
<div class="MsoNormal">
void sendMessage(string userName, string msg);</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Create interface IClientService as same as above and add the method</div>
<div class="MsoNormal">
receiveMessage</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: 'Menlo Regular'; font-size: 15px;"><br /></span></div>
<div class="MsoNormal">
using System;</div>
<div class="MsoNormal">
using System.Collections.Generic;</div>
<div class="MsoNormal">
using System.Linq;</div>
<div class="MsoNormal">
using System.Text;</div>
<div class="MsoNormal">
using System.Threading.Tasks;</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
namespace ChatLib</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
public interface IClientService</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
void receiveMessage(string sender, string msg);</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Now you are done with the ChatLib component</div>
<div class="MsoNormal">
<br /></div>
<h3>
Server Side Implementation</h3>
<div class="MsoNormal">
Now lets add the server side code. For this do right click on solution</div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdAUdawL5228R11G01dbeAFFZKr61Q4Z-UHxaSLutLjWg4LWYxhJih0ihN1I3NOyBC2Y-s8-tMepBR4UG0aLFNd2qrT4-hCGXm_6XMelBfWdeaKGReYtrDNs72sWPFFhVMQ2eYuHCqH6I/s1600/Solution.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdAUdawL5228R11G01dbeAFFZKr61Q4Z-UHxaSLutLjWg4LWYxhJih0ihN1I3NOyBC2Y-s8-tMepBR4UG0aLFNd2qrT4-hCGXm_6XMelBfWdeaKGReYtrDNs72sWPFFhVMQ2eYuHCqH6I/s1600/Solution.png" height="108" width="640" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Menlo Regular"; font-size: 11.0pt;"><br /></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b>Add > New Project > Console App</b></div>
<div class="MsoNormal">
And give the name as ServerApp</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXNMpcP35DEzA5ZpAJkNRcfWtdsJE_AzMsC0NHjt0rb3XgE7oB3uuGw1_sni60jZmXj5KL-Q7S1mY6CcHlMLfgpeJMIt6q7L53NISdtSZIRF6RiYfdtWs2ILhyphenhyphen25Xh39R7Jwi9qoX3MPw/s1600/ServerApp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXNMpcP35DEzA5ZpAJkNRcfWtdsJE_AzMsC0NHjt0rb3XgE7oB3uuGw1_sni60jZmXj5KL-Q7S1mY6CcHlMLfgpeJMIt6q7L53NISdtSZIRF6RiYfdtWs2ILhyphenhyphen25Xh39R7Jwi9qoX3MPw/s1600/ServerApp.png" height="396" width="640" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Menlo Regular"; font-size: 11.0pt;"><br /></span></div>
<div class="MsoNormal">
The new project will be visible along with ChatLib under solution view.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Since we are going to have the implementation of the IService in this module we need to add ChatLib as a reference to our new project. To do that right click on ServerApp</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b>Add Reference > Solution > Projects</b></div>
<div class="MsoNormal">
Tick ChatLib project which is under <b>Solutions > Projects</b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
We need one more reference</div>
<div class="MsoNormal">
<b>Assemblies > Framework</b></div>
<div class="MsoNormal">
Tick System.Runtime.Remoting</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Menlo Regular"; font-size: 11.0pt;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-dbyLQ1QsL44pqFU2q-FVYE45JkT1wbrWO2dBHCUTpd5fY7R87NVQ7d2d6J9DppTKCrI9bfzh8QJrGRo-ph6shVgKyQuDu3ApBpXRTyk-xzYVnU7oyZ2oaodWKdaU8rvrf7Bblg0x0VI/s1600/Remoting_reference.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-dbyLQ1QsL44pqFU2q-FVYE45JkT1wbrWO2dBHCUTpd5fY7R87NVQ7d2d6J9DppTKCrI9bfzh8QJrGRo-ph6shVgKyQuDu3ApBpXRTyk-xzYVnU7oyZ2oaodWKdaU8rvrf7Bblg0x0VI/s1600/Remoting_reference.png" height="440" width="640" /></a></div>
<div class="MsoNormal">
<span style="font-family: "Menlo Regular"; font-size: 11.0pt;"><br /></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Here is the code for ServerApp (to make it easy I am going to add the whole code to one file here)</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: 'Menlo Regular'; font-size: 15px;"><br /></span></div>
<div class="MsoNormal">
using System;</div>
<div class="MsoNormal">
using System.Collections.Generic;</div>
<div class="MsoNormal">
using System.Linq;</div>
<div class="MsoNormal">
using System.Text;</div>
<div class="MsoNormal">
using System.Threading.Tasks;</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
using ChatLib;</div>
<div class="MsoNormal">
using System.Runtime.Remoting;</div>
<div class="MsoNormal">
using System.Runtime.Remoting.Channels;</div>
<div class="MsoNormal">
using System.Runtime.Remoting.Channels.Tcp;</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
namespace ServerApp</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
class Program</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
static void Main(string[] args)</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
TcpChannel channel = new TcpChannel(9443);</div>
<div class="MsoNormal">
ChannelServices.RegisterChannel(channel, true);</div>
<div class="MsoNormal">
RemotingConfiguration.RegisterWellKnownServiceType(typeof(Server),</div>
<div class="MsoNormal">
"ChatServerService", WellKnownObjectMode.Singleton);</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
System.Console.WriteLine("Server...... press any key");</div>
<div class="MsoNormal">
System.Console.ReadLine();</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
public class Server : System.MarshalByRefObject, IService</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
public Dictionary<string string=""> users = new Dictionary<string string="">();</string></string></div>
<div class="MsoNormal">
public TcpChannel channel;</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
public Server()</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
channel = new TcpChannel();</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
public void register(string userName, string port)</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
users.Add(userName, port);</div>
<div class="MsoNormal">
Console.WriteLine("user added: " + userName); </div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
public void sendMessage(string sender, string msg)</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
Console.WriteLine("msg : " + msg + " received from " + sender);</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
foreach(var item in users)</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
//send msg to all clients </div>
<div class="MsoNormal">
IClientService clientService = (IClientService)Activator.GetObject(typeof(IClientService),</div>
<div class="MsoNormal">
"tcp://localhost:" + item.Value + "/ChatClientService");</div>
<div class="MsoNormal">
if (item.Key != sender)</div>
<div class="MsoNormal">
clientService.receiveMessage(sender, msg);</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Now as the same way you created the ServerApp, create another console application for the ClientApp too and add the same references (ChatLib and System.Runtime.Remoting )</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: 'Menlo Regular'; font-size: 15px;"><br /></span></div>
<div class="MsoNormal">
using System;</div>
<div class="MsoNormal">
using System.Collections.Generic;</div>
<div class="MsoNormal">
using System.Linq;</div>
<div class="MsoNormal">
using System.Text;</div>
<div class="MsoNormal">
using System.Threading.Tasks;</div>
<div class="MsoNormal">
using ChatLib;</div>
<div class="MsoNormal">
using System;</div>
<div class="MsoNormal">
using System.Runtime.Remoting;</div>
<div class="MsoNormal">
using System.Runtime.Remoting.Channels;</div>
<div class="MsoNormal">
using System.Runtime.Remoting.Channels.Tcp;</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
namespace ClientApp</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
class Program </div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
static string userName;</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
static void Main(string[] args)</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
Console.WriteLine("Enter username:");</div>
<div class="MsoNormal">
userName = Console.ReadLine();</div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
Console.WriteLine("Enter port:");</div>
<div class="MsoNormal">
string port = Console.ReadLine();</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Program program = new Program();</div>
<div class="MsoNormal">
program.register(port);</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Console.WriteLine("Now you can send messages");</div>
<div class="MsoNormal">
program.sendMessage();</div>
<div class="MsoNormal">
Console.ReadLine();</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
public void register(string port)</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
TcpChannel clientChannel = new TcpChannel(Convert.ToInt32(port));</div>
<div class="MsoNormal">
ChannelServices.RegisterChannel(clientChannel, true);</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
ClientService clientLib = new ClientService();</div>
<div class="MsoNormal">
RemotingServices.Marshal(clientLib, "ChatClientService", typeof(ClientService));</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
IService service = (IService)Activator.GetObject(typeof(IService),</div>
<div class="MsoNormal">
"tcp://localhost:9443/ChatServerService");</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
service.register(userName, port);</div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
public void sendMessage()</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
Console.WriteLine("mmmmm");</div>
<div class="MsoNormal">
IService service = (IService)Activator.GetObject(typeof(IService),</div>
<div class="MsoNormal">
"tcp://localhost:9443/ChatServerService");</div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
while (true)</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
Console.WriteLine("me:");</div>
<div class="MsoNormal">
string msg = Console.ReadLine();</div>
<div class="MsoNormal">
service.sendMessage(userName, msg);</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
public class ClientService : MarshalByRefObject, IClientService</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
public void receiveMessage(string sender, string msg)</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
Console.WriteLine(sender + " : " + msg);</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
<span style="font-family: 'Menlo Regular'; font-size: 15px;"><br /></span></div>
<div class="MsoNormal">
OK... You are done with your chat application with .NET Remoting. Now you can run the application and see.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]-->
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>JA</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
<w:UseFELayout/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="276">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]-->
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:Cambria;
mso-ascii-font-family:Cambria;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Cambria;
mso-hansi-theme-font:minor-latin;}
</style>
<![endif]-->
<!--StartFragment-->
<!--EndFragment--><br />
<div class="MsoNormal">
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-866069013848075234.post-5916442141281016872015-03-08T07:54:00.002-07:002015-03-08T07:57:40.889-07:00I love Traveling...<script src="http://cdn.amcharts.com/lib/3/ammap.js" type="text/javascript"></script><br />
<script src="http://cdn.amcharts.com/lib/3/maps/js/worldHigh.js" type="text/javascript"></script><br />
<script src="http://cdn.amcharts.com/lib/3/themes/dark.js" type="text/javascript"></script><br />
<div id="mapdiv" style="height: 450px; width: 100%;">
</div>
<div style="background-color: #7497cc; color: #e0bb7b; font-size: 70%; margin-top: 1px; padding: 5px 0; text-align: center; width: 100%;">
<a href="http://www.amcharts.com/visited_countries/" style="color: #e0bb7b;">Create your own visited countries map</a> or check out the <a href="http://www.amcharts.com/" style="color: #e0bb7b;">JavaScript Charts</a>.</div>
<script type="text/javascript">
var map = AmCharts.makeChart("mapdiv",{
type: "map",
theme: "dark",
pathToImages : "http://cdn.amcharts.com/lib/3/images/",
panEventsEnabled : true,
backgroundColor : "#7497CC",
backgroundAlpha : 1,
zoomControl: {
panControlEnabled : true,
zoomControlEnabled : true
},
dataProvider : {
map : "worldHigh",
getAreasFromMap : true,
areas :
[
{
"id": "BE",
"showAsSelected": true
},
{
"id": "ES",
"showAsSelected": true
},
{
"id": "FR",
"showAsSelected": true
},
{
"id": "IT",
"showAsSelected": true
},
{
"id": "PT",
"showAsSelected": true
},
{
"id": "VA",
"showAsSelected": true
},
{
"id": "US",
"showAsSelected": true
},
{
"id": "IN",
"showAsSelected": true
},
{
"id": "LK",
"showAsSelected": true
},
{
"id": "TH",
"showAsSelected": true
}
]
},
areasSettings : {
autoZoom : true,
color : "#E0BB7B",
colorSolid : "#419E57",
selectedColor : "#419E57",
outlineColor : "#666666",
rollOverColor : "#F5BB29",
rollOverOutlineColor : "#000000"
}
});
</script><br />
<br />
Sri Lanka (Home Country)<br />
Thailand<br />
Idaho (US)<br />
Seattle (US)<br />
Italy<br />
India<br />
Vatican City<br />
Portugal<br />
Spain<br />
France<br />
Belgium<br />
<!-- generated from http://www.amcharts.com/visited_countries/#BE,ES,FR,IT,PT,VA,US,IN,LK,TH --><br />Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-866069013848075234.post-59858147567304274252015-02-19T12:42:00.001-08:002015-02-19T12:42:55.910-08:00Changing font style in Tumblr posts <a href="https://www.tumblr.com/">Tumblr</a> is a simple and nice microblogging site. I wanted to use it for very short posts which I think are important. But when I started using Tumblr for this I felt that the font size of the posts are bit bigger. ( This may not be the case if you create posts with a considerable content. But it my case I mostly wanted to post few lines of posts, so the title of the posts looked bit bigger than expected)<br />
<br />
I could not find a simple setting to change the font size of the post titles, but I could find a simple way to do that by editing the html code.<br />
<br />
1. Go to the home page of your Tumblr account and click on 'Customize' menu<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNMFfpCRY0hG5cjp_xb_n_Q6349Pw5Hr5hAsc2qfjQZYu9VZvx70z0EhGfdMdp511iaB5FNTa33TP_k-gSLnD98fUomJcGi8hiZmH8bRBgcpAvI8Z3obAMuM0L8Qw5n1K1gOEUxBbEGsE/s1600/Screen+Shot+2015-02-19+at+8.23.28+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNMFfpCRY0hG5cjp_xb_n_Q6349Pw5Hr5hAsc2qfjQZYu9VZvx70z0EhGfdMdp511iaB5FNTa33TP_k-gSLnD98fUomJcGi8hiZmH8bRBgcpAvI8Z3obAMuM0L8Qw5n1K1gOEUxBbEGsE/s1600/Screen+Shot+2015-02-19+at+8.23.28+PM.png" height="179" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
2. In the left side panel, select 'Edit HTML'</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXKeJiN7hPNd4g1k8eWpkWTmZKa_vxI63sZDkaJ2-puQ78ii8zHJcdBJzATy6UNKSlOAQ69jsMDeVOwWZcVzKy5Uk12EPSlS250XdHbMTgyNH27J15R7BiClijYhRUPfmjodvIzfjep64/s1600/Screen+Shot+2015-02-19+at+8.24.16+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXKeJiN7hPNd4g1k8eWpkWTmZKa_vxI63sZDkaJ2-puQ78ii8zHJcdBJzATy6UNKSlOAQ69jsMDeVOwWZcVzKy5Uk12EPSlS250XdHbMTgyNH27J15R7BiClijYhRUPfmjodvIzfjep64/s1600/Screen+Shot+2015-02-19+at+8.24.16+PM.png" height="320" width="231" /></a></div>
<div>
<br /></div>
<div>
3. Search for 'block:Posts' section in the html code. (use ctrl + f to get the search box )</div>
<div>
Then you can see the 'block:Title' section in that. You can add the font style that you need for the title of the posts in that section.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_3aEF9bpw6imsaeFbW8T8w4oH5ScgrmzXFp2LgMHPXxPVESXMAcIuBqp_YQCcPFtb4AwXbHZtI2Bp6UF1CHjMpeE1rUCgY9er19j77FpELAGxkpBQKmUVmcnFQ1II_lzv4RShEabQWco/s1600/Screen+Shot+2015-02-19+at+8.28.41+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_3aEF9bpw6imsaeFbW8T8w4oH5ScgrmzXFp2LgMHPXxPVESXMAcIuBqp_YQCcPFtb4AwXbHZtI2Bp6UF1CHjMpeE1rUCgY9er19j77FpELAGxkpBQKmUVmcnFQ1II_lzv4RShEabQWco/s1600/Screen+Shot+2015-02-19+at+8.28.41+PM.png" height="340" width="400" /></a></div>
<div>
<br /></div>
<div>
4. You can use 'Update Preview' button and see how the new font style looks like.</div>
<div>
Make the changes you need and hit 'Save' and you have what you need.</div>
Unknownnoreply@blogger.com7tag:blogger.com,1999:blog-866069013848075234.post-5070364256492477492015-01-25T10:49:00.002-08:002015-02-01T11:02:23.888-08:00Issue in put files to hadoop - 0 datanodes runningI setup hadoop as I have described in my previous posts. While I was working in some interesting projects on Map-Reduce, I faced an issue on sending some of my local files to the hdfs node. I have started dfs already, but exception says<br />
<pre class="Java" name="java"><div class="MsoListParagraphCxSpMiddle">14/10/25 17:46:20 WARN hdfs.DFSClient: DataStreamer Exception
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /user/ashansa/input._COPYING_ could only be replicated to 0 nodes instead of minReplication (=1). There are 0 datanode(s) running and no node(s) are excluded in this operation.
at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget(BlockManager.java:1471)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:2791)
at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(NameNodeRpcServer.java:606)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addBlock(ClientNamenodeProtocolServerSideTranslatorPB.java:455)
at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:585)</div></pre>I faced this issue several times, so I think it will be helpful if I tell you how to overcome this issue. ( I believe this is a common issue we get while running hdfs, since I got the same issue several times and I found that many others also have faced the same issue )<br />
<br />
<h4>What worked for me?</h4><div><br />
</div>1. Stop the hadoop cluster with <br />
bin/stop-all.sh<br />
<br />
2. Clean hadoop tmp directory<br />
You can find the path to your hadoop tmp directory in hdfs-site.xml.<br />
Check for the following tag in hdfs-site.xml file.<br />
<</>name>hadoop.tmp.dir<</>/name><br />
<</>value>root/data/hdfstmp<</>/value><br />
You can find the path to your hadoop temp directory in <</>value> tag.<br />
<br />
3. Format node<br />
bin/hadoop namenode -format<br />
<br />
4. Start hadoop cluster<br />
bin/start-all.sh<br />
<br />
With these few simple steps, I was able to overcome this issue.<br />
Hope this will help you too.Unknownnoreply@blogger.com51tag:blogger.com,1999:blog-866069013848075234.post-87105182862270975402014-11-07T11:00:00.000-08:002014-11-07T11:00:15.865-08:00Specify download directory at the time of downloading - SafariWhen I download something I used to save it to a relevant directory in my machine. When I moved to Mac and to Safari, one of the most inconvenient things I experienced was that Safari download everything to the download directory and I cannot choose the place at the time of downloading (Even though I can change the path from downloads directory to some other directory, it downloads everything to that and it was not the thing I was looking for)<br />
<br />
After much trouble going through different sources finally found something reasonable. Since I saw that there are many more people out there with the same problem thought that it would be useful to share this simple tip (though the tip is simple, it was very useful to me + had to spend a considerable amount of time to find this out)<br />
<br />
So simply if you need to specify the download directory at the time of downloading, without just clicking the link to download<br />
<br />
<b>Right click on link and choose ‘Download Linked File As…’</b><br />
<br />
This will do the trick.<br />
Hope this would make your life easier with Safari ☺<br />
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-866069013848075234.post-34855685664386876492014-11-01T12:39:00.001-07:002014-11-07T11:06:31.761-08:00Run a jar file in command lineThis is a very simple and short post on running a jar file in command line.<br />
Simplest command that you can try is<br />
java –jar [jarFileName].jar<br />
<br />
But you may need to have the MANIFEST file in the jar to run it simply with the above command.<br />
<br />
<b>So how to bundle MANIFEST.MF to your jar?</b><br />
<br />
You can add the following maven plugin to your pom.xml and get it done. Remember to add the main class name of your app here.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQjDT22weyRX8SzLQ9fTjh9DBmW81Vo8fJu1bKnrbmsh_ZlBo9T3x6sykVcNo4QKyGlRgWea6F0UiMfY7hvPzauNmefCvO6MqzXg3e7Va9QFh1jAyYlPT-1K0rau9WWFPiJbkkG7Jz3aI/s1600/Screen+Shot+2014-11-01+at+7.23.54+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQjDT22weyRX8SzLQ9fTjh9DBmW81Vo8fJu1bKnrbmsh_ZlBo9T3x6sykVcNo4QKyGlRgWea6F0UiMfY7hvPzauNmefCvO6MqzXg3e7Va9QFh1jAyYlPT-1K0rau9WWFPiJbkkG7Jz3aI/s1600/Screen+Shot+2014-11-01+at+7.23.54+PM.png" height="205" width="400" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><br />
</div><br />
<b>How to run the jars with external dependencies?</b><br />
<br />
If you need to use the simple command java –jar [jarFileName].jar to run your application which has external dependencies, you can bundle the dependencies you need to the executable jar itself. Again use the below maven plugin to get it done.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb_Wy1EE67w5OUC5cdYlHSgSnRIeYq8aPxpigGhdH3WnENoCIhs-hkPMl_AadmqGF1JHpUoHwiSKJVdF5UCuMLXfdI4AbKxgbM6qXUi15dOYomftTMrTuGJJIWnjNzQ94XvfT7_dgFipI/s1600/Screen+Shot+2014-11-01+at+7.30.22+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb_Wy1EE67w5OUC5cdYlHSgSnRIeYq8aPxpigGhdH3WnENoCIhs-hkPMl_AadmqGF1JHpUoHwiSKJVdF5UCuMLXfdI4AbKxgbM6qXUi15dOYomftTMrTuGJJIWnjNzQ94XvfT7_dgFipI/s1600/Screen+Shot+2014-11-01+at+7.30.22+PM.png" height="291" width="400" /></a></div><br />
<br />
<br />
The highlighted part is doing this for you and the part above is to bundle MANIFEST.MF file to that jar file too.Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-866069013848075234.post-84049015128650250672014-10-30T13:48:00.001-07:002014-11-07T11:01:43.198-08:00Hadoop - pseudo distributed mode setup<br />
You can simply make your <a href="http://blog.ashansa.org/2014/10/setup-hadoop-in-mac.html">standalone hadoop setup</a> to a pseudo distributed mode with following changes<br />
<br />
<ul><li>In HADOOP_HOME/etc/hadoop/core-site.xml, add</li>
</ul><div><pre class="Cpp" name="code"><configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration></pre></div><div><span style="font-family: Courier New, Courier, monospace;"></span></div><br />
<ul><li>In HADOOP_HOME/etc/hadoop/hdfs-site.xml, add</li>
</ul><ul><pre class="Cpp" name="code"><configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration></pre><pre style="font-size: 13px; padding: 0px;"></pre><li>Make sure that you can connect to localhost with ssh.</li>
</ul><div><br />
</div><h3>Start and test your hadoop setup</h3><div><br />
</div><div><ul><li>Fist navigate to HADOOP_HOME</li>
</ul></div><div><ul><li>Format the hadoop file system</li>
</ul></div><div><span class="Apple-tab-span" style="white-space: pre;"> </span> /bin/hdfs namenode –format</div><div><ul><li>Start Name node and Data node</li>
</ul></div><div><span class="Apple-tab-span" style="white-space: pre;"> </span> /sbin/start-dfs.sh<span class="Apple-tab-span" style="white-space: pre;"> </span></div><div><br />
</div><div><ul><li>Now you should be able to browse the hadoop web interface through</li>
</ul></div><div><span class="Apple-tab-span" style="white-space: pre;"> </span> <a href="http://localhost:50070/">http://localhost:50070</a></div><div> And your hadoop file system under</div><div><span class="Apple-tab-span" style="white-space: pre;"> </span> Utilities > browse the file system</div><div><br />
</div><div><ul><li>Add /user/<username> to hadoop file system</username></li>
</ul></div><div><span class="Apple-tab-span" style="white-space: pre;"> </span> hdfs dfs –mkdir /user</div><div><span class="Apple-tab-span" style="white-space: pre;"> </span> hdfs dfs –mkdir /user/<username></username></div><div> You will be able to see these directories when you browse the file system now. And you can list the files with</div><div><span class="Apple-tab-span" style="white-space: pre;"> </span> hdfs dfs –ls <path> ( ie: hdfs dfs –ls / )</path></div><div><br />
</div><div><ul><li>Copy the input file to the hadoop file system</li>
</ul></div><div><span class="Apple-tab-span" style="white-space: pre;"> </span> hdfs dfs –put <local file="" path=""> <path dfs="" in=""></path></local></div><div><span class="Apple-tab-span" style="white-space: pre;"> </span> ie: hdfs dfs –put myinput input</div><div>and the file will be copied to /user/<username>/input</username></div><div><br />
</div><div><ul><li>Run the application with</li>
</ul></div><div><span class="Apple-tab-span" style="white-space: pre;"> </span> hadoop jar [local path to jar file] [path to main class] [input path in dfs] [output location in dfs]</div><div><span class="Apple-tab-span" style="white-space: pre;"> </span> ie: hadoop jar myapp.jar test.org.AppRunner input output</div><div><br />
</div><div>Result file: part-r-00000 should be saved in the output directory of dfs ( /user/[username]<username>/output</username></div><div><br />
</div>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-866069013848075234.post-19956405459062782182014-10-28T23:40:00.002-07:002014-11-07T11:01:48.548-08:00Setup Hadoop in Mac<div class="MsoNormal"><span style="font-family: Arial, Helvetica, sans-serif;">It is really simple to setup hadoop in Mac. I tried the latest available version at the moment. ( hadoop-2.5.1 ) You can setup hadoop in standalone mode or pseudo-distributed mode in your local machine. By following the below steps you will be able to setup hadoop in your machine in standalone mode.<o:p></o:p></span></div><!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:AllowPNG/> </o:OfficeDocumentSettings> </xml><![endif]--> <!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves/> <w:TrackFormatting/> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF/> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>JA</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:SplitPgBreakAndParaMark/> <w:EnableOpenTypeKerning/> <w:DontFlipMirrorIndents/> <w:OverrideTableStyleHps/> <w:UseFELayout/> </w:Compatibility> <m:mathPr> <m:mathFont m:val="Cambria Math"/> <m:brkBin m:val="before"/> <m:brkBinSub m:val="--"/> <m:smallFrac m:val="off"/> <m:dispDef/> <m:lMargin m:val="0"/> <m:rMargin m:val="0"/> <m:defJc m:val="centerGroup"/> <m:wrapIndent m:val="1440"/> <m:intLim m:val="subSup"/> <m:naryLim m:val="undOvr"/> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="276"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/> <w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/> <w:LsdException Locked="false" Priority="39" Name="toc 1"/> <w:LsdException Locked="false" Priority="39" Name="toc 2"/> <w:LsdException Locked="false" Priority="39" Name="toc 3"/> <w:LsdException Locked="false" Priority="39" Name="toc 4"/> <w:LsdException Locked="false" Priority="39" Name="toc 5"/> <w:LsdException Locked="false" Priority="39" Name="toc 6"/> <w:LsdException Locked="false" Priority="39" Name="toc 7"/> <w:LsdException Locked="false" Priority="39" Name="toc 8"/> <w:LsdException Locked="false" Priority="39" Name="toc 9"/> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/> <w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/> <w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/> <w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/> <w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/> <w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/> <w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/> <w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/> <w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/> <w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/> <w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/> <w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/> <w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/> <w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/> <w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/> <w:LsdException Locked="false" Priority="37" Name="Bibliography"/> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/> </w:LatentStyles> </xml><![endif]--> <!--[if gte mso 10]> <style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:Cambria;
mso-ascii-font-family:Cambria;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Cambria;
mso-hansi-theme-font:minor-latin;}
</style> <![endif]--> <!--StartFragment--> <!--EndFragment--><br />
<div class="MsoNormal"><span style="font-family: Arial, Helvetica, sans-serif;">( you need to install java and ssh beforehand to run hadoop )</span></div><div class="MsoNormal"><span style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div><div class="MsoNormal"></div><ol><li> <!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:AllowPNG/> </o:OfficeDocumentSettings> </xml><![endif]--> <!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves/> <w:TrackFormatting/> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF/> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>JA</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:SplitPgBreakAndParaMark/> <w:EnableOpenTypeKerning/> <w:DontFlipMirrorIndents/> <w:OverrideTableStyleHps/> <w:UseFELayout/> </w:Compatibility> <m:mathPr> <m:mathFont m:val="Cambria Math"/> <m:brkBin m:val="before"/> <m:brkBinSub m:val="--"/> <m:smallFrac m:val="off"/> <m:dispDef/> <m:lMargin m:val="0"/> <m:rMargin m:val="0"/> <m:defJc m:val="centerGroup"/> <m:wrapIndent m:val="1440"/> <m:intLim m:val="subSup"/> <m:naryLim m:val="undOvr"/> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="276"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/> <w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/> <w:LsdException Locked="false" Priority="39" Name="toc 1"/> <w:LsdException Locked="false" Priority="39" Name="toc 2"/> <w:LsdException Locked="false" Priority="39" Name="toc 3"/> <w:LsdException Locked="false" Priority="39" Name="toc 4"/> <w:LsdException Locked="false" Priority="39" Name="toc 5"/> <w:LsdException Locked="false" Priority="39" Name="toc 6"/> <w:LsdException Locked="false" Priority="39" Name="toc 7"/> <w:LsdException Locked="false" Priority="39" Name="toc 8"/> <w:LsdException Locked="false" Priority="39" Name="toc 9"/> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/> <w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/> <w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/> <w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/> <w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/> <w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/> <w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/> <w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/> <w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/> <w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/> <w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/> <w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/> <w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/> <w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/> <w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/> <w:LsdException Locked="false" Priority="37" Name="Bibliography"/> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/> </w:LatentStyles> </xml><![endif]--> <!--[if gte mso 10]> <style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:Cambria;
mso-ascii-font-family:Cambria;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Cambria;
mso-hansi-theme-font:minor-latin;}
</style> <![endif]--> <!--StartFragment--><span style="font-family: Arial, Helvetica, sans-serif;">Download the version you need to install from <a href="http://mirrors.fe.up.pt/pub/apache/hadoop/common/">here</a> <!--EndFragment--></span></li>
<li><div style="text-indent: 0px;"><span style="text-indent: -0.25in;"><span style="font-family: Arial, Helvetica, sans-serif;">Extract the downloaded pack</span></span></div><div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;"><span style="font-family: Arial, Helvetica, sans-serif;"><o:p></o:p></span></div><div class="MsoListParagraphCxSpLast"><span style="font-family: Arial, Helvetica, sans-serif;">The extracted directory will be your HADOOP_HOME ( ie: /Users/username/hadoopDir )<o:p></o:p></span></div><!--EndFragment--></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Add <span style="text-indent: -0.25in;">HADOOP_HOME to .bash_profile</span></span><div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;"><span style="font-family: Arial, Helvetica, sans-serif;"><o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle"></div><blockquote style="border: none; margin: 0 0 0 40px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Export HADOOP_HOME=/Users/userName/hadoop-2.5.1</span> </blockquote><blockquote style="border: none; margin: 0 0 0 40px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">export PATH=$PATH:$HADOOP_HOME/bin</span></blockquote><br />
<!--EndFragment--></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">S<span style="text-indent: -0.25in;">ource .bash_profile to affect the new changes</span> </span><div class="MsoListParagraphCxSpMiddle"></div><blockquote style="border: none; margin: 0 0 0 40px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">source ~/.bash_profile</span></blockquote><br />
<div class="MsoListParagraphCxSpLast"><span style="font-family: Arial, Helvetica, sans-serif;">Now you should be able to echo HADOOP_HOME in terminal ( echo $HADOOP_HOME )<o:p></o:p></span></div><!--EndFragment--></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">M<span style="text-indent: -0.25in;">ake sure that you can ssh to localhost</span></span><div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;"><span style="font-family: Arial, Helvetica, sans-serif;"><o:p></o:p></span></div><div class="MsoListParagraphCxSpLast"></div><blockquote style="border: none; margin: 0 0 0 40px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">ssh localhost</span></blockquote></li>
</ol><div><!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:AllowPNG/> </o:OfficeDocumentSettings> </xml><![endif]--> <!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves/> <w:TrackFormatting/> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF/> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>JA</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:SplitPgBreakAndParaMark/> <w:EnableOpenTypeKerning/> <w:DontFlipMirrorIndents/> <w:OverrideTableStyleHps/> <w:UseFELayout/> </w:Compatibility> <m:mathPr> <m:mathFont m:val="Cambria Math"/> <m:brkBin m:val="before"/> <m:brkBinSub m:val="--"/> <m:smallFrac m:val="off"/> <m:dispDef/> <m:lMargin m:val="0"/> <m:rMargin m:val="0"/> <m:defJc m:val="centerGroup"/> <m:wrapIndent m:val="1440"/> <m:intLim m:val="subSup"/> <m:naryLim m:val="undOvr"/> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="276"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/> <w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/> <w:LsdException Locked="false" Priority="39" Name="toc 1"/> <w:LsdException Locked="false" Priority="39" Name="toc 2"/> <w:LsdException Locked="false" Priority="39" Name="toc 3"/> <w:LsdException Locked="false" Priority="39" Name="toc 4"/> <w:LsdException Locked="false" Priority="39" Name="toc 5"/> <w:LsdException Locked="false" Priority="39" Name="toc 6"/> <w:LsdException Locked="false" Priority="39" Name="toc 7"/> <w:LsdException Locked="false" Priority="39" Name="toc 8"/> <w:LsdException Locked="false" Priority="39" Name="toc 9"/> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/> <w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/> <w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/> <w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/> <w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/> <w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/> <w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/> <w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/> <w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/> <w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/> <w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/> <w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/> <w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/> <w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/> <w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/> <w:LsdException Locked="false" Priority="37" Name="Bibliography"/> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/> </w:LatentStyles> </xml><![endif]--> <!--[if gte mso 10]> <style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:Cambria;
mso-ascii-font-family:Cambria;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Cambria;
mso-hansi-theme-font:minor-latin;}
</style> <![endif]--> <!--StartFragment--> <br />
<div class="MsoListParagraphCxSpFirst"><span style="font-family: Arial, Helvetica, sans-serif;">Now your stand alone hadoop setup is ready to use.</span></div><div class="MsoListParagraphCxSpMiddle"><span style="font-family: Arial, Helvetica, sans-serif;">I will share a sample code I found on map reduce to test your setup.<o:p></o:p></span></div><br />
<div class="blogspotHelp4u_ScrollBox"><pre class="Java" name="java"><div class="MsoListParagraphCxSpMiddle">import java.io.IOException;
import java.util.StringTokenizer;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
public class WordCount {
public static class TokenizerMapper
extends Mapper<Object, Text, Text, IntWritable>{
private final static IntWritable one = new IntWritable(1);
private Text word = new Text();
public void map(Object key, Text value, Context context
) throws IOException, InterruptedException {
StringTokenizer itr = new StringTokenizer(value.toString());
while (itr.hasMoreTokens()) {
word.set(itr.nextToken());
context.write(word, one);
}
}
}
public static class IntSumReducer
extends Reducer<Text,IntWritable,Text,IntWritable> {
private IntWritable result = new IntWritable();
public void reduce(Text key, Iterable<IntWritable> values,
Context context
) throws IOException, InterruptedException {
int sum = 0;
for (IntWritable val : values) {
sum += val.get();
}
result.set(sum);
context.write(key, result);
}
}
public static void main(String[] args) throws Exception {
Configuration conf = new Configuration();
Job job = Job.getInstance(conf, "word count");
job.setJarByClass(WordCount.class);
job.setMapperClass(TokenizerMapper.class);
job.setCombinerClass(IntSumReducer.class);
job.setReducerClass(IntSumReducer.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
FileInputFormat.addInputPath(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]));
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
}
</div></pre></div></div>
<h4><span style="font-family: Arial, Helvetica, sans-serif;">Run sample</span></h4><div><ul><li><span style="font-family: Arial, Helvetica, sans-serif;">Cr<span style="text-indent: -0.25in;">eate a jar from the sample</span></span><div class="MsoListParagraph" style="margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;"><span style="font-family: Arial, Helvetica, sans-serif;"><o:p></o:p></span></div><!--EndFragment--></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="text-indent: -0.25in;">Cr</span>eate a text file of which you need to count words<!--EndFragment--></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Run</span></li>
</ul><span style="font-family: Arial, Helvetica, sans-serif;"> hadoop jar [path_to_jar] [path_to_main_class] [path_to_input] [path_to_output]
ie: hadoop jar wordCount.jar WordCount inputFile output</span>
<ul><li><span style="font-family: Arial, Helvetica, sans-serif;">On <!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:AllowPNG/> </o:OfficeDocumentSettings> </xml><![endif]--> <!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves/> <w:TrackFormatting/> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF/> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>JA</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:SplitPgBreakAndParaMark/> <w:EnableOpenTypeKerning/> <w:DontFlipMirrorIndents/> <w:OverrideTableStyleHps/> <w:UseFELayout/> </w:Compatibility> <m:mathPr> <m:mathFont m:val="Cambria Math"/> <m:brkBin m:val="before"/> <m:brkBinSub m:val="--"/> <m:smallFrac m:val="off"/> <m:dispDef/> <m:lMargin m:val="0"/> <m:rMargin m:val="0"/> <m:defJc m:val="centerGroup"/> <m:wrapIndent m:val="1440"/> <m:intLim m:val="subSup"/> <m:naryLim m:val="undOvr"/> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="276"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/> <w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/> <w:LsdException Locked="false" Priority="39" Name="toc 1"/> <w:LsdException Locked="false" Priority="39" Name="toc 2"/> <w:LsdException Locked="false" Priority="39" Name="toc 3"/> <w:LsdException Locked="false" Priority="39" Name="toc 4"/> <w:LsdException Locked="false" Priority="39" Name="toc 5"/> <w:LsdException Locked="false" Priority="39" Name="toc 6"/> <w:LsdException Locked="false" Priority="39" Name="toc 7"/> <w:LsdException Locked="false" Priority="39" Name="toc 8"/> <w:LsdException Locked="false" Priority="39" Name="toc 9"/> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/> <w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/> <w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/> <w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/> <w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/> <w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/> <w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/> <w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/> <w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/> <w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/> <w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/> <w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/> <w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/> <w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/> <w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/> <w:LsdException Locked="false" Priority="37" Name="Bibliography"/> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/> </w:LatentStyles> </xml><![endif]--> <!--[if gte mso 10]> <style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:Cambria;
mso-ascii-font-family:Cambria;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Cambria;
mso-hansi-theme-font:minor-latin;}
</style> <![endif]--> <!--StartFragment--> a successful execution, you will have the output directory created at the path you specify. And your result will be in output/part-r-00000<!--EndFragment--></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">When you run the program again you need to remove the ‘output’ directory or give some other path for the output to be written.</span><!--EndFragment--></li>
</ul><div><span style="font-family: Arial, Helvetica, sans-serif;">You will see that this is really simple. </span>
<span style="font-family: Arial, Helvetica, sans-serif;">
</span></div></div><div><span style="font-family: Arial, Helvetica, sans-serif;">You can find steps on setting up hadoop in pseudo-distributed mode <a href="http://blog.ashansa.org/2014/10/hadoop-pseudo-distributed-mode-setup.html">in this post</a></span></div><div class="MsoListParagraphCxSpLast"><o:p></o:p></div><!--EndFragment-->
<div class="MsoNormal"><o:p></o:p></div>Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-866069013848075234.post-27912695212814048782014-02-03T04:36:00.004-08:002014-11-07T11:02:32.279-08:00Simple overview on the main roles in App Factory how they involve in application process.<div style="margin-bottom: 0in;">
With the multi tenanted App Factory
there are some changes in user model in App Factory. I am going to
give you and idea on the default roles and the main actions that
those roles are responsible of doing in the application space in App
Factory.</div>
<div style="margin-bottom: 0in;">
<br />
</div>
<div style="margin-bottom: 0in;">
Admin</div>
<ul>
<li>Creates a space for the organization in App Factory.</li>
<li><div style="margin-bottom: 0in;">
Can add organization level users and assign them
roles</div>
<div style="margin-bottom: 0in;">
Default roles would be Developer,
DevOps, QA, Application Owner, CXO</div>
</li>
</ul>
<div style="margin-bottom: 0in;">
<br />
</div>
<div style="margin-bottom: 0in;">
Application Owner</div>
<ul>
<li><div style="margin-bottom: 0in;">
Only the application owners can
create applications.</div>
</li>
<li><div style="margin-bottom: 0in;">
After creating an application he
can assign people ( that has been already added to the organization
by the organization admin ) to his application. And those people
become the members of the application and can play relevant roles (
developer, QA... ) assigned for them ( by admin ) for the created
applications.</div>
</li>
</ul>
<div style="margin-bottom: 0in;">
<br />
</div>
<div style="margin-bottom: 0in;">
Developer</div>
<ul>
<li><div style="margin-bottom: 0in;">
He will see all the applications
of which he is a member of.</div>
</li>
<li><div style="margin-bottom: 0in;">
He can do git clone, push, trigger
build, etc ( the work related for developing the application )</div>
</li>
</ul>
<div style="margin-bottom: 0in;">
<br />
</div>
<div style="margin-bottom: 0in;">
QA</div>
<ul>
<li><div style="margin-bottom: 0in;">
Will see the applications that he
has is a member of.</div>
</li>
<li><div style="margin-bottom: 0in;">
Can perform the testing tasks. (
testing the deployed artifacts, report bugs... )</div>
</li>
</ul>
<div style="margin-bottom: 0in;">
<br />
</div>
<div style="margin-bottom: 0in;">
CXO</div>
<br />
<ul>
<li><div style="margin-bottom: 0in;">
Can view dashboards.</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhseTtFAlkzJKEFB1KkgGqrOL3O4i5MO8zbDvr_vx7FsHqu9hN8nneq53cw-WFVr-bEfcniC3NVtaOUlx38ePwA3BY0beSLEbqecIgJB1ipkhmNCo0lz9n7oko5sBeKswlbO5NTef77CC8/s1600/flow.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhseTtFAlkzJKEFB1KkgGqrOL3O4i5MO8zbDvr_vx7FsHqu9hN8nneq53cw-WFVr-bEfcniC3NVtaOUlx38ePwA3BY0beSLEbqecIgJB1ipkhmNCo0lz9n7oko5sBeKswlbO5NTef77CC8/s1600/flow.jpg" height="640" width="460" /></a></div>
<div style="margin-bottom: 0in;">
<br /></div>
</li>
</ul>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-866069013848075234.post-25069011030620394692014-01-28T03:34:00.000-08:002014-11-07T11:03:18.281-08:00Configure SAML2 Single Sign-On on WSO2 servers with WSO2 Identity Server.By following this post you will be able to find out how to configure WSO2 servers to have SAML2 SSO with WSO2 Identity Server (IS) as the identity provider. It is really simple to configure SAML2 SSO for carbon servers.<br />
I am going to address the server that you need to have SSO configured as 'Carbon Server' and just by following the below 2 steps you can configure SSO in your carbon server with WSO2 IS.<br />
<br />
<b>1. Configure your carbon server to enable SSO</b><br />
<br />
All the required configuration to have SSO in your carbon server are in Carbon server/repository/conf/security/authenticators.xml<br />
<br />
<ul>
<li>Enable SSOAuthenticator in authenticators.xml</li>
</ul>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2COqfAl_dDT3SNsCWts1Ebruqdk154VH2gNGOkaMcxXgYaAOXpXtgB35k7un5UJc1-_OgjNuMTfyo63U4q4n7oM306gxPSN8NhZRZEG0qHNhbIRbuO4syDRmLi7YwdvL4latS8bhqfBQ/s1600/authenticators_xml.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2COqfAl_dDT3SNsCWts1Ebruqdk154VH2gNGOkaMcxXgYaAOXpXtgB35k7un5UJc1-_OgjNuMTfyo63U4q4n7oM306gxPSN8NhZRZEG0qHNhbIRbuO4syDRmLi7YwdvL4latS8bhqfBQ/s1600/authenticators_xml.jpg" height="130" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
( 1 ) Set disabled="false"</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
( 2 ) This should be unique to your carbon server. You will need this value when configuring IS too.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li>Start your carbon server with an offset ( offset can be configured in carbon.xml)</li>
</ul>
<br />
<div>
<br /></div>
<div>
<b>2. Register a service provider in IS side</b></div>
<ul>
<li>Start IS in default port ( 9443 ) and log in </li>
<li>Follow Main > Manage > SAML SSO > Register New Service Provider</li>
<li>Add the unique identifier ( 2 ) as the Issuer</li>
<li>Provide Assertion Consumer URL with your carbon server info as https://[host name]:[port]<carbon_server_hostname><port>/acs</port></carbon_server_hostname></li>
<li>Tick on Enable Response Signing and Enable Assertion Signing</li>
<li>Click on "Register"</li>
</ul>
<div>
<br /></div>
<div>
Now you are done. You can simply try to log into your carbon server with SSO.<br />
To verify<br />
- Try to access https://[host name]:[port]/carbon<br />
- This will direct you to the authentication endpoint of IdentityProviderSSOServiceURL specified in authenticators.xml<br />
( here https://localhost:9443/authenticationendpoint )<br />
- Give the credentials and hit Sign in<br />
- You will be logged in to your carbon server</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-866069013848075234.post-59284396905807979972013-09-24T05:04:00.001-07:002014-11-07T11:03:31.984-08:00Write a simple JDBC PIP attribute finder module for WSO2 Identity ServerWith this post I am going to discuss on how you can implement a simple JDBC PIP attribute finder module for WSO2 IS. I am using the latest released IS version ( WSO2 IS version 4.5.0 ) which you can download from <a href="http://wso2.com/products/identity-server/">here</a>.<br />
<br />
To have your own customized PIP module, the main task is to implement an attribute finder. It is not that hard since we already have the modeling interfaces. You can simply extend the AbstractPIPAttributeFinder ( abstract class) or implement PIPAttributeFinder ( interface ) to create your attribute finder.<br />
<br />
I will provide step by step guide on how to <br />
<ul>
<li>Create your own attribute finder</li>
<li>Register your PIP module in WSO2 IS</li>
<li>Test your attribute finder</li>
</ul>
<div>
<br /></div>
<h3>
Create your own attribute finder</h3>
<div>
<div style="margin-bottom: 0in;">
<br />
I am going to create a JDBC attribute finder where the attributes required are stored in a database. I am going to use mysql for this sample.</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
</div>
<div style="margin-bottom: 0in;">
I will add a sample code for our attribute finder and I'm going to address it as JDBCAttributeFinder.<br />
<br /></div>
<div style="margin-bottom: 0in;">
<div class="blogspotHelp4u_ScrollBox">
<pre class="Java" name="java">package org.wso2.identity.samples.entitlement.pip.jdbc;
import org.apache.commons.dbcp.BasicDataSource;
import org.wso2.carbon.identity.entitlement.pip.AbstractPIPAttributeFinder;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashSet;
import java.util.Properties;
import java.util.Set;
/**
* This is sample implementation of PIPAttributeFinder in Wso2 Entitlement Engine Here we are
* calling to a external user base to find given attribute Assume that user store is reside on mysql
* database
*/
public class JDBCAttributeFinder extends AbstractPIPAttributeFinder {
/**
* DBCP connection pool is used to create connection to database
*/
private BasicDataSource dataSource;
/**
* List of attribute finders supported by the this PIP attribute finder
*/
private Set<string> supportedAttributes = new HashSet<string>();
/**
* initializes the Attribute finder module. creates a connection with JDBC database and the
* retrieve attribute names from following sample table
* +--------------+----------------+-----------------+---------+
* | ATTRIBUTE_ID | ATTRIBUTE_NAME | ATTRIBUTE_VALUE | USER_ID |
* +--------------+----------------+-----------------+---------+
* | 1 | EmailOfUser | asela@gmail.com | 1 |
* | 2 | EmailOfUser | bob@gmail.com | 2 |
* | 3 | EmailOfUser | peter@gmail.com | 3 |
* | 4 | CountryOfUser | SL | 1 |
* | 5 | CountryOfUser | USA | 2 |
* | 6 | CountryOfUser | UK | 3 |
* | 7 | AgeOfUser | 23 | 1 |
* | 8 | AgeOfUser | 19 | 2 |
* | 9 | AgeOfUser | 31 | 3 |
* +--------------+----------------+-----------------+---------+
*
*
* @throws Exception throws when initialization is failed
*/
public void init(Properties properties) throws Exception {
/**
* JDBC connection parameters
*/
String dbUrl = properties.getProperty("databaseUrl");
String driver = properties.getProperty("driverName");
String userName = properties.getProperty("userName");
String password = properties.getProperty("password");
/**
* SQL statement to retrieve all attributes from database
*/
String sqlStmt = "SELECT * FROM UM_USER_ATTRIBUTE";
Connection connection = null;
PreparedStatement prepStmt = null;
ResultSet resultSet = null;
dataSource = new BasicDataSource();
dataSource.setUrl(dbUrl);
dataSource.setDriverClassName(driver);
dataSource.setUsername(userName);
dataSource.setPassword(password);
try {
connection = dataSource.getConnection();
if (connection != null) {
prepStmt = connection.prepareStatement(sqlStmt);
resultSet = prepStmt.executeQuery();
while (resultSet.next()) {
String name = resultSet.getString(2);
supportedAttributes.add(name);
}
}
} catch (SQLException e) {
throw new Exception("Error while initializing JDBC attribute Finder", e);
}
}
/**
* This returns the name of the module
* @return Returns a <code>String</code> that represents the module name
*/
public String getModuleName() {
return "JDBCPIPAttributeFinder";
}
/**
* This returns the <code>Set</code> of <code>String</code>s the attributeId that are retrieved
* in initialization
*
* @return <code>Set</code> of <code>String</code>
*/
public Set<string> getSupportedAttributes() {
return supportedAttributes;
}
/**
* This is the overloaded simplify version of the getAttributeValues() method. Any one who extends the
* <code>AbstractPIPAttributeFinder</code> can implement this method and get use of the default
* implementation of the getAttributeValues() method which has been implemented within
* <code>AbstractPIPAttributeFinder</code> class
*
* @param subject Name of the subject the returned attributes should apply to.
* @param resource The name of the resource the subject is trying to access.
* @param action The name of the action the subject is trying to execute on resource
* @param environment The name of the environment the subject is trying to access the resource
* @param attributeId The unique id of the required attribute.
* @param issuer The attribute issuer.
*
* @return Returns a <code>Set</code> of <code>String</code>s that represent the attribute
* values.
* @throws Exception throws if fails
*/
public Set<string> getAttributeValues( String subject, String resource, String action, String environment, String attributeId, String issuer) throws Exception {
String sqlStmt = "select ATTRIBUTE_VALUE from UM_USER_ATTRIBUTE where ATTRIBUTE_NAME='" + attributeId + "' and USER_ID=(select USER_ID from UM_USER where USER_NAME='" + subject + "');";
Set<string> values = new HashSet<string>();
PreparedStatement prepStmt = null;
ResultSet resultSet = null;
Connection connection = null;
try {
connection = dataSource.getConnection();
if (connection != null) {
prepStmt = connection.prepareStatement(sqlStmt);
resultSet = prepStmt.executeQuery();
while (resultSet.next()) {
values.add(resultSet.getString(1));
}
}
} catch (SQLException e) {
throw new Exception("Error while retrieving attribute values", e);
}
return values;
}
}
</string></string></string></string></string></string></pre>
</div>
<br />
<div style="margin-bottom: 0in;">
<br />
You need to create your PIP module by using this class.</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
</div>
<h3>
<br />
</h3>
<h3>
Register your PIP module in WSO2 IS</h3>
<div>
<br /></div>
<div>
<div style="margin-bottom: 0in;">
I will provide the action that you should follow to get your module running.</div>
<div style="margin-bottom: 0in;">
</div>
<ul>
<li>Build your module and copy the jar to CARBON_HOME/repository/components/lib</li>
<li>Copy the JDBC driver to CARBON_HOME/repository/components/lib ( here the mysql-connector )</li>
<li>Register your attribute finder by adding it to CARBON_HOME/repository/conf/security/entitlement.properties as follow ( make sure that you change the dbUserName and userPassword )</li>
</ul>
<div>
<br /></div>
<pre class="Cpp" name="code">PIP.AttributeDesignators.Designator.2=org.wso2.identity.samples.entitlement.pip.jdbc.JDBCAttributeFinder
org.wso2.identity.samples.entitlement.pip.jdbc.JDBCAttributeFinder.1=databaseUrl,jdbc:mysql://localhost:3306/piptestdb
org.wso2.identity.samples.entitlement.pip.jdbc.JDBCAttributeFinder.2=userName,dbUserName
org.wso2.identity.samples.entitlement.pip.jdbc.JDBCAttributeFinder.3=password,userPassword
org.wso2.identity.samples.entitlement.pip.jdbc.JDBCAttributeFinder.4=driverName,com.mysql.jdbc.Driver
</pre>
<br />
I am attaching the <a href="https://svn.wso2.org/repos/wso2/people/ashansa/JDBC_AttributeFinder/testData.sql">db script</a> that can be used to generate data which is required for this sample, the <a href="https://svn.wso2.org/repos/wso2/people/ashansa/JDBC_AttributeFinder/pip_finder/">sample module</a> and the <a href="https://svn.wso2.org/repos/wso2/people/ashansa/JDBC_AttributeFinder/mysql-connector-java-5.1.12-bin.jar">mysql-connector</a> jar to make your job more easy<br />
<br />
<br />
<h3>
Test your attribute finder</h3>
<div>
<br /></div>
<div>
<div style="margin-bottom: 0in;">
Given below is a sample policy which can be used to test your new JDBC attribute finder.<br />
You can find the uploaded policy <a href="https://svn.wso2.org/repos/wso2/people/ashansa/JDBC_AttributeFinder/policy.xml">here</a>.</div>
<div class="blogspotHelp4u_ScrollBox">
<pre class="Cpp" name="code"><policy policyid="SimplePolicyForDemo1" rulecombiningalgid="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" xmlns="urn:oasis:names:tc:xacml:2.0:policy:schema:os">
<target>
<resources>
<resource>
<resourcematch matchid="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<attributevalue datatype="http://www.w3.org/2001/XMLSchema#string">foo</attributevalue>
<resourceattributedesignator attributeid="urn:oasis:names:tc:xacml:1.0:resource:resource-id" datatype="http://www.w3.org/2001/XMLSchema#string">
</resourceattributedesignator></resourcematch>
</resource>
</resources>
</target>
<rule effect="Permit" ruleid="Rule1">
<target>
<actions>
<action>
<actionmatch matchid="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<attributevalue datatype="http://www.w3.org/2001/XMLSchema#string">bar</attributevalue>
<actionattributedesignator attributeid="urn:oasis:names:tc:xacml:1.0:action:action-id" datatype="http://www.w3.org/2001/XMLSchema#string">
</actionattributedesignator></actionmatch>
</action>
</actions>
</target>
<condition>
<apply functionid="urn:oasis:names:tc:xacml:1.0:function:and">
<apply functionid="urn:oasis:names:tc:xacml:1.0:function:integer-greater-than-or-equal">
<apply functionid="urn:oasis:names:tc:xacml:1.0:function:integer-one-and-only">
<subjectattributedesignator attributeid="AgeOfUser" datatype="http://www.w3.org/2001/XMLSchema#integer">
</subjectattributedesignator></apply>
<attributevalue datatype="http://www.w3.org/2001/XMLSchema#integer">18</attributevalue>
</apply>
<apply functionid="urn:oasis:names:tc:xacml:1.0:function:integer-less-than-or-equal">
<apply functionid="urn:oasis:names:tc:xacml:1.0:function:integer-one-and-only">
<subjectattributedesignator attributeid="AgeOfUser" datatype="http://www.w3.org/2001/XMLSchema#integer">
</subjectattributedesignator></apply>
<attributevalue datatype="http://www.w3.org/2001/XMLSchema#integer">30</attributevalue>
</apply>
</apply>
</condition>
</rule>
<rule effect="Deny" ruleid="Rule2">
</rule></policy>
</pre>
<br />
<br /></div>
<br />
<br />
<div style="margin-bottom: 0in;">
This policy says that only the users whose age is between 18 and 30 can access the resource “foo” and perform action “bar”</div>
<div style="margin-bottom: 0in;">
<br /></div>
- Copy the above sample policy to an xml file, start WSO2 IS and upload the policy file through Policy Administrator.<br />
<div style="margin-bottom: 0in;">
Follow Policy Administration > Add New Entitlement Policy > Import Existing Policy<br />
<br /></div>
<div style="margin-bottom: 0in;">
</div>
<div style="margin-bottom: 0in;">
- Enable the policy through Policy View<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6IJ0Ze9hPW2nohLt0rY32wdLlk2hd_C0R25TVrnyM7Y8_xNyRqQg1Z8X66NtZsFu0vak8YTb5y3ulik26Gx4hOmIMjyfvNMNdJkV_2C1GyBcXyLTbPsk7kz9-12TBqZuKTcQFI50RplY/s1600/Screenshot-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6IJ0Ze9hPW2nohLt0rY32wdLlk2hd_C0R25TVrnyM7Y8_xNyRqQg1Z8X66NtZsFu0vak8YTb5y3ulik26Gx4hOmIMjyfvNMNdJkV_2C1GyBcXyLTbPsk7kz9-12TBqZuKTcQFI50RplY/s640/Screenshot-2.png" width="680" /></a></div>
<br /></div>
<div style="margin-bottom: 0in;">
- Publish the policy through Policy Administrator.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheH-xZBtiXvUS4MFLLfE9OQCBbPzFNkJs5R9witN2qDsA351UeJOSNZYOTEi2pu311FbBwK6GFfJ_AI2CtT4l1BOpjJQmX4wZnZDzvYx4FZlfSnT4Ck7JTPaXfJX3BwVswmTYnal-9C4c/s1600/Screenshot-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheH-xZBtiXvUS4MFLLfE9OQCBbPzFNkJs5R9witN2qDsA351UeJOSNZYOTEi2pu311FbBwK6GFfJ_AI2CtT4l1BOpjJQmX4wZnZDzvYx4FZlfSnT4Ck7JTPaXfJX3BwVswmTYnal-9C4c/s640/Screenshot-1.png" width="680" /></a></div>
<br />
<br /></div>
<div style="margin-bottom: 0in;">
- Click on Tryit and send a request. ( given below is a sample request which you can download from <a href="https://svn.wso2.org/repos/wso2/people/ashansa/JDBC_AttributeFinder/request.xml">here</a>)<br />
<br />
<br />
<br /></div>
<div style="margin-bottom: 0in;">
</div>
<div style="margin-bottom: 0in;">
</div>
<pre class="Cpp" name="code"><request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os">
<resource>
<attribute attributeid="urn:oasis:names:tc:xacml:1.0:resource:resource-id" datatype="http://www.w3.org/2001/XMLSchema#string">
<attributevalue>foo</attributevalue>
</attribute>
</resource>
<subject>
<attribute attributeid="urn:oasis:names:tc:xacml:1.0:subject:subject-id" datatype="http://www.w3.org/2001/XMLSchema#string">
<attributevalue>Bob</attributevalue>
</attribute>
</subject>
<action>
<attribute attributeid="urn:oasis:names:tc:xacml:1.0:action:action-id" datatype="http://www.w3.org/2001/XMLSchema#string">
<attributevalue>bar</attributevalue>
</attribute>
</action>
<environment>
</environment></request>
</pre>
<br />
Now you would see that your newly created attribute finder has come into play :)<br />
<br />
There are some configuration changes if you are trying a 3.x.x version. <a href="http://xacmlinfo.org/2011/12/18/writing-jdbc-pip-module/">This</a> would help you to identify those changes if you are using an earlier version.</div>
</div>
</div>
</div>
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-866069013848075234.post-21362973576096806362013-09-13T07:14:00.001-07:002014-11-07T11:04:31.980-08:00Convert XML String to OMElement and extract valuesA simple tip which saves a lot of your time...<br />
You can simply convert XML string to an OMElement as below<br />
<br />
<pre class="Cpp" name="code"> OMElement resultElement = AXIOMUtil.stringToOM(xmlString);
</pre>
<br />
<h3>
Extracting values from XML</h3>
<div>
<br /></div>
<h4>
Sample XML code</h4>
<div>
<br /></div>
<pre class="Cpp" name="code"><catalog><book id="bk101"> <author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applicationswith XML.</description>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies,an evil sorceress.</description>
</book>
<book id="bk103">
<author>Corets, Eva</author>
<title>Maeve Ascendant</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-11-17</publish_date>
<description>After the collapse of a nanotechnologysociety in England.</description>
</book>
<book id="bk104">
<author>Corets, Eva</author>
<title>Oberon's Legacy</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2001-03-10</publish_date>
<description>In post-apocalypse England, the mysteriousagent known only as Oberon.</description>
</book>
</catalog>
</pre>
<h3>
</h3>
<h3>
</h3>
<h3>
<br /></h3>
<h3>
Java code to retrieve values</h3>
<div>
<br /></div>
<pre class="Cpp" name="code">OMElement resultElement = AXIOMUtil.stringToOM(xmlString);
Iterator i = resultElement.getChildren();
while (i.hasNext()) {
OMElement book = (OMElement) i.next();
Iterator properties = book.getChildren();
System.out.println("====== book =======");
while (properties.hasNext()) {
OMElement property = (OMElement) properties.next();
String localName = property.getLocalName();
String value = property.getText();
System.out.println(localName + ": " + value);
}
}
</pre>
<h3>
<br /></h3>
<h3>
Result</h3>
<pre class="Java" name="code">====== book =======
author: Gambardella, Matthew
title: XML Developer's Guide
genre: Computer
price: 44.95
publish_date: 2000-10-01
description: An in-depth look at creating applicationswith XML.
====== book =======
author: Ralls, Kim
title: Midnight Rain
genre: Fantasy
price: 5.95
publish_date: 2000-12-16
description: A former architect battles corporate zombies,an evil sorceress.
====== book =======
author: Corets, Eva
title: Maeve Ascendant
genre: Fantasy
price: 5.95
publish_date: 2000-11-17
description: After the collapse of a nanotechnologysociety in England.
====== book =======
author: Corets, Eva
title: Oberon's Legacy
genre: Fantasy
price: 5.95
publish_date: 2001-03-10
description: In post-apocalypse England, the mysteriousagent known only as Oberon.
</pre>
Unknownnoreply@blogger.com42tag:blogger.com,1999:blog-866069013848075234.post-46819814563595637372013-07-21T09:53:00.001-07:002014-11-07T11:03:50.515-08:00Get started with WSO2 App Factory<div>
AppFactory is an elastic and self-service enterprise DevOps platform to mange applications from cradle to grave. This is a 100% free and open source solution developed by WSO2 which covers the whole lifecycle of an application. You will be facilitated by all the required resources for the application created in one go. Just use ones, you will see the difference :)</div>
<div>
<br /></div>
<div>
Getting started is very simple. It is all online running on cloud. But I will go through step by step, so you do not miss anything.</div>
<div>
<br /></div>
<h3>
Create an account</h3>
<div>
<div>
Click the 'Register' link in <a href="https://appfactorypreview.wso2.com/">App Factory live URL</a></div>
<div>
You need to fill the following form to get registered.</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia6uHOR0CsNBgRaEYB3huGtkF5po7pEv5kTxhdnWB0Lb4tR_1o_ou6p5e-MunGz6tGuvXdW037I9dQ25eEPqUtaOL4HrVNhNeCmzHSsbPd88h4iGKvAVk1EA5rpFWoVsovySLs8UhlnwI/s1600/1register-blank.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="460" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia6uHOR0CsNBgRaEYB3huGtkF5po7pEv5kTxhdnWB0Lb4tR_1o_ou6p5e-MunGz6tGuvXdW037I9dQ25eEPqUtaOL4HrVNhNeCmzHSsbPd88h4iGKvAVk1EA5rpFWoVsovySLs8UhlnwI/s640/1register-blank.png" width="640" /></a></div>
<div>
<br /></div>
<div>
Do not worry about the phone number field, just give some number there if you do not like to put the actual number.</div>
<div>
<br /></div>
<div>
If your registration is successful you will be asked to check your email.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRU-MclS7qRSlqdkXUldhPqBgFQGSQ8Zi_uwOlZJsMSqCK6ZeThyandnP4wno6n0pwqGlwIwB2jhXFY5rxaDPIK6cCe_aXPGu4n0yVeJlxhp62P1ZmKRaTJMwOVuYY_HYz0u8zcd7gPtI/s1600/2check-email-msg.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="57" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRU-MclS7qRSlqdkXUldhPqBgFQGSQ8Zi_uwOlZJsMSqCK6ZeThyandnP4wno6n0pwqGlwIwB2jhXFY5rxaDPIK6cCe_aXPGu4n0yVeJlxhp62P1ZmKRaTJMwOVuYY_HYz0u8zcd7gPtI/s400/2check-email-msg.png" width="400" /></a></div>
<h3>
Change the default password</h3>
<div>
Using the URL sent to your email address given at register time, log in to the system and change password.<br />
(Remember, that log in URL can be used only ones and you need to change the default password in that log in)</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG0vVVM3hVQtOLODu56ywjb8lMWjfmBs8dkQ1TcQqLrNjaiXbTNOZD7Nz5v_kGVvRqRdqX1XcgzGMI1ZCotnmrv8_ytSmAWrlpRzqXPL21udb-0cZbAPS4kCjYrWumzOeE2mvEyAg8fCA/s1600/changePW-editted.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="430" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG0vVVM3hVQtOLODu56ywjb8lMWjfmBs8dkQ1TcQqLrNjaiXbTNOZD7Nz5v_kGVvRqRdqX1XcgzGMI1ZCotnmrv8_ytSmAWrlpRzqXPL21udb-0cZbAPS4kCjYrWumzOeE2mvEyAg8fCA/s640/changePW-editted.png" width="640" /></a></div>
<div>
<br /></div>
<div>
Then we will change the default password with the one you gave</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL6CC2TvzZtegzrggdI-7ikAzaqT8Y2gp_CX28q2XRgwj5YT96eQYj91Sys1HFz1aur0_a3v8BU3LFb1bGjU72yTWFMZr6wi_lNv8gZTxEi69ceRM16ui3GSB1tYOzekYq8Vm9j9YoLGg/s1600/2PWchanged.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="64" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL6CC2TvzZtegzrggdI-7ikAzaqT8Y2gp_CX28q2XRgwj5YT96eQYj91Sys1HFz1aur0_a3v8BU3LFb1bGjU72yTWFMZr6wi_lNv8gZTxEi69ceRM16ui3GSB1tYOzekYq8Vm9j9YoLGg/s400/2PWchanged.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<h3>
Log in to AF</h3>
<div class="separator" style="clear: both; text-align: center;">
</div>
Use <a href="https://appfactorypreview.wso2.com/">this</a> link and log into the system using your new password. You will see the following page just after the log in.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs3uQdJpIhiA1aESUG_HGORa5LdDA8sx79ZdRQCJupFKCCbZGB8IjccjH2VR1lDpR9YuGs8gP7yaXm3rINlwi6KO1UzCrGAklQ4oK4TsiqZwX1-44xjgFTMcGMsE0HSocClig3Ql7dSlA/s1600/blank-firstPage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="132" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs3uQdJpIhiA1aESUG_HGORa5LdDA8sx79ZdRQCJupFKCCbZGB8IjccjH2VR1lDpR9YuGs8gP7yaXm3rINlwi6KO1UzCrGAklQ4oK4TsiqZwX1-44xjgFTMcGMsE0HSocClig3Ql7dSlA/s640/blank-firstPage.png" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
But wait for few seconds, we are creating a default application for you :)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzP5d_qPBU6bqXrDroGKq47CxAA_eAu3Vq1jlYR6Ojt8Ads8qECg70u-HScWEcjL-Pt6Qax1u5Wi77B32r8P0XypQzDvJC96yn9vI-d1J9HA0pzgsb6hD7jT5CdbYeiL6lU3YJCaSMyGM/s1600/4-creatingApp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzP5d_qPBU6bqXrDroGKq47CxAA_eAu3Vq1jlYR6Ojt8Ads8qECg70u-HScWEcjL-Pt6Qax1u5Wi77B32r8P0XypQzDvJC96yn9vI-d1J9HA0pzgsb6hD7jT5CdbYeiL6lU3YJCaSMyGM/s640/4-creatingApp.png" width="640" /></a></div>
<br />
<div>
<br /></div>
<div>
When you navigate to the application that just now got created, you will see the set of features and the functionalities that are bound with your application. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvrslQm7nqUwtL2Qm7sx9s4jpsTfjtAZtuv5UuLLC-dTRPUsP_dJwkhWbPoSpVzpIzXXxjYS17d2qfbVlksKcYjUyuEIVYhHTEGaYxWC4SI4v-cklD7pdjE1Z11fRp_NbWa8aF_NtaLww/s1600/appOverview.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="322" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvrslQm7nqUwtL2Qm7sx9s4jpsTfjtAZtuv5UuLLC-dTRPUsP_dJwkhWbPoSpVzpIzXXxjYS17d2qfbVlksKcYjUyuEIVYhHTEGaYxWC4SI4v-cklD7pdjE1Z11fRp_NbWa8aF_NtaLww/s640/appOverview.png" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
I will discuss about how to manage the applications with App Factory in a recent post.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-866069013848075234.post-5162046065667897592012-11-01T03:06:00.000-07:002012-11-01T03:06:07.876-07:00Write your first Axis2 service
<br />
<div style="margin-bottom: 0in;">
In this post I
will describe on how to create a simple HelloWorld axis2 service by
following three simple steps.</div>
<div style="margin-bottom: 0in;">
</div>
<ol>
<li>Implement the
service class</li>
<li>Create the
services.xml file</li>
<li>Pack the service as
.aar file archive</li>
</ol>
<div>
<b>Implement the service class</b></div>
<div>
<ol>
<div style="margin-bottom: 0in;">
First we need
to create the service class and the service methods. We will
create HelloService.java service class and sayHello operation as shown below.</div>
</ol>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSaKrHQRW-rdgfODnZ4h2c4S1X96ty_ZnYIDBTP2ygnhzWDoZHImGQzb4xU1Iq35o9XxJUauSL7bRJlcSf-GKrHZt_jSD6hZ_Bap0WLBrns9zBrYVJI4dciJ9T9z6Y6GsxNAzQebzkvqY/s1600/Screenshot+at+2012-11-01+15:01:46.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="306" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSaKrHQRW-rdgfODnZ4h2c4S1X96ty_ZnYIDBTP2ygnhzWDoZHImGQzb4xU1Iq35o9XxJUauSL7bRJlcSf-GKrHZt_jSD6hZ_Bap0WLBrns9zBrYVJI4dciJ9T9z6Y6GsxNAzQebzkvqY/s400/Screenshot+at+2012-11-01+15:01:46.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="text-align: -webkit-auto;"><b>Create the services.xml file</b></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="text-align: -webkit-auto;"><b><br /></b></span></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-align: -webkit-auto; text-indent: -0.25in;">
services.xml is a configuration file which all the axis2 web services must have.</div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-align: -webkit-auto; text-indent: -0.25in;">
Create a META-INF directory and create the services.xml file inside the META-INF directory.</div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-align: -webkit-auto; text-indent: -0.25in;">
You should define the service class as a parameter in services.xml</div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-align: -webkit-auto; text-indent: -0.25in;">
<br /></div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-align: -webkit-auto; text-indent: -0.25in;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcHfXdSkPB4A8WgwDvP1ol_Gu7Lqyr8Eo5LOwsZlLxXXr2-79XvFZ__cDC-4D4XDtKLK6qwlBQmXo5n9MDtUUHJd_3-Y6zITQn7K6LaYLrtk7BqVYtEUCi-PsJSrkEeRlfJpTT1l_21cU/s1600/xml.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="105" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcHfXdSkPB4A8WgwDvP1ol_Gu7Lqyr8Eo5LOwsZlLxXXr2-79XvFZ__cDC-4D4XDtKLK6qwlBQmXo5n9MDtUUHJd_3-Y6zITQn7K6LaYLrtk7BqVYtEUCi-PsJSrkEeRlfJpTT1l_21cU/s640/xml.png" width="640" /></a></div>
<div class="" style="clear: both; text-align: -webkit-auto; text-indent: -24px;">
Your project structure will look like the following.</div>
<div class="" style="clear: both; text-align: -webkit-auto; text-indent: -24px;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-KWUvPK_d9Rg_pbJYUqyW4W16OEmrfU3I2o4Rlo9lcqf4VxLu4T65HSBNgTcUH3Hf7NFADuldAyCFt_mnVunBPD_D3mVbK0hAWfrJ8rs_psjuF11g6M5l6CMQ7RO_a79dED6NrwYTQs8/s1600/structer.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="218" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-KWUvPK_d9Rg_pbJYUqyW4W16OEmrfU3I2o4Rlo9lcqf4VxLu4T65HSBNgTcUH3Hf7NFADuldAyCFt_mnVunBPD_D3mVbK0hAWfrJ8rs_psjuF11g6M5l6CMQ7RO_a79dED6NrwYTQs8/s320/structer.png" width="320" /></a></div>
<div class="" style="clear: both; text-align: -webkit-auto; text-indent: -24px;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
<b style="text-indent: -24px;"><br /></b></div>
<div class="" style="clear: both; text-align: left;">
<b style="text-indent: -24px;">Pack the service as .aar file archive</b></div>
<div class="" style="clear: both; text-align: left;">
<b style="text-indent: -24px;"><br /></b></div>
<div class="separator" style="clear: both; text-align: -webkit-auto;">
</div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-indent: -0.25in;">
Compile your
service class using javac command.</div>
<div style="margin-bottom: 0in;">
ie: <b>javac
HelloService.java -d ./</b> </div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-align: left; text-indent: -0.25in;">
</div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-align: left; text-indent: -0.25in;">
Get a copy of your META-INF directory and the compiled .class file of the service to a temp</div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-align: left; text-indent: -0.25in;">
directory. Now the tree structure of those should be as follows.</div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-align: left; text-indent: -0.25in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8CvPPvDKbteaGUnqL9xpjLbaIw6hi5_ZG1b4tgfQsUrtYDQg8bL8RherNMpi9bL7ehb21WgQ0AaDOzvZgE_mquEjRYTrAXxrC4y_YKsIwuURj7Ir-COugBOPM38xJyqNi6s-ia-dAKu4/s1600/tree.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="116" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8CvPPvDKbteaGUnqL9xpjLbaIw6hi5_ZG1b4tgfQsUrtYDQg8bL8RherNMpi9bL7ehb21WgQ0AaDOzvZgE_mquEjRYTrAXxrC4y_YKsIwuURj7Ir-COugBOPM38xJyqNi6s-ia-dAKu4/s400/tree.png" width="400" /></a></div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-align: left; text-indent: -0.25in;">
<br /></div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-align: left; text-indent: -0.25in;">
<span style="text-indent: -0.25in;"> Create an archive
file with the META-INF directory and the compiled .class file of the
service</span></div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-align: left; text-indent: -0.25in;">
class and rename the archive to a .aar </div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-align: left; text-indent: -0.25in;">
</div>
<div style="margin-bottom: 0in;">
</div>
<div style="margin-bottom: 0in;">
Now you have a
deployable axis2 service with you.</div>
<br />
<div style="margin-bottom: 0in; margin-left: 0.49in; text-align: left; text-indent: -0.25in;">
<br /></div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-align: left; text-indent: -0.25in;">
<br /></div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-indent: -0.25in;">
<br /></div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-indent: -0.25in;">
<br /></div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-align: left; text-indent: -0.25in;">
<b><br /></b></div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-indent: -0.25in;">
<br /></div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-indent: -0.25in;">
<br /></div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-indent: -0.25in;">
<br /></div>
<div style="margin-bottom: 0in; margin-left: 0.49in; text-indent: -0.25in;">
<br /></div>
</div>
<br />
<br />
Unknownnoreply@blogger.com0