Tuesday 23 September 2014

suncluster configuration information for resource group script ??

#!/usr/bin/bash
#########################################
######### TESTING SCRIPT#######
########## SUN CLUSTER Info##############
#####VERSION=1.0############################
##DESIGN&IMPLEMENTED:CHITTIBABU MIRIYALA#
#########################################
echo "From:chittibabu.oracle@gmail.com" >"/tmp/output1"
echo "To:chittibabu.oracle@gmail.com">>"/tmp/output1"
echo "Subject:SUNCLUSTER CONFIGURATION INFO: TESTNODE1 & TESTNODE 2(testdgrg) ">>"/tmp/output1"
echo "Content-type: text/html">>/tmp/output1
echo "<html>">>"/tmp/output1"
echo "<body>">>"/tmp/output1"
echo "<table width=100%>">>"/tmp/output1"
echo "<tr bgcolor="#00FF00"><pre>" >>/tmp/output1
/usr/cluster/bin/clrg  status testdbrg >>"/tmp/output1"
echo "</pre></tr>"  >>/tmp/output1
echo "<tr bgcolor="#D8BFD8"><pre>" >>/tmp/output1
/usr/cluster/bin/clrs status -g testdbrg >>"/tmp/output1"
echo "</pre></tr>"  >>/tmp/output1
echo "<tr bgcolor="#D2B48C"><pre>" >>/tmp/output1
/usr/cluster/bin/clrg  show -v testdbrg >>"/tmp/output1"
echo "</pre></tr>"  >>/tmp/output1
echo "</table>" >>"/tmp/output1"
echo "</body>">>"/tmp/output1"
echo "</html>">>"/tmp/output1"
cat "/tmp/output1"|mail chittibabu.oracle@gmail.com
>"/tmp/output1"

Saturday 20 September 2014

how to release zfs cache memory online?

problem:-
server have 128GB RAM only application using 97 GB but top command showing 127.3 GB used & 0.7 free
solution:-
zfs consumes more meory.
1)TO CHECK KERNAL MEMORY STATUS
# echo "::memstat" |mdb -k
Page Summary                Pages                MB  %Tot
------------     ----------------  ----------------  ----
Kernel                     299058              2336   10%
ZFS File Data             1221918              34359738   40%
Anon                      1457002             11382   47%
Exec and libs                1484                11    0%
Page cache                  27856               217    1%
Free (cachelist)            12098                94    0%
Free (freelist)             66007               515    2%
Total                     3085423             24104
Physical                  3071311             23994
2)MAKE A LARGE FILE IN /tmp DIRECTORY
 # cd /tmp
 # ls
crontab.1647             crontab.1945             gdm-auth-cookies-.raWbc  hsperfdata_oracle        hsperfdata_root          sh1647.1
# du -sh *
   0K   crontab.1647
   0K   crontab.1945
   8K   XYZ
 104K   hsperfdata_oracle_ABC
   8K   hsperfdata_oracle_BAC
   8K   sh1647.1
 # mkfile 50G test
3)CHECK MEMORY STATUS
# echo "::memstat" |mdb -k
-bash: fork: retry: Resource temporarily unavailable
-bash: fork: retry: Resource temporarily unavailable
Page Summary                Pages                MB  %Tot
------------     ----------------  ----------------  ----
Kernel                     288926              2257    9%
ZFS File Data              570593              4457   18%
Anon                      1397923             10921   45%
Exec and libs                 613                 4    0%
Page cache                 752637              5879   24%
Free (cachelist)            10285                80    0%
Free (freelist)             64446               503    2%
Total                     3085423             24104
Physical                  3071311             23994
making permenant
a.checking memory usage in user wise. out of 128GB , 97 GB is used rest of memory disappear
     Example:
          prstat -s size -–a
          NPROC USERNAME  SWAP   RSS MEMORY      TIME  CPU                          
              32 sybase     96G   96G    75%  42:38:04 0.2%
              72 root      367M  341M   0.3%   9:38:11 0.0%
               6 daemon   7144K 9160K   0.0%   0:01:01 0.0%
               1 smmsp    2048K 6144K   0.0%   0:00:22 0.0
b. to total physical memory:
          prtdiag | grep -i Memory
          Memory size: 131072 Megabytes
3. approx 75% of the physical memory is used under typical load.  Add a few percent for headroom (let’s call it 80).
4. 25% of 128GB is 32GB = 34359738368 bytes
5. Configure ZFS ARC Cache limit in /etc/system
   set zfs:zfs_arc_max=34359738368
6.Reboot system

HOW TO CONFIGURE HALF DUPLEX TO FULL DUPLEX IN SOLARIS 10 (CE) NIC CARDS?

