• Adventures in Load Balancing: Kemp (@KempTech)

    My current project is a migration from Exchange 2003 to Exchange 2010. We wanted to load balance our CAS servers and do some SSL offloading. I have never worked with a load balancer before – pretty cool stuff. We have been using a couple of Kemp 2600’s in an active passive configuration. The Kemp devices have a nice price point and seem to have all the functionality that we need. Plus the support has been excellent. They have really helped us get up and running. Things I have learned while implementing these devices:

    • You actually set the CAS servers IP gateways to the load balancer. I guess the device acts like a router when it receives new traffic that did not originally pass through the device.
    • Clients and servers can not be in the same subnet if you want to use Layer 7 transparency. Traffic will hit the load balancer and it will pass it along to the server. The server will see that the traffic originated on the same subnet, and it will send the return straight back to the server, not through the load balancer. Timeouts result.
    • The documentation repeatedly refers to “clients”. A “client” can be a workstation, but it can also be a service.  Our BES server was connecting to the CAS to find the “/Autodiscover/Autodiscover.xml” info. Since it was on the same subnet as the CAS servers, they replied back directly and not through the load balancer. Timeouts again.
    • I really like the idea of a drain stop. I can move all traffic to one CAS and work on the other.
    • We ended up turning off Layer 7 transparency since we have all servers on the same subnet. The only other real choice would be to move the load balanced servers to their own subnet. The loss of transparency means that all connections seem to originate on the load balancer. So logs become pretty useless. Trouble shooting will occur on the Kemp. We can always ssh in and run a TCPDUMP.
    Now I need to find other cool things we can do with these cool Kemp boxes.

  • Windows Server 2008 persistent routes

    I can never remember this, so I thought I would blog it

    route -p add XXX.XXX.XXX.0 mask 255.255.255.0 YYY.YYY.YYY.1

    XXX = Network
    YYY = Gateway


  • Changing NIC order in 2008 R2 SP1

    I can never remember how to change the NIC order in 2008 R2. Navigate to “Networking Connections” and then hit “Alt” to bring up the menu. There you can find “Advanced” menu and the “Advanced Settings” option. There has to be an easier way, but that is the only way I know hot to get to it.

    Poor design.


  • OS X: Running a script when a USB drive is inserted

    I rsync all my data to a USB drive that I keep at work. I wanted a way to have my rsync script automatically run when I plugged in the drive – kinda like Time Machine.

    It ended up being pretty simple. All I needed to do is create and AppleScript and attach it to a “Folder Action” for the /Volumes folder. This script below is launched when a new item is added to the /Volumes folder, i.e. when you insert a new volume. This script will try to run a BASH script if it exists on that volume (.OnInsert)

    on adding folder items to this_folder after receiving these_items
    	repeat with current_item in these_items
    		try
    			do shell script POSIX path of current_item & ".OnInsert"
    		end try
    	end repeat
    end adding folder items to
    

    Save this as a .scpt file and put it in ~/Library/Workflows/Applications/Folder\ Actions folder.
    Next, right click the /Volumes folder and select Services -> Folder Action Setup and attach the script you just created
    AutoMagic!


  • Running a BASH script when my Laptop is opened at home – Part 2

    As I mentioned in this post I should be able to run a script to find my current gateway’s MAC address. With this info, I should be able to tell when I am home, and launch a script. In this post, I talk about sleepwatcher, which runs a script when the machine is woken up. Sleepwatcher looks for a file named .wakerc and executes it when the machine wakes. If I put the following in my .wakerc, it will execute whatever I like (for example a rsync script) when the machine is woken up and at home:

     

    #!/bin/bash
    sleep 120
    GATEWAY=`/usr/sbin/netstat -rn | /usr/bin/grep default | /usr/bin/grep en1 | /usr/bin/cut -c20-35`
    MACADDRESS=`/usr/sbin/arp -n $GATEWAY | /usr/bin/cut -f4 -d' '`
    if [ "$MACADDRESS" = "xx:xx:xx:xx:xx:xx" ]; then
    	/bin/echo "$(date): I am at home now: $MACADDRESS" >> ~/Desktop/wake.txt
    	# script I want to run at home is next line
    	rsync Documents/ server:Documents/
    else
    	/bin/echo "$(date): I don't know where I am: $GATEWAY $MACADDRESS" >> ~/Desktop/wake.txt
    fi
    
    

  • How to remove a machine from a RHN Satellite

    I wanted to move a VM from a RHN Satellite back to the default Red Hat Network. I found these two files contained all the info:

    /etc/sysconfig/rhn/up2date
    /etc/sysconfig/rhn/systemid

    I just moved them aside and ran rhn_register to re-register the system.

    Then I ran “yum clean all” to make yum happy


  • Rebuild your the default CentOS yum.repo.d folder

    On a dev machine, somehow, I managed to erase my yum.repo.d contents. I wanted to rebuild the repo files back to their default. First you need to figure out what version you are using:

    • cat /etc/redhat-release

    Then visit the correct release at : http://vault.centos.org/

    • navigate to the correct os/x86_64/CentOS/ directory (could be os/x86_64/CentOS/ i386/)
    • Download the following files to the server:
      • wget http://vault.centos.org/5.x/os/x86_64/CentOS/centos-release-notes-5.x-0.x86_64.rpm
      • wget http://vault.centos.org/5.x/os/x86_64/CentOS/centos-release-5-x.el5.centos.x86_64.rpm
    • Then install the two rpms:
      • rpm -Uivh *.rpm
    Should be back to the original shipping repo files.

  • Install VMware ESX4.1 via PXE

    We recently received 2 new servers that I needed to install the newest ESX on. I downloaded the IOSs, but I did not want to have to burn them. So I decided to try and install ESX via PXE. I did not have an answer file (kickstart), so I wanted to run an interactive install from PXE.

    I already had a PXE/TFTP server configured, so I just needed to add a new instance to the pxelinux.cfg file.

    LABEL VMWARE-ESX
    KERNEL images/vmware/esx/vmlinuz
    APPEND initrd=images/vmware/esx/initrd.img vmkopts=debugLogToSerial:1 mem=512M url=http://server.name.local/vmware

    The different options for “APPEND” can be found here. Works like a charm.