Archive for the ‘General’ Category.

NX-OS FCoE License

Enabling FCoE on a Nexus swich is pretty simple:

feature fcoe

What’s not all that well documented is that uses a temporary 120 day license. After the 120 days the switch disables FCoE. That is a very bad thing, especially when the switch is providing the storage backbone for a vSphere cluster running around 200VMs.

To properly license FCoE a license number must be registered on Cisco’s website. This generates a license file that gets uploaded to the switch. http://www.cisco.com/en/US/docs/switches/datacenter/sw/nx-os/licensing/guide/Cisco_NX-OS_Licensing_Guide_chapter1.html#task_24958

NX-OS TFTP

Typically on Cisco IOS the copy command will use the default management interface for TFTP traffic. After quite a bit of throubleshooting I found out this is not the case with the NX-OS. You need to put in a vrf. By default for the management interface ‘management’ must be entered.

Nexus_5010_Switch# copy tftp://10.10.10.10/test.dat bootflash
Enter vrf (If no input, current vrf 'default' is considered): management
Trying to connect to tftp server......
Connection to Server Established.

Run Internet Explorer 7 On Vista and Windows 7

I do a lot of web development and constantly switch back and forth between browers to make sure that sites look the same. Since I run Windows 7 my choice of what version of Internet Explorer I can use is limited to IE8. However it turns out that there is a very nice set of developers tool in IE8 that is accessible by pressing the F12 key (or going to Tools – Developer Tools). It is very easy to switch between IE7 and IE8.

Getting Hadoop MapReduce 0.20.2 Running On Ubuntu

I decided to setup a Hadoop cluster and write a MapReduce job  for my distrbuted systems final project. I had done this before with an earlier release and it was fairly straight forward. It turns out it is still straight forward with Hadoop 0.20.2, but the process is not well documented and the configuration has changed. Hopefully I can clear up the process here.

What is Hadoop MapReduce?

MapReduce is a powerful distributed computation technique pioneered by Google. Hadoop MapReduce is an open source implementation written in Java that is maintained by the Apache Software Foundation. Hadoop MapReduce consists of two main parts: the Hadoop distrbuted file system (HDFS) and the MapReduce system.

Getting Hadoop

The first step is to download Hadoop. Go to http://hadoop.apache.org/mapreduce. It is worthwhile to read up on how Hadoop and MapReduce work before you move onto the installation and configuration.

Plan The Installation

Before the actual installation there is a bit of planning to be done. Hadoop works best when run from a local file system. However for convienceince it is also nice to have a common NFS file share to save configuration and log files. Below is an image of what I setup. For the distributed setup at least two nodes are required.

Initial Setup

Before doing any setup of the actual Hadoop system there is some initial setup that needs to be completed, namely the creation of a directory on each node and a shared ssh key. The first step is the easiest. A hadoop install directory needs to be created on each nodes that is going to be a part of the system. The directory must have the same name and location on each node. It is recommended not to use an NFS file share for the installation directory as it can affect performance.

After the install directory has been created a shared ssh key needs to be generated on each node and added to the authorized_hosts file. This allow for passwordless ssh login and is required by the Hadoop cluster startup scripts.

Open Firewall Ports

Hadoop requires a number of ports to be open for the system to work.

Port Function
50010 DataNode Port
50020 JobTracker Service
50030 MapReduce Administrative Page
50105 Backup/Checkpoint node
54310 HDFS File System
54311 JobTracker Service
50060 TaskTracker Port
50070 DFS Administrative Webpage (namenode)
50075 DataNode Port
50090 SecondaryNameNode Port

Configuration Files

There are three main configuration files that need to be edited: hdfs-site.xml, mapred-site.xml, and core-site.xml. Each file resides in the conf folder where Hadoop is extracted from. There are a lot of parameters that can go into each file but only a few basic ones needs to be set. I have provided my configuration files below. The final file that needs to be edited is hadoop-env.sh, which is a shell script that sets up Hadoop environment variables. At the very least the $JAVA_HOME variable needs to be uncommented and properly set.

core-site.xml

hdfs-site.xml

mapred-site.xml

hadoop-env.sh

Set the Slaves and Master

The master node needs to be defined in the hadoop_dir/conf/masters file. Each slave node needs to be hadoop_dir/conf/slaves file, one machine name/IP address per line.

Deploy the Installation and Configuration Files

The installation and configuration files need to be deployed to each node in the cluster. The easiest way to do this is through scp. I wrote the script below so that I could run a command on each node in my cluster. Another alternative is the Cluster SSH program (cssh). Either approach is preferable to logging onto each node to run  a command.

Using my run_comm.sh script I ran scp on each node in the cluster:

./run_comm.sh "scp -r ~/hadoop /opt/hadoop/hadoop"

This runs the command in quotes on each node in the cluster. In this case I copied the Hadoop installation fom the NFS share (my home directory) to a local directory on each node.

run_comm.sh

Formatting the NameNode

Now that the Hadoop files are on each node the NameNode can be formatted to setup the Hadoop File System.

hadoop_dir/bin/hadoop namenode -format

Starting the Hadoop File System

Now that the namenode has been formatted the distributed file system (DFS) can be started. This is done by using the start-dfs.sh script in the bin directory of the Hadoop installation.

hadoop_dir/bin/start-dfs.sh