1)check current duplex of NIC card
# dladm show-dev
hme0            link: down      speed: 0     Mbps       duplex: unknown
hme1            link: down      speed: 0     Mbps       duplex: unknown
ce0             link: up        speed: 100   Mbps       duplex: half
ce1             link: up        speed: 100   Mbps       duplex: half
2)chnaging half duplex to full duplex
#ndd -set /dev/ce instance 0
# ndd -set /dev/ce adv_1000fdx_cap 0
# ndd -set /dev/ce adv_1000hdx_cap 0
# ndd -set /dev/ce adv_100fdx_cap 1
# ndd -set /dev/ce adv_100hdx_cap 0
# ndd -set /dev/ce adv_10fdx_cap 0
# dladm show-dev
hme0            link: down      speed: 0     Mbps       duplex: unknown
hme1            link: down      speed: 0     Mbps       duplex: unknown
ce0             link: down      speed: 0     Mbps       duplex: unknown
ce1             link: up        speed: 100   Mbps       duplex: half
# ndd -set /dev/ce adv_10hdx_cap 0
# ndd -set /dev/ce adv_autoneg_cap 0
# dladm show-dev
hme0            link: down      speed: 0     Mbps       duplex: unknown
hme1            link: down      speed: 0     Mbps       duplex: unknown
ce0             link: up        speed: 100   Mbps       duplex: full
ce1             link: up        speed: 100   Mbps       duplex: half
#kstat -m ce

file store information:-
#more /platform/sun4u/kernel/drv/ce.conf
adv_cap_autoneg=1 adv_cap_1000fdx=0 adv_cap_1000hdx=0 adv_cap_100fdx=1
adv_cap_100hdx=0 adv_cap_100T4=0 adv_cap_10fdx=0 adv_cap_10hdx=0;

NOTE:-
for nic card2
#ndd -set /dev/ce instance 1
# ndd -set /dev/ce adv_1000fdx_cap 0
# ndd -set /dev/ce adv_1000hdx_cap 0
# ndd -set /dev/ce adv_100fdx_cap 1
# ndd -set /dev/ce adv_100hdx_cap 0
# ndd -set /dev/ce adv_10fdx_cap 0
# ndd -set /dev/ce adv_10hdx_cap 0
# ndd -set /dev/ce adv_autoneg_cap 0
LOGS:-
Sep 14 02:05:54 TESTSERVER genunix: [ID 408822 kern.info] NOTICE: ce0: no fault external to device; service available
Sep 14 02:05:54 TESTSERVER genunix: [ID 611667 kern.info] NOTICE: ce0: xcvr addr:0x01 - link up 100 Mbps half duplex
Sep 14 02:06:05 TESTSERVER genunix: [ID 408822 kern.info] NOTICE: ce0: no fault external to device; service available
Sep 14 02:06:05 TESTSERVER genunix: [ID 611667 kern.info] NOTICE: ce0: xcvr addr:0x01 - link up 100 Mbps half duplex
Sep 14 02:06:35 TESTSERVER in.mpathd[225]: [ID 594170 daemon.error] NIC failure detected on ce0 of group ipmp0
Sep 14 02:06:35 TESTSERVER in.mpathd[225]: [ID 832587 daemon.error] Successfully failed over from NIC ce0 to NIC ce1
Sep 14 02:07:21 TESTSERVER genunix: [ID 408822 kern.info] NOTICE: ce0: no fault external to device; service available
Sep 14 02:07:21 TESTSERVER genunix: [ID 611667 kern.info] NOTICE: ce0: xcvr addr:0x01 - link up 100 Mbps full duplex
Sep 14 02:07:38 TESTSERVER in.mpathd[225]: [ID 299542 daemon.error] NIC repair detected on ce0 of group ipmp0
Sep 14 02:07:38 TESTSERVER in.mpathd[225]: [ID 620804 daemon.error] Successfully failed back to NIC ce0

