Thursday, October 27, 2011

Get thread dumps for Oracle AS managed by OPMN (linux)

Usually getting the thread dump in linux environment is quite easy.
"kill -3 " will do the work.
However, when I tried to get the thread dump for the oc4j thread started via OPMN, I always got a blank response. According to http://mike-lehmann.blogspot.com/2006/10/thread-dump-with-oracleas-on-windows.html ,
However, when you go to the normal Oracle Application Server deployment environment on Windows which uses the Oracle Process Manager OPMN to manage OracleAS, getting a thread dump is a little trickier because OPMN is a second process which is spawning the JDKs which run each OC4J instance.


So whenever running "kill -3", you'll not get the thread dump from the output. Instead, it goes to the opmn log files, which usually is in folder $ORACLE_HOME/opmn/logs, with the name like "default_group~oc4j_soa~default_group~1.log".

Thursday, June 23, 2011

Resizing vmware disk space

After expanding the disksize in vmware player, my guest linux didn't recognize the newly-added space. Here's what I did to solve the problem.
1. Use fdisk to create a partition.
n, p, ...
2. Create physical volume
pvcreate /dev/sda3
3. Check physical volume to make sure it's working
pvscan
4. Create Volume group for the physical volume
vgcreate VolGroup00 /dev/sda3
5. Check the volume group
vgscan
6. Activate the volume group
vgchange -ay
7. Create a logical volume using the volume group
lvcreate -L 10g -n LogVolume00 VolGroup
8. Create file system on the logical volume
mkfs.ext3 -m 0 /dev/VolGroup00/LogVolume00
9. Mount the logical volume to a folder, and it'll be ready for use.
mount /dev/VolGroup00/LogVolume00 /u01/app/fusion

Wednesday, June 22, 2011

Expanding Linux disksize in vmware

This article is from http://blog.gulfsoft.com/2009/01/adding-disk-space-to-linux-vm-in-vmware.html .
And it really helped me out when resizing my linux vmwares.

