Thursday, October 15, 2009

nxserver incompatibility with jboss ports

nxserver (see www.nomachine.com) is an amazing replacement for vncserver. I REALLY like it. It comes with great support like:
  1. clipboard copy/paste between your machine and the remote host that always works
  2. screen resolutions that adapt to your machine with zero headaches
  3. many more things...check it out!
However, I had some trouble when I installed it on a new Linux machine and then I tried to get my JBoss AS working. The problem is basically that the X Windows traffic ports for nxserver start at 7000. JBoss by default starts there too e.g. 7001.

The solution that in the end worked best for me was to just shutdown the nxserver sessions and running JBoss first. Then while JBoss is running start up the nxserver and connect. nxserver will skip over the ports being used by JBoss and use unused ports further up the 7000 range. 

NOTE: Even if nxserver is stopped there can be persistent sessions. You can check by running:
  • ps -ef | grep nxagent 
  • netstat -ap | grep nxagent 
Make sure they return no results. If there are results, shutdown the current sessions by logging in and logging out of the sessions manually. There is probably another way of killing the sessions but that is what I did.  

Wednesday, October 14, 2009

Changing linux kernel params for Oracle Enterprise Install

One of the things that Oracle needs on Linux is some specific kernel parmeters setting. These I changed in:
/etc/sysctl.conf
The settings I used were:
# Oracle XE Recommended Values
kernel.sem = 250 32000 100 128
kernel.shmmax = 536870912
# Oracle Enterprise Recommended Values
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144
net.ipv4.ip_local_port_range = 1024 65000

Changing your linux hostname (RedHat)

Recently I tripped up when I got another linux box and move my old machine to a new hostname. This actually manifested itself as an error when I installed oracle and oracle could not find the localhost machine since the old machine name that was still configured. The oracle error was:
Enterprise Manager Config failed due to Invalid value null for parameter PORT
Yeah...not exactly a great error message, but when I ran emctl the error was clearer. The steps to making sure you change your host name are simply:
  1. edit /etc/sysconfig/network. Change the line HOSTNAME=[hostname of machine]
  2. edit /etc/hosts. On the loop back adapter add in your new hostname. If you use static IP add in the IP address mapping too. 
  3. run: service network restart, to restart the network with the new settings
Then just exit out of any terminal window that might have cached the network settings before executing your required task.

Friday, October 09, 2009

Getting wireshark/tcpdump to capture all HTTP traffic and not truncate

One issue I saw today was that when running tcpdump to analyse some http traffic it was initially saying that the http traffic was truncated. We fixed this by making sure there was no limit on the slice based on maximum packet size. We did this by using parameter "-s0" e.g.


tcpdump -i eth0 -w outputfile.tcp -s0

Wednesday, October 07, 2009

Eclipse and Linux...lesson 1: workspace in use message

With my new job (Nokia Interactive Advertising) I am now using Eclipse on Linux (and my traditional NetBeans but that's more work since we are really an eclipse shop). One issue I had to resolve was around Eclipse refusing to start and reporting "workspace in use". Apparently this is more common to see on Linux (which I can relate to since I never saw it on Windows). I resolved this by deleting the file:

$workspace_dir/.metadata/.lock


Thanks to http://episteme.arstechnica.com/eve/forums/a/tpc/f/96509133/m/885009595731 for that posting.