=======
3) kstat command to get parameters
# kstat -p|grep ce0
ce:0:ce0:alignment_err  0
ce:0:ce0:brdcstrcv      19331
ce:0:ce0:brdcstxmt      108
ce:0:ce0:cap_1000fdx    1
ce:0:ce0:cap_1000hdx    1
ce:0:ce0:cap_100T4      0
ce:0:ce0:cap_100fdx     1
ce:0:ce0:cap_100hdx     1
ce:0:ce0:cap_10fdx      1
ce:0:ce0:cap_10hdx      1
ce:0:ce0:cap_asmpause   0
ce:0:ce0:cap_autoneg    1
ce:0:ce0:cap_pause      0
ce:0:ce0:class  net
ce:0:ce0:code_violations        0
ce:0:ce0:collisions     0
ce:0:ce0:crc_err        0
ce:0:ce0:crtime 183.2032178
ce:0:ce0:excessive_collisions   0
ce:0:ce0:first_collision        0
ce:0:ce0:ierrors        0
ce:0:ce0:ifspeed        100000000
ce:0:ce0:ipackets       38196
ce:0:ce0:ipackets64     38196
ce:0:ce0:ipackets_cpu00 32832
ce:0:ce0:ipackets_cpu01 4707
ce:0:ce0:ipackets_cpu02 348
ce:0:ce0:ipackets_cpu03 309
ce:0:ce0:late_collisions        0
ce:0:ce0:lb_mode        0
ce:0:ce0:length_err     0
ce:0:ce0:link_T4        0
ce:0:ce0:link_asmpause  0
ce:0:ce0:link_duplex    2
ce:0:ce0:link_pause     0
ce:0:ce0:link_speed     100
ce:0:ce0:link_up        1
ce:0:ce0:lp_cap_1000fdx 0
ce:0:ce0:lp_cap_1000hdx 0
ce:0:ce0:lp_cap_100T4   0
ce:0:ce0:lp_cap_100fdx  0
ce:0:ce0:lp_cap_100hdx  0
ce:0:ce0:lp_cap_10fdx   0
ce:0:ce0:lp_cap_10hdx   0
ce:0:ce0:lp_cap_asmpause        0
ce:0:ce0:lp_cap_autoneg 0
ce:0:ce0:lp_cap_pause   0
ce:0:ce0:multircv       174
ce:0:ce0:multixmt       0
ce:0:ce0:norcvbuf       0
ce:0:ce0:noxmtbuf       0
ce:0:ce0:obytes 2799515
ce:0:ce0:obytes64       2799515
ce:0:ce0:oerrors        0
ce:0:ce0:opackets       25469
ce:0:ce0:opackets64     25469
ce:0:ce0:pci_bad_ack_err        0
ce:0:ce0:pci_dmarz_err  0
ce:0:ce0:pci_dmawz_err  0
ce:0:ce0:pci_drto_err   0
ce:0:ce0:pci_err        0
ce:0:ce0:pci_parity_err 0
ce:0:ce0:pci_rma_err    0
ce:0:ce0:pci_rta_err    0
ce:0:ce0:peak_attempts  0
ce:0:ce0:promisc        off
ce:0:ce0:qos_mode       0
ce:0:ce0:rbytes 2516702
ce:0:ce0:rbytes64       2516702
ce:0:ce0:rev_id 17
ce:0:ce0:rx_allocb_fail 0
ce:0:ce0:rx_hdr_drops   0
ce:0:ce0:rx_hdr_pkts    38056
ce:0:ce0:rx_inits       0
ce:0:ce0:rx_len_mm      0
ce:0:ce0:rx_msgdup_fail 0
ce:0:ce0:rx_mtu_drops   0
ce:0:ce0:rx_mtu_pkts    140
ce:0:ce0:rx_new_hdr_pgs 1189
ce:0:ce0:rx_new_mtu_pgs 35
ce:0:ce0:rx_new_nxt_pgs 0
ce:0:ce0:rx_new_pages   1224
ce:0:ce0:rx_no_buf      0
ce:0:ce0:rx_no_comp_wb  0
ce:0:ce0:rx_nocanput    0
ce:0:ce0:rx_nxt_drops   0
ce:0:ce0:rx_ov_flow     0
ce:0:ce0:rx_pkts_dropped        0
ce:0:ce0:rx_rel_bit     38196
ce:0:ce0:rx_rel_flow    0
ce:0:ce0:rx_split_pkts  0
ce:0:ce0:rx_tag_err     0
ce:0:ce0:rx_taskq_waits 0
ce:0:ce0:snaptime       10593.455837
ce:0:ce0:tx_allocb_fail 0
ce:0:ce0:tx_ddi_pkts    90
ce:0:ce0:tx_dma_bind_fail       0
ce:0:ce0:tx_dma_hdr_bind_fail   0
ce:0:ce0:tx_dma_pld_bind_fail   0
ce:0:ce0:tx_dvma_pkts   7
ce:0:ce0:tx_hdr_pkts    25458
ce:0:ce0:tx_inits       0
ce:0:ce0:tx_max_pend    32
ce:0:ce0:tx_msgdup_fail 0
ce:0:ce0:tx_no_desc     0
ce:0:ce0:tx_nocanput    0
ce:0:ce0:tx_queue0      13186
ce:0:ce0:tx_queue1      670
ce:0:ce0:tx_queue2      2453
ce:0:ce0:tx_queue3      9236
ce:0:ce0:tx_starts      25545
ce:0:ce0:tx_uflo        0
ce:0:ce0:xcvr_addr      1
ce:0:ce0:xcvr_id        2121811
ce:0:ce0:xcvr_inits     1
ce:0:ce0:xcvr_inuse     1
======
# dladm show-dev
hme0            link: down      speed: 0     Mbps       duplex: unknown
hme1            link: down      speed: 0     Mbps       duplex: unknown
ce0             link: up        speed: 100   Mbps       duplex: full
ce1             link: up        speed: 100   Mbps       duplex: full