Monday, February 14, 2011

Netstat

netstat displays the  contents  of  various  network-related  data structures in  depending on the options selected.
Syntax :
netstat  <option/s>
multiple options can be given at one time.
Options
 -a - displays the state of all sockets.
 -r - shows the system routing tables
 -i - gives statistics on a per-interface basis.
-m - displays information from the network memory buffers. On Solaris, this shows statistics
         forSTREAMS
 -p [proto] - retrieves statistics for the specified protocol
  -s - shows per-protocol statistics. (some implementations allow -ss to remove fileds with a value of 0 (zero) from the display.)
 -D - display the status of DHCP configured interfaces.
-n do not lookup hostnames, display only IP addresses.
-d (with -i) displays dropped packets per interface.
-I [interface] retrieve information about only the specified interface.
-v be verbose
interval  -   number for continuous display of statictics.
Example :
$netstat -rn
Routing Table: IPv4
  Destination           Gateway               Flags  Ref   Use   Interface
-------------------- -------------------- ----- ----- ------ ---------
192.168.1.0         192.168.1.11           U        1   1444      le0
224.0.0.0             192.168.1.11           U        1   0            le0
default                  192.168.1.1           UG       1   68276 
127.0.0.1             127.0.0.1               UH       1  10497     lo0
This shows the output on a Solaris machine who's IP address is 192.168.1.11 with a default router at 192.168.1.1

Veritas Volume Manager

Why would you NOT want to do root-disk encapsulation with Veritas?

This is not nessacarily the case anymore with versions of VxFS greater than 4.5. root disk encapsulation requires kernel-level drivers in most cases. Because of this, encapsulating the root partition can make it unreadable in a bare-metal recovery situation.

Solaris Boot Disk Failure

Recovering from primary boot disk failure:

If the primary root disk fails, the system will continue to run from the
secondary boot disk. There will be SCSI errors on the console, about the disk
failure.

"Primary root disk can be replaced online without bringing down the system"


Note: It is not necessary to remove the failed disk using the cfgadm or devfsadm
commands. If a new disk is installed in place of the failed disk, just
execute the devfsadm command, so that the OS can recognize the new disk.
Then the "format" command will show the new disk. If the new installed
disk installed has no fdisk partition, then create the fdisk partition
from the format program, so that the new disk can be used for mirroring.

Replacing a Failed Disk(SVM)

Step-by-Step Procedure for replacing a failed disk:

1. Insert the new disk in place of the failed disk. Create the whole disk for
Solaris partition.

2. copy the VTOC of the secondary disk to the primary disk.
Example: prtvtoc /dev/rdsk/c1t1d0s2 | fmthard -s - /dev/rdsk/c1t0d0s2

3. Then re-attach the failed mirrors using the metareplace command.
Example: metareplace -e d0 < new disk >

Once the resynchronisation has completed, the primary disk is successfully
mirrored back online.

NOTE: The above procedure can be followed for replacing a secondary disk
failure.

Solaris VMSTAT

A.   CPU issues:
Following columns has to be watched to determine if there is any cpu issue
  1. Processes in the run queue (procs r)
  2. User time (cpu us)
  3. System time (cpu sy)
  4. Idle time (cpu id)
5.     Problem symptoms:
6.    
1.)   If the number of processes in run queue (procs r) are consistently greater than the number of CPUs on the system it will slow down system as there are more processes then available CPUs .
2.)    if  this number is more than four times the number of available CPUs in the system then system is facing shortage of cpu power and will greatly slow down the processess on the system.
3.)    If  the idle time (cpu id) is consistently 0 and if the system time (cpu sy) is double the user time (cpu us)  system is facing shortage of CPU resources.
 
Resolution :
         Resolution to these kind of issues involves tuning of application procedures  to make efficient use of cpu  and as a last resort increasing the cpu power or adding more cpu to the system.

B.   Memory Issues:
Memory bottlenecks are determined by the scan rate (sr) . The scan rate is the pages scanned by the clock algorithm per second. If the scan rate (sr) is continuously over 200 pages per second then there is a memory shortage.