A little while back Frank posted a blog about increasing the size of a logical volume in Linux (http://blog.gulfsoft.com/2008/11/adding-disk-space-to-linux-vm-in-vmware.html). I tried this out and it worked great.

I also had to do something similar in Windows, which turns out to be much simpler by using the VMWare Converter. Unfortunately this is not supported for Linux. The one thing that got me thinking though is that Windows can increase from a single drive and not have to use a separate drive. So why could I not do this in Linux?

The reason I needed to do this was for the new version of TPM (7.1). I originally had my VM set up with 20GB allocated, but the new version now requires approximately 50Gb to install, so the steps below are what I used to increase the LVM for my TPM install.

Here is my setup:
VM Ware: VMWare Server 2.0.0
Host OS: Windows 2003 SE SP2 x64
Guest OS: Red Hat ES4 U5

Increase VM Disk Size
Use the VMWare tool vmware-vdiskmanager.exe to increase the size

C:\Program Files (x86)\VMware\VMware Server>vmware-vdiskmanager.exe -x 50GB "f:\
VM_Images\VM TPM7.1 RH\rhes4srv01\Red Hat Enterprise Linux 4.vmdk"
Disk expansion completed successfully.


Use fdisk to create new partition
Even though the previous step reports that more disk was added, it still is not recognized by the OS.

Current file system:
df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00 19448516 1964128 16496436 11% /
/dev/sda1 101086 13232 82635 14% /boot
none 257208 0 257208 0% /dev/shm

1. Enter the FDISK utility
fdisk /dev/sda

2. Print the existing partition table
Command (m for help): p

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2610 20860402+ 8e Linux LVM

3. Create new partition. This will be a Primary partition and is the 3rd partition. For the cylimder values, press enter to accept the defaults

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (2611-6527, default 2611):
Using default value 2611
Last cylinder or +size or +sizeM or +sizeK (2611-6527, default 6527):
Using default value 6527

4. Set the Partition type to Linux LVM (hex 8e)
Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 8e
Changed system type of partition 3 to 8e (Linux LVM)

5. Print the Partition table again to see the new partition
Command (m for help): p

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2610 20860402+ 8e Linux LVM
/dev/sda3 2611 6527 31463302+ 8e Linux LVM

6. Write the new partition information
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

7. Reboot

Create the Logical Volume
Now that the partition is created, the physical and logical volume needs to be created

1. Create the Physical Volume - use the new partition information from the df command. In this case the new partition is /dev/sda3
pvcreate /dev/sda3
Physical volume "/dev/sda3" successfully created

2. Add the new Physical Volume to the Logical Volume
vgextend VolGroup00 /dev/sda3
Volume group "VolGroup00" successfully extended

3. Extend the Logical Volume.

vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 49.88 GB
PE Size 32.00 MB
Total PE 1596
Alloc PE / Size 635 / 19.84 GB
Free PE / Size 961 / 30.03 GB
VG UUID bzOq45-o5yO-ruYY-Ffx1-DxCx-2e2j-ardXtu

lvextend -L +30.03G /dev/VolGroup00/LogVol00
Rounding up size to full physical extent 30.03 GB
Extending logical volume LogVol00 to 48.88 GB
Logical volume LogVol00 successfully resized

Note: The lvextend can either use the value of the Free PE from the vgdisplay command or the command lvextend -l +100%FREE /dev/VolGroup00/LogVol00. I found out about the %FREE after, so I did not test this.

4. Extend the filesystem
The resize2fs does not work for this situation. The command ext2online will allow for the disk to be resized while disk is still mounted.

ext2online /dev/VolGroup00/LogVol00

5. View the new file system
df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00 50444996 1972848 45911716 5% /
/dev/sda1 101086 13232 82635 14% /boot
none 1825828 0 1825828 0% /dev/shm

And there is a system with a nice large drive. Hope this helps you.

Wednesday, May 11, 2011

Suse ES networking problem on vmware

After restarting vmware of SES, from time to time, the network interface got changed.
As a result, the network connection would stop working.

The resolution to this issue is to manually edit /etc/udev/rules.d/70-persistent-net.rules file. This file has two entries related to network cards:


# PCI device 0x8086:0x10f5 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:ac:ee:0d:d5", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x10f5 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:ac:e0:fd:23", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

The first entry with eth0 is the original virtual machine MAC address. The second entry is the new NIC with the new MAC address.

You must change the MAC address in the first entry from eth0 to eth1 and remove the second entry.

After a reboot, the cloned virtual machine has network connectivity.

The original source of this solution is http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1021624 .

Tuesday, May 03, 2011

Resolving SoapUI starting failure on Linux RedHat ES.

The binary zipfile of SoapUI would not work directly with Linux RH ES.
When the soapui.sh is executed, some error would be reported and the process aborts.
It turned out that it's a known issue, what needs to be done is uncommenting existing line in the soapui.sh script.
# JAVA_OPTS="$JAVA_OPTS -Dsoapui.jxbrowser.disable=true"

The original solution is described here:
https://www.eviware.com/forum/viewtopic.php?t=2802 .

NX: a good remote GUI for Linux

Installing and configuring NX on Linux is easy.
Step1: download all the packages including nxclient, nxnode, nxserver from the server.
Step2: (I downloaded the tar file for installation) copy those tar.gz file to /usr directory. --> the /usr directory is a requirement for installation. Otherwise, you'll get errors such as "could not create configuration file".
Step3: execute installation scripts, as described in http://www.nomachine.com/download-package.php?Prod_Id=2522.
Step4: start the server by using "nxserver --start" command.

Use NX client is also easy. You just need to download and install the NXclient on your windows machine. With the SSH credential, you should be able to access the server which has just been configured.

Tuesday, March 08, 2011

Use mod_dumpio, mod_logio in Apache server

Mod_dumpio and mod_logio enables the logging for http request/response and the size of the request/resposne.
However, they'll not be configured by default installation procedures.

Here are steps to use them:

1. download the apache source files, and upload it to linux server.
2. go to existing apache bin directory, run the following commands:
sudo ./apxs -c /tmp/apache/httpd-2.0.64/modules/loggers/mod_logio.c

sudo ./apxs -i -a -n mod_logio /tmp/apache/httpd-2.0.64/modules/loggers/mod_logio.la

3. change the httpd.conf file and make sure the module is loaded and the logging format is changed.