The status of the Hadoop File System can be viewed from the administrative page on on the master server, http://master_server:50070.

Starting the MapReduce System

The final step to setting up MapReduce is to start the MapReduce system. This is done by using the start-mapred.sh script that is located in the bin directory of the Hadoop installation.

hadoop_dir/bin/start-mapred.sh

The status of the MapReduce system can be viewed from the administrative page on on the master server, http://master_server:50030.

Submitting a MapReduce Job

Now that the cluster is up and running it is ready to start accepting MapReduce jobs. This is done using the hadoop executable from the bin directory of the Hadoop installation and a jar file that contains a MapReduce program. An example of running the WordCount demo program provided with Hadoop is shown below.

hadoop_dir/bin/hadoop jar jar_location/wordcount.jar org.myorg.WordCount /file_dir_in_hdfs /output_dir_in_hdfs

Performance Report in the Virtual Infrastructure Client

VMware vCenter server reports a lot of performance information and displays tables in the Virtual Infrastructure client. They provide a nice at a glace view, but do not allow for anything more. While poking around the GUI I found a feature to export the performance data to Excel by going to file-reports-performance. This is a nifty tool that is not very well documented.

Automate Website Visits With Powershell and Internet Explorer

For my research I found the need to automatically visit a webpage to run a setup and a teardown script. Turns out that it is fairly easy to do. The script is included below.

#cd to Internet Explorer
cd "C:\Program Files\Internet Explorer"
#point ie to the teardown script
./iexplore.exe 10.0.0.20/teardown.php
#sleep for one second - this is needed so IE has a chance to start before it is killed
sleep 1
#kill the internet explorer process
get-process iexplore | stop-process

Background Jobs In Powershell

I have been doing a lot of powershell scripting for my senior thesis. I had the need to run a background job and did not find helpful information through searching Google so I figured I would post this.

Powershell 2 support running scripts in the background with a simple command. The only caveat is that it will only run other powershell scripts.

Start a background job: $job=start-job “script.ps1″

Wait for the job to finish: wait-job($job)


sEDF CPU Scheduler in Xen

By default the Xen Hypervisor uses the credit CPU scheduler. The sEDF (simple earliest deadline first) CPU scheduler can be used by setting the sched boot parameter equal to sedf. The easiest way to do this is by editing the grub boot loader config file, menu.lst. The file is located in /boot/grub/menu.lst. The file must be edited by a root user (this can be done in Ubuntu by using the sudo command). This is demonstrated in the entry below. I just copied the existing Xen boot entry and added this one with the sched parameter so I could choose between schedulers at boot time.

title    Xen 3.3 / Ubuntu 8.04.3 LTS, kernel 2.6.24-26-xen sEDF SCHEDULER
root     (hd1,0)
kernel   /boot/xen-3.3.gz sched=sedf
module   /boot/vmlinuz-2.6.24-26-xen root=UUID=e8c13945-5158 console=tty0
module   /boot/initrd.img-2.6.24-26-xen
quiet

Windows 7 Won’t Sleep

Recently I have been having a problem with Windows 7 not being able to sleep. After digging around in the power settings I found the culprit – media sharing. Here is how to turn it off.

  1. Go the power settings in the control panel.
  2. Click on “Change plan settings” next to the active power plan.
  3. power_plan

  4. Go to “Advanced power settings”.
  5. adv_power

  6. Scroll down to “Multimedia settings” and make sure “When sharing media” is set to “Allow the computer to sleep”.
  7. sleep

    There you have it. Now your pc will be able to sleep again.

5 Reasons Why Windows 7 Rocks!

It seems Windows has learned a lot since the horrifically terrible release of Vista. I have been running Windows 7 Professional for the last two weeks and will attempt to sum up the 5 reasons why Windows 7 Rocks! It no only installs quickly, it also runs like a dream … so far anyway.

Windows-7-screen

  1. The Task Bar- Windows 7 features a totally redsigned task bar. It like grouped icons on steroids. The task bar now only has a handfull of icons- one for each running application.
  2. taskbar
    Multiple instances of a running program are grouped together and you can preview the window by hovering the mouse over the task bar icon. This features is great when web-browsing. IE and Firefox both support the preview of each open tab.

    tab_preview

  3. Media Center- Media Center seems to get better and better with each release. The UI is more smooth and usable then in XP and Vista. Amazingly Media Center is included in the Professional Edition of Windows 7!media center
  4. Driver Support- I have installed Windows 7 on my MSI Wind u100 netbook and desktop, both of which are newer systems (less than a year old). An interesting thing happened after the install- All of the drivers were detected. I can truly say that this is a first. The driver support in Windows 7 is rock solid. I plugged my phone in and Windows automatically found and downloaded a driver from Windows Update (granted it was a Windows Mobile phone).
  5. Speed- Windows 7 run much smoother then Vista. I saw a great improvement in usability on my netbook and my desktop was much more stable. Windows 7 requires less memory which frees up resources for your applications.
  6. Battery Life – I have not done extensive tests, but am seeing a much better battery life on my netbook. So far I have seen around a 15%-20% longer battery life.

In short Windows 7 is a great improvement over Vista. That said there are still some caveats. The most major one being the price. Yeah its nice, but $200 nice – in this economy probably not. I have also found a few applications that worked well under Vista that refuse to run in Windows 7.