Resolution :
1. Tune the applications & servers to make  efficient use of memory and cache.
2. Increase system memory .
3. Implement priority paging in s in pre solaris 8 versions by adding line "set priority paging=1" in /etc/system. Remove this line if upgrading from Solaris 7 to 8 & retaining old /etc/system file

iostat

Solaris 
1)IOSTAT:
The values to look from the iostat output  are:
  • Reads/writes  per second (r/s , w/s)
  • Percentage busy (%b)
  • Service time (svc_t)
If a disk shows consistently high reads/writes along with , the percentage busy (%b) of the disks is greater than 5 percent, and the average service time  (svc_t) is greater than 30 milliseconds, then  one of the following action needs to be taken
1.)Tune the application to use disk i/o more efficiently  by modifying the disk queries and using available cache facilities of application servers .
2.) Spread the file system of the disk on to two or more disk  using disk striping feature of volume manager /disksuite  etc.
3.) Increase the system parameter values for  inode cache  , ufs_ninode ,  which is  Number of inodes to be held in memory. Inodes are cached globally (for UFS), not on a per-file system basis 
4.) Move the file system to another faster disk /controller  or replace existing disk/controller to a faster  one.

Performance Monitoring

iostat , vmstat and netstat are three most commonly used tools for performance monitoring . These comes built in with the operating system and are easy to use .iostat stands for input output statistics and reports statistics for i/o devices such as disk drives . vmstat gives the statistics for virtual Memory and netstat gives the network statstics


Iostat

Vmstat

Netstat

Making a bootable ZFS Root Mirror

Making a bootable ZFS Root Mirror
1.     Installed ZFS OS to Disk A (c0t0d0s0)
2.     Format Disk B (c0t1d0s0) properly.
3.     Overwrite the Disk format properly:
Testserver# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard –s - /dev/rdsk/c0t1d0s2
4.     Attach Disk B to the ZFS Root Pool:        
          Testserver#zpool attach –f rpool c0t0d0s0 c0t1d0s0
5.     Install installboot on Disk B
# installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0
6.     Test the worst Case: Disk A fails, you can still boot into Disk B
-        Remove Disk A
-        Replace it with an emtpy Disk C
-        Start the System: Choose to boot from Disk B in the Bios
-        Repeat Steps 2. till 5. for Disk C (swap c0t0d0s0 and c0t1d0s0)
-        Start the System like before (from Disk C)

Patch Add Steps

Patch add steps

1) Need to take the backup filesystem through ufsdump or , 
need to remove one of the root mirror from the server .

2) Need to check the current patch version on the server .

# uname -a ( For kernel patch )

# showrev -p ( For other patches )

3) Check the latest patch in http://sunsolve.sun.com 

4) Gothrough the Read me file 

5) Boot the server in to the single user mode 

#shutdown -g0 -y -i1 ( or #init 0 & ok boot -s )

6) Install the patch 

#Patchadd < Ptach >

7) Down the machine in to the OBP using #init 0

8) Do the reconfiguration boot 

#boot -r 

9) Check the patch is updated pr not

Solaris 11 Login Screen

Java Image1

Java Image1

Google Apps marketplace

Google Apps marketplace




Google Apps (http://www.google.com/apps/) is a significant component of Google ecosystem. For those of you who are not familiar with Google Apps, it is a Google service that provides various Google products (such as gmail and google docs) on a custom domain. Anyone with a domain name can avail of this service, which is free for up to 50 uses.



Google Apps allows a domain owner to leverage Google's infrastructure and deploy Google's popular applications on his domain without incurring any additional hardware/software overhead. Google also offers ‘Google Apps Marketplace', a web-based platform meant for finding/installing third-party on-line applications that work with Google Apps' built-in application mix.



The latest development in the ‘Apps Marketplace' front is the launch of a new channel exclusively meant for the education segment (http://goo.gl/pdGZJ). In this category one can find several applications useful for both teachers and students.



Brainpop, a popular on-line service that creates educational content for kids is a good example.



The service offers animated educational movies on a range of topics within Science, Technology, Social studies, English and so on. Although Brainpop is not a free service, for ‘Google Apps' users it is available for free till March 11, 2011.

Solaris Console

Solaris Image