Buscador

miércoles, 9 de febrero de 2011

Herramienta SAR


En primer lugar, tenemos una herramienta para poder interpretar todos los resultados. Esta herramienta se llama: ksar.

El nombre sar proviene de las siglas de "system activity report" (informe de la actividad del sistema). En Linux se encuentra normalmente en el paquete sysstat. El paquete sysstat incluye programas y scripts para recopilar y mostrar información sobre el rendimiento del sistema, generando informes detallados. Este conjunto de programas puede resultar de mucha utilidad a la hora de detectar cuellos de botella y para hacernos una idea de cómo se utiliza el sistema a lo largo del día

Recopilar datos sobre el rendimiento

El programa que se ocupa de recopilar la información se llama sadc (system activity data collector o recolector de datos de la actividad del sistema). Obtiene su información, principalmente, del kernel, a través del sistema de archivos virtual en /proc. Después guarda los datos en un fichero (uno por día con nombre /var/log/sa/saDD donde DD es el día del mes.
El paquete incluye dos shell scripts. El primer script, sa1, recopila datos de forma regular, mientras que el script sa2 se utiliza para crear los informes resumidos (uno por día en /var/log/sa/sarDD. Ambos scripts se ejecutan usando cron. En Red Hat Enterprise estos scripts se añaden automáticamente a las tareas de cron de la siguiente forma:
# ejecuta la herramienta de recopilación de datos cada 10 minutos
*/10 * * * * root /usr/lib/sa/sa1 1 1
# genera un informe diario del rendimiento de los procesos a las 23:53
53 23 * * * root /usr/lib/sa/sa2 -A

  • Cubre la mayoría de las áreas del sistema, podemos cargar algún día concreto con la opción –f /var/log/sa/saxx :
    • Uso de la CPU (opción -u, opción por defecto)
[root@xxx~]# sar -u 2 5
Linux 2.6.20.21-default (lvcpd1lx)      02/09/2011

12:29:01 PM       CPU     %user     %nice   %system   %iowait    %steal     %idle
12:29:03 PM       all      0.31      0.00      0.16      0.00      0.00     99.53
12:29:05 PM       all      0.91      0.00      0.37      0.03      0.00     98.69
12:29:07 PM       all      0.81      0.00      0.37      0.00      0.00     98.81

12:29:07 PM       CPU     %user     %nice   %system   %iowait    %steal     %idle
12:29:09 PM       all      0.56      0.00      0.22      0.00      0.00     99.22
12:29:11 PM       all      0.12      0.00      0.09      0.00      0.00     99.78
Average:          all      0.54      0.00      0.24      0.01      0.00     99.21
[root@xxx ~]# sar -u
Linux 2.6.20.21-default (lvcpd1lx)      02/09/2011

12:00:01 AM       CPU     %user     %nice   %system   %iowait    %steal     %idle
12:10:01 AM       all      0.10      0.01      0.07      0.70      0.00     99.12
12:20:01 AM       all      0.07      0.01      0.06      0.00      0.00     99.86
12:30:01 AM       all      0.07      0.01      0.06      0.00      0.00     99.86
12:40:01 AM       all      0.09      0.01      0.06      0.00      0.00     99.84
12:50:01 AM       all      0.07      0.01      0.06      0.00      0.00     99.86
01:00:01 AM       all      0.07      0.01      0.06      0.00      0.00     99.86
01:10:02 AM       all      0.09      0.01      0.06      0.01      0.00     99.83
01:20:01 AM       all      0.07      0.01      0.06      0.00      0.00     99.86
01:30:01 AM       all      0.07      0.01      0.06      0.00      0.00     99.86
01:40:01 AM       all      0.19      0.01      0.13      0.09      0.00     99.59
01:50:01 AM       all      0.07      0.01      0.06      0.00      0.00     99.86
02:00:01 AM       all      0.07      0.01      0.06      0.00      0.00     99.86
02:10:01 AM       all      0.09      0.01      0.06      0.02      0.00     99.82
02:20:01 AM       all      2.90      0.01      0.53      0.58      0.00     95.98
02:30:02 AM       all      6.14      0.01      1.02      1.34      0.00     91.48
02:40:01 AM       all      6.03      0.01      0.72      1.50      0.00     91.74
02:50:01 AM       all      4.48      0.01      0.63      1.03      0.00     93.84
03:00:01 AM       all      0.17      0.01      0.22      0.53      0.00     99.07
03:10:01 AM       all      0.90      0.01      0.29      1.01      0.00     97.79
03:20:01 AM       all      0.08      0.01      0.18      0.05      0.00     99.68
03:30:01 AM       all      0.08      0.01      0.19      0.02      0.00     99.70
03:40:01 AM       all      0.10      0.01      0.18      0.03      0.00     99.68
    • Colas de procesos y carga del sistema (opción -q)
    • Estadísticas por proceso (opción-x [PID | ALL])
    • Uso de memoria y espacio de swap (opción -r)
[oracle@m9 ~]$ sar -r
Linux 2.6.27.25-78.2.56.fc9.x86_64 (m9)         07/06/2010
 
12:00:01 AM kbmemfree kbmemused  %memused kbbuffers  kbcached kbswpfree kbswpused  %swpused  kbswpcad
12:10:01 AM     34860   4029104     99.14     32620   1324864  10026080    215256      2.10     10328
12:20:01 AM     40468   4023496     99.00     34092   1324428  10026460    214876      2.10     10292
12:30:01 AM     53092   4010872     98.69     37300   1301612  10026096    215240      2.10     10520
12:40:01 AM     57340   4006624     98.59     40412   1298040  10026004    215332      2.10     10580
12:50:01 AM     53336   4010628     98.69     42880   1299500  10025988    215348      2.10     10564
01:00:01 AM     84828   3979136     97.91     43588   1263016  10026028    215308      2.10     10224
01:10:01 AM    237544   3826420     94.15     13268   1156804  10017812    223524      2.18     10268

    • Estadísticas de memoria (-R), de paginación (-B) y de swapping (-W)
[oracle@m9 ~]$ sar -B -f /var/log/sa/sa01
Linux 2.6.27.25-78.2.56.fc9.x86_64 (m9)         07/01/2010
 
12:00:01 AM  pgpgin/s pgpgout/s   fault/s  majflt/s  pgfree/s pgscank/s pgscand/s pgsteal/s    %vmeff
12:10:01 AM    282.97   1637.97   2605.06      1.03   1127.19    230.42      2.24    220.26     94.67
12:20:01 AM     85.98   2227.14   2435.13      0.05   1127.23    220.21      1.49    211.45     95.38
12:30:01 AM     43.20   1812.33   2220.57      0.02    986.01    167.66      2.39    155.49     91.44
12:40:01 AM     38.19    174.71   2520.40      0.13    974.44     39.01      0.16     33.15     84.65
12:50:01 AM     33.05    126.10   2526.58      0.00    939.17     19.81      0.26     19.49     97.08
01:00:01 AM      0.94    117.49   2297.94      0.00    842.23      7.13      0.00      6.75     94.68
01:10:01 AM   8517.81   7054.91   2831.65      4.23   5114.19   3894.75     10.41   3802.94     97.38
01:20:01 AM    109.02    129.82   2514.74      0.18    920.41      0.00      0.00      0.00      0.00
01:30:01 AM      3.95    116.88   2320.21      0.02    857.86      0.00      0.00      0.00      0.00
 
 [oracle@m9 ~]$  sar -W -f /var/log/sa/sa01
Linux 2.6.27.25-78.2.56.fc9.x86_64 (m9)         07/01/2010
 
12:00:01 AM  pswpin/s pswpout/s
12:10:01 AM      2.25      0.17
12:20:01 AM      0.11      0.38
12:30:01 AM      0.06      0.95
12:40:01 AM      0.26      0.11
12:50:01 AM      0.01      0.14
01:00:01 AM      0.00      0.07
01:10:01 AM     15.60     33.04
01:20:01 AM      0.72      0.00
01:30:01 AM      0.13      0.00
01:40:01 AM      1.57      0.00
01:50:01 AM      1.22      0.00
02:00:01 AM      1.87      3.22
02:10:01 AM     12.91      0.06
    • Estadísticas de interrupciones (-I)
    • Estadísticas de red (-n)
 

Ver informacion hardware: MEMORIA, CPU's...

[root@ ~]# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) MP CPU 2.70GHz
stepping        : 6
cpu MHz         : 2694.881
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips        : 5392.09
clflush size    : 64

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) MP CPU 2.70GHz
stepping        : 6
cpu MHz         : 2694.881
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips        : 5388.68
clflush size    : 64

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) MP CPU 2.70GHz
stepping        : 6
cpu MHz         : 2694.881
cache size      : 2048 KB
physical id     : 1
siblings        : 2
core id         : 0
cpu cores       : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips        : 5388.80
clflush size    : 64

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) MP CPU 2.70GHz
stepping        : 6
cpu MHz         : 2694.881
cache size      : 2048 KB
physical id     : 1
siblings        : 2
core id         : 0
cpu cores       : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips        : 5388.79
clflush size    : 64

processor       : 4
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) MP CPU 2.70GHz
stepping        : 6
cpu MHz         : 2694.881
cache size      : 2048 KB
physical id     : 2
siblings        : 2
core id         : 0
cpu cores       : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips        : 5388.87
clflush size    : 64

processor       : 5
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) MP CPU 2.70GHz
stepping        : 6
cpu MHz         : 2694.881
cache size      : 2048 KB
physical id     : 2
siblings        : 2
core id         : 0
cpu cores       : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips        : 5388.83
clflush size    : 64

processor       : 6
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) MP CPU 2.70GHz
stepping        : 6
cpu MHz         : 2694.881
cache size      : 2048 KB
physical id     : 3
siblings        : 2
core id         : 0
cpu cores       : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips        : 5388.81
clflush size    : 64

processor       : 7
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) MP CPU 2.70GHz
stepping        : 6
cpu MHz         : 2694.881
cache size      : 2048 KB
physical id     : 3
siblings        : 2
core id         : 0
cpu cores       : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips        : 5388.82
clflush size    : 64

[root@ ~]# cat /proc/meminfo | grep MemTotal
MemTotal:      3115832 kB
[root@ ~]# dmidecode -t 16
# dmidecode 2.7
SMBIOS 2.3 present.

Handle 0x1000, DMI type 16, 15 bytes.
Physical Memory Array
        Location: Proprietary Add-on Card
        Use: System Memory
        Error Correction Type: Single-bit ECC
        Maximum Capacity: 16 GB
        Error Information Handle: Not Provided
        Number Of Devices: 8

Handle 0x1001, DMI type 16, 15 bytes.
Physical Memory Array
        Location: Proprietary Add-on Card
        Use: System Memory
        Error Correction Type: Single-bit ECC
        Maximum Capacity: 16 GB
        Error Information Handle: Not Provided
        Number Of Devices: 8

[root@ ~]# dmidecode -t 17 |grep Size
        Size: 512 MB
        Size: 512 MB
        Size: 512 MB
        Size: 512 MB
        Size: 256 MB
        Size: 256 MB
        Size: 256 MB
        Size: 256 MB
        Size: No Module Installed
        Size: No Module Installed
        Size: No Module Installed
        Size: No Module Installed
        Size: No Module Installed
        Size: No Module Installed
        Size: No Module Installed
        Size: No Module Installed

Reducir un fs con lvm


1° Desmontar el filesystem:
# umount /home
2° Reduciendo el filesystem:
Si es Ext2/Ext3:
# resize2fs /dev/vg1/lvhome XX (XX es el nuevo tamaño)
Si es Reiserfs:
# resize_reiserfs -s-XXG /dev/vg/datalv (XX es el tamaño a restarle en este caso)
Para Xfs y Jfs no es posible reducir éstos filesystems.
3° Reduciendo el LV:
# lvreduce -L-1G /dev/vg1/lvhome
4° Volvemos a montar el filesystem:
# mount /home

Balanceo Servidores TSM o Recuperacion BBDD


TSM en cluster

Cambios para GestionTsm –> GestionTsm-backup:

  1. Paramos el servidor en el GestionTsm:

/etc/init.d/tsmserv stop

  1. Cambio de IP’s:

Sobre el GestionTsm:

ifconfig eth0 23.23.23.x netmask 255.255.255.0 up
ifconfig bond1 10.228.140.x netmask 255.255.255.224 up
 
Sobre el GestionTsm-backup:

ifconfig eth0 10.228.140.x netmask 255.255.255.224 up
ifconfig eth1 23.23.23.x netmask 255.255.255.0 up
 
3.      Montaje de fs:
 
Sobre el GestionTsm:
 
umount /vtape31
umount /vtape32
umount /vtape33
umount /vtape34
umount /vtape35
umount /vtape36
umount /vtape37
umount /vtape38
umount /vtape39
umount /vtape40
umount /vtape41
umount /vtape42
umount /tsmmirrorlog
umount /tsmlog
umount /tsmdb
umount /tsmmirrordb
 
Sobre el GestionTsm-backup:
 
lvchange -ay /dev/bdlogvg2/loglv2
lvchange -ay /dev/vtape5vg/vt40lv
lvchange -ay /dev/bdlogmirrorvg2/bdmlv2
lvchange -ay /dev/bdlogmirrorvg2/logmlv2
lvchange -ay /dev/bdlogvg2/bdlv2
lvchange -ay /dev/vtape4vg/vt31lv
lvchange -ay /dev/vtape4vg/vt32lv
lvchange -ay /dev/vtape4vg/vt33lv
lvchange -ay /dev/vtape4vg/vt34lv
lvchange -ay /dev/vtape4vg/vt35lv
lvchange -ay /dev/vtape4vg/vt36lv
lvchange -ay /dev/vtape4vg/vt37lv
lvchange -ay /dev/vtape4vg/vt38lv
lvchange -ay /dev/vtape4vg/vt39lv
lvchange -ay /dev/vtape5vg/vt41lv
lvchange -ay /dev/vtape5vg/vt42lv
 
 
 
 
mount –t ext3 /dev/vtape4vg/vt31lv /vtape31
mount –t ext3 /dev/vtape4vg/vt32lv /vtape32
mount –t ext3 /dev/vtape4vg/vt33lv /vtape33
mount –t ext3 /dev/vtape4vg/vt34lv /vtape34
mount –t ext3 /dev/vtape4vg/vt35lv /vtape35
mount –t ext3 /dev/vtape4vg/vt36lv /vtape36
mount –t ext3 /dev/vtape4vg/vt37lv /vtape37
mount –t ext3 /dev/vtape4vg/vt38lv /vtape38
mount –t ext3 /dev/vtape4vg/vt39lv /vtape39
mount -t ext3 /dev/vtape5vg/vt40lv /vtape40
mount -t ext3 /dev/vtape5vg/vt41lv /vtape41
mount -t ext3 /dev/vtape5vg/vt42lv /vtape42
mount -t ext3 /dev/bdlogmirrorvg2/bdmlv2 /tsmmirrordb
mount -t ext3 /dev/bdlogmirrorvg2/logmlv2 /tsmmirrorlog
mount -t ext3 /dev/bdlogvg2/bdlv2 /tsmdb
mount -t ext3 /dev/bdlogvg2/loglv2 /tsmlog
 
4.      Ejecutamos autoconf sobre el GestionTsm-backup:
 
/opt/tivoli/tsm/devices/bin/autoconf
 
5.      Finalmente, copiamos los archivos de configuración en el GestionTsm-backup:
 
Desde GestionTsm:
 
scp /opt/tivoli/tsm/server/bin/dsmserv.dsk 10.228.140.x:/opt/tivoli/tsm/server/bin/dsmserv.dsk
 
scp /opt/tivoli/tsm/server/bin/dsmserv.opt 10.228.140.x:/opt/tivoli/tsm/server/bin/dsmserv.opt
 
 
Desde GestionTsm-backup
 
cp /vtape32/volhist_5 /opt/tivoli/tsm/server/bin/volhist
 
 
cp /vtape32/devconfig_5 /opt/tivoli/tsm/server/bin/devconfig
 
 
6.      Arrancamos el tsm en el servidor GestionTsm-backup:
 
/etc/init.d/tsmserv start
 
7.      Desactivamos los fs en el GestionTsm:
 
lvchange -an /dev/vtape4vg/vt31lv
lvchange -an /dev/vtape4vg/vt32lv
lvchange -an /dev/vtape4vg/vt33lv
lvchange -an /dev/vtape4vg/vt34lv
lvchange -an /dev/vtape4vg/vt35lv
lvchange -an /dev/vtape4vg/vt36lv
lvchange -an /dev/vtape4vg/vt37lv
lvchange -an /dev/vtape4vg/vt38lv
lvchange -an /dev/vtape4vg/vt39lv
lvchange -an /dev/vtape5vg/vt40lv
 
Cambios para GestionTsm-backup –> GestionTsm:

  1. Paramos el servidor en el GestionTsm-backup:

/etc/init.d/tsmserv stop

  1. Cambio de IP’s:

Sobre el GestionTsm-backup:

ifconfig eth0 23.23.23.x netmask 255.255.255.0 up
ifconfig bond1 10.228.140.x netmask 255.255.255.224 up
 
Sobre el GestionTsm:

ifconfig eth0 10.228.140.x netmask 255.255.255.224 up
ifconfig eth1 23.23.23.x netmask 255.255.255.0 up
 
3.      Montaje de fs:
 
Sobre el GestionTsm-backup:
 
umount /vtape31
umount /vtape32
umount /vtape33
umount /vtape34
umount /vtape35
umount /vtape36
umount /vtape37
umount /vtape38
umount /vtape39
umount /vtape40
umount /vtape41
umount /vtape42
umount /tsmmirrorlog
umount /tsmlog
umount /tsmdb
umount /tsmmirrordb
 
Sobre el GestionTsm:
 
lvchange -ay /dev/vtape4vg/vt31lv
lvchange -ay /dev/vtape4vg/vt32lv
lvchange -ay /dev/vtape4vg/vt33lv
lvchange -ay /dev/vtape4vg/vt34lv
lvchange -ay /dev/vtape4vg/vt35lv
lvchange -ay /dev/vtape4vg/vt36lv
lvchange -ay /dev/vtape4vg/vt37lv
lvchange -ay /dev/vtape4vg/vt38lv
lvchange -ay /dev/vtape4vg/vt39lv
lvchange -ay /dev/vtape5vg/vt40lv
lvchange -ay /dev/vtape5vg/vt41lv
lvchange -ay /dev/vtape5vg/vt42lv
 
 
 
 
mount –t ext3 /dev/vtape4vg/vt31lv /vtape31
mount –t ext3 /dev/vtape4vg/vt32lv /vtape32
mount –t ext3 /dev/vtape4vg/vt33lv /vtape33
mount –t ext3 /dev/vtape4vg/vt34lv /vtape34
mount –t ext3 /dev/vtape4vg/vt35lv /vtape35
mount –t ext3 /dev/vtape4vg/vt36lv /vtape36
mount –t ext3 /dev/vtape4vg/vt37lv /vtape37
mount –t ext3 /dev/vtape4vg/vt38lv /vtape38
mount –t ext3 /dev/vtape4vg/vt39lv /vtape39
mount -t ext3 /dev/vtape5vg/vt40lv /vtape40
mount -t ext3 /dev/vtape5vg/vt41lv /vtape41
mount -t ext3 /dev/vtape5vg/vt42lv /vtape42
mount -t ext3 /dev/bdlogmirrorvg2/bdmlv2 /tsmmirrordb
mount -t ext3 /dev/bdlogmirrorvg2/logmlv2 /tsmmirrorlog
mount -t ext3 /dev/bdlogvg2/bdlv2 /tsmdb
mount -t ext3 /dev/bdlogvg2/loglv2 /tsmlog
 
4.      Ejecutamos autoconf sobre el GestionTsm:
 
/opt/tivoli/tsm/devices/bin/autoconf
 
5.      Finalmente, copiamos los archivos de configuración en el GestionTsm:
 
Desde GestionTsm-backup:
 
scp /opt/tivoli/tsm/server/bin/dsmserv.dsk 10.228.140.5:/opt/tivoli/tsm/server/bin/dsmserv.dsk
 
scp /opt/tivoli/tsm/server/bin/dsmserv.opt 10.228.140.5:/opt/tivoli/tsm/server/bin/dsmserv.opt
 
 
Desde GestionTsm:
 
cp /vtape32/volhist_5 /opt/tivoli/tsm/server/bin/volhist
 
 
cp /vtape32/devconfig_5 /opt/tivoli/tsm/server/bin/devconfig
 
 
6.      Arrancamos el tsm en el servidor GestionTsm:
 
/etc/init.d/tsmserv start

8.      Desactivamos los fs en el GestionTsm-backup:
 
lvchange -an /dev/vtape4vg/vt31lv
lvchange -an /dev/vtape4vg/vt32lv
lvchange -an /dev/vtape4vg/vt33lv
lvchange -an /dev/vtape4vg/vt34lv
lvchange -an /dev/vtape4vg/vt35lv
lvchange -an /dev/vtape4vg/vt36lv
lvchange -an /dev/vtape4vg/vt37lv
lvchange -an /dev/vtape4vg/vt38lv
lvchange -an /dev/vtape4vg/vt39lv
lvchange -an /dev/vtape5vg/vt40lv
lvchange -an /dev/vtape5vg/vt41lv
lvchange -an /dev/vtape5vg/vt42lv



Restaurar una DDBB de TSM
 
Si al levantar el tsm falla:
 
/etc/init.d/tsmserv start
 
La forma de levantarlo para ver los log de error es
 
 
/opt/tivoli/tsm/server/bin/dsmserv
 
 
Después de ver los log si hay que restaurar la BBDD primero busco que cinta es donde esta la BBDD:
 
/opt/tivoli/tsm/server/bin/dsmserv restore db todate=TODAY preview=yes
 
Pedimos la cinta a operación y modificamos el archivo 
 
/opt/tivoli/tsm/server/bin/devconfig
 
 
En windows es devconfig.out
 
Poniendo una entrada 
 
/* LIBRARYINVENTORY SCSI SL500 A00004 1005 101*/
 
 
Donde este la cinta del backup modificando la cinta y el 1005
 
Y ahora restauramos la BBDD
 
/opt/tivoli/tsm/server/bin/dsmserv restore db todate=TODAY preview=no
 
Y levantamos
 
/etc/init.d/tsmserv start

CONFIGURACION DE ORACLE RAC SISTEMA OPERATIVO


Tenemos dos RAC instalados, el procedimiento para su instalación varia según el tipo de instalación de RAC realice ORACLE.

1.      -RAC Gas: Discos ocr dados de tipo ocfs2 compartidos entre las dos maquinas. Estos discos shared son dados por una cabina NETAPP. Estos discos son utilizados para la comunicación por ORACLE. Para los datos, tenemos 14 discos dados en modo RAW.

CREACIÓN DE LOS ocfs2:

-Paquetes necesarios:

oracleasm-2.6.18-164.0.0.0.1.el5xen-2.0.5-1.el5
oracleasm-support-2.1.3-1.el5
oracleasm-2.6.18-164.el5-debuginfo-2.0.5-1.el5
oracle-logos-4.9.17-6
oracleasm-2.6.18-164.0.0.0.1.el5-2.0.5-1.el5
oracleasmlib-2.0.4-1.el5
oracleasm-2.6.18-164.0.0.0.1.el5debug-2.0.5-1.el5
 
-Realizamos la configuración:
 
[root@xxx ~]# cat /etc/ocfs2/cluster.conf
cluster:
        node_count = 2
        name = ocfs2
node:
        ip_port = 7777
        ip_address = 10.228.14x.9x
        number = 0
        name = xxx
        cluster = ocfs2
 
node:
        ip_port = 7777
        ip_address = 10.228.14x.9x
        number = 1
        name = xxxx
        cluster = ocfs2
 
-Formateamos los dispositivos:
 
mkfs.ocfs2 -b 4K -C 32K -N 4 /dev/mapper/mpath10
mkfs.ocfs2 -b 4K -C 32K -N 4 /dev/mapper/mpath9
mkfs.ocfs2 -b 4K -C 32K -N 4 /dev/mapper/mpath8
mkfs.ocfs2 -b 4K -C 32K -N 4 /dev/mapper/mpath7
mkfs.ocfs2 -b 4K -C 32K -N 4 /dev/mapper/mpath6
mkfs.ocfs2 -b 4K -C 32K -N 4 /dev/mapper/mpath5
 
-Arrancamos los demonios:
 
    * /etc/init.d/o2cb status
 
      Module "configfs": Not loaded
      Filesystem "configfs": Not mounted
      Module "ocfs2_nodemanager": Not loaded
      Module "ocfs2_dlm": Not loaded
      Module "ocfs2_dlmfs": Not loaded
      Filesystem "ocfs2_dlmfs": Not mounted
 
    * /etc/init.d/o2cb load
 
      Loading module "configfs": OK
      Mounting configfs filesystem at /config: OK
      Loading module "ocfs2_nodemanager": OK
      Loading module "ocfs2_dlm": OK
      Loading module "ocfs2_dlmfs": OK
      Mounting ocfs2_dlmfs filesystem at /dlm: OK
 
      Loads all OCFS modules.
 
    * /etc/init.d/o2cb online ocfs2
 
      Starting cluster ocfs2: OK
 
      The above command will online the cluster we created, ocfs2.
 
    * /etc/init.d/ocfs2 start
 
-Comprobamos:    
    * /etc/init.d/o2cb status
 
      Module "configfs": loaded
      Filesystem "configfs": mounted
      Module "ocfs2_nodemanager": loaded
      Module "ocfs2_dlm": loaded
      Module "ocfs2_dlmfs": loaded
      Filesystem "ocfs2_dlmfs": Not mounted -> tenemos que montar fs para que se active

          
        
-Ponemos los demonios en el arranque:
 
[root@xxx ~]# chkconfig --list ocfs2
ocfs2           0:desactivado   1:desactivado   2:activo        3:activo        4:activo        5:activo        6:desactivado
[root@xxx ~]# chkconfig --list o2cb
o2cb            0:desactivado   1:desactivado   2:activo        3:activo        4:activo        5:activo        6:desactivado
 
 
-Ahora ponemos los fs en el arranque y los montamos en ambas maquinas (todo esto se hace en ambas maquinas)
 
Creamos los puntos de montaje:
 
drwxr-xr-x   3 oracle oinstall  3896 sep 15 11:42 ocr1
drwxr-xr-x   3 oracle oinstall  3896 sep 15 11:42 ocr2
drwxr-xr-x   3 oracle oinstall  3896 sep 15 11:43 ocr3
drwxr-xr-x   3 oracle oinstall  3896 sep 15 11:43 ocr4
drwxr-xr-x   3 oracle oinstall  3896 sep 15 11:43 ocr5
drwxr-xr-x   3 oracle oinstall  3896 sep 14 16:13 ocr6
 
[root@xxx ~]# cat /etc/fstab
/dev/mapper/mpath5      /ocr1                   ocfs2   _netdev,datavolume 1 0
/dev/mapper/mpath6      /ocr2                   ocfs2   _netdev,datavolume 1 0
/dev/mapper/mpath7      /ocr3                   ocfs2   _netdev,datavolume 1 0
/dev/mapper/mpath8      /ocr4                   ocfs2   _netdev,datavolume 1 0
/dev/mapper/mpath9      /ocr5                   ocfs2   _netdev,datavolume 1 0
/dev/mapper/mpath10     /ocr6                   ocfs2   _netdev,datavolume 1 0
 
-montamos todo:
mount -a
 
-Para poder ver que esta todo ok, miramos en modo consola: ocfs2console
 

CREACION DE LOS RAWS:
 
[root@xxx ~]# fdisk /dev/mapper/mpath1
 
El número de cilindros para este disco está establecido en 15666.
No hay nada malo en ello, pero es mayor que 1024, y en algunos casos
podría causar problemas con:
1) software que funciona en el inicio (p.ej

versiones antiguas de LILO)
2) software de arranque o particionamiento de otros sistemas operativos
   (p.ej

FDISK de DOS, FDISK de OS/2)
 
Orden (m para obtener ayuda): p
 
Disco /dev/mapper/mpath1: 128.8 GB, 128861601792 bytes
255 heads, 63 sectors/track, 15666 cylinders
Unidades = cilindros de 16065 * 512 = 8225280 bytes
 
           Disposit

Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/mapper/mpath1p1               1       15666   125837113+  83  Linux
 
 
[root@xxx ~]# fdisk /dev/mapper/mpath2
 
El número de cilindros para este disco está establecido en 2610.
No hay nada malo en ello, pero es mayor que 1024, y en algunos casos
podría causar problemas con:
1) software que funciona en el inicio (p.ej

versiones antiguas de LILO)
2) software de arranque o particionamiento de otros sistemas operativos
   (p.ej

FDISK de DOS, FDISK de OS/2)
 
Orden (m para obtener ayuda): p
 
Disco /dev/mapper/mpath2: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Unidades = cilindros de 16065 * 512 = 8225280 bytes
 
           Disposit

Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/mapper/mpath2p1               1        2610    20964793+  83  Linux
 
-Creamos los los pvs:
 
pvcreate /dev/mapper/mpath1p1 
pvcreate /dev/mapper/mpath2p1
 
-Configuramos:
[root@xxx ~]# cat /etc/sysconfig/rawdevices
# raw device bindings
# format:    
#           
# example: /dev/raw/raw1 /dev/sda1
#          /dev/raw/raw2 8 5
#/dev/raw/raw12 /dev/sdm1
#ASM arch y ASM data
/dev/raw/raw1   /dev/mapper/mpath1p1
/dev/raw/raw2   /dev/mapper/mpath2p1
 
Arrancamos el /etc/init.d/rawdevices restart
Y comprobamos con el raw -qa
Y lo ponemos en el arranque: chkconfig rawdevices on


IDENTIFICACIÓN DE LOS DISCOS:

Para ello utilizamos el software de NETAPP, netapp_linux_host_utilities_5_2.tar.gz
 
Instalar y luego modificar el multipath.conf con las siguientes líneas (y solo estas)
 
 
 
defaults {
                user_friendly_names yes
                rr_min_io 128
                max_fds max
}
 
devnode_blacklist {
                   devnode "sd[a]$"
                   devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
                   devnode "^hd[a-z]"
                   devnode "^cciss!c[0-9]d[0-9]*"
}
 
devices {
        device {
                   vendor "NETAPP"
                   product "LUN"
                   flush_on_last_del yes
                   getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
                   prio_callout "/sbin/mpath_prio_netapp /dev/%n"
                   features "1 queue_if_no_path"
                   hardware_handler "0"
                   path_grouping_policy group_by_prio
                   failback immediate
                   path_checker directio
                }
}
 
Reiniciamos el /etc/init.d/multipath restart
 
Reconocemos los discos
 
 
[root@xxx ~]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@xxx ~]# echo "- - -" > /sys/class/scsi_host/host1/scan
[root@xxx ~]# echo "- - -" > /sys/class/scsi_host/host2/scan
[root@xxx ~]#  echo "- - -" > /sys/class/scsi_host/host3/scan
[root@xxx ~]# echo "- - -" > /sys/class/scsi_host/host4/scan
 
 
echo "scsi-qlascan" > /proc/scsi/qla2xxx/1
echo "scsi-qlascan" > /proc/scsi/qla2xxx/0
echo "scsi add-single-device controller 0 0 1 ">/proc/scsi/scsi
echo "scsi add-single-device controller 0 0 1 ">/proc/scsi/scsi
 
 
 
Luego 
 
[root@xxx ~]# multipath -ll
mpath2 (360a98000572d504e4434594d53424653) dm-12 NETAPP,LUN
[size=20G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=4][enabled]
\_ 3:0:1:1 sdc 8:32  [active][ready]
\_ round-robin 0 [prio=1][enabled]
\_ 3:0:2:1 sdg 8:96  [active][ready]
\_ 3:0:2:2 sdh 8:112 [active][ready]
 
 
 
 
[root@xxx ~]# sanlun lun show all
 
NetApp-Mir-CtrlA:/vol/ORA_RAC_IECI/ORA_RAC_IECI_ASURIECI_Archivado (LUN 1)              Lun state: GOOD
Lun Size:     20g (21474836480)  Controller_CF_State: Cluster Enabled
Protocol: FCP           Controller Partner: NetApp-Mir-CtrlB
DM-MP DevName: mpath2   (360a98000572d504e4434594d53424653)     dm-39
Multipath-provider: NATIVE
--------- ---------- ------- ------------ --------------------------------------------- ---------------
   sanlun Controller                                                            Primary         Partner
     path       Path   /dev/         Host                                    Controller      Controller
    state       type    node          HBA                                          port            port
--------- ---------- ------- ------------ --------------------------------------------- ---------------
     GOOD  primary       sdc        host3                                            0a              --
     GOOD  secondary     sdx        host3                                            --              0a


2.      -RAC CLIENTES: Los discos shared son dados directamente al ORACLE, y es el libasm, el encargado de gestionarlos etiquetándolos. Por lo tanto, solo tendríamos que ver los discos y dárselo directamente.

Configuraciones estándares:

- Comunicación entre las maquinas sin password.
- Bonding entre las tarjetas de heartbeat.

[root@Ixxx ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
IPADDR=10.0.0.3
NETMASK=255.255.255.0
NETWORK=10.0.0.0
ONBOOT=yes
TYPE=BOND

[root@xxx ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Intel Corporation 82546EB Gigabit Ethernet Controller (Copper)
DEVICE=eth0
ONBOOT=yes
HWADDR=00:19:99:14:c7:96
TYPE=Ethernet
MASTER=bond0
SLAVE=yes
BOOTPROTO=dhcp

[root@xxx ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth3
# Intel Corporation 82546EB Gigabit Ethernet Controller (Copper)
DEVICE=eth3
ONBOOT=yes
HWADDR=00:11:0a:63:b0:99
TYPE=Ethernet
SLAVE=yes
MASTER=bond0
BOOTPROTO=dhcp

-Al tener un cisco por encima tenemos que poner port channel y esta opción para el bonding es:

[root@xxx ~]# cat /etc/modprobe.conf
#alias eth1 tg3
#alias eth0 tg3
alias scsi_hostadapter megaraid_sas
alias scsi_hostadapter1 ata_piix
alias scsi_hostadapter2 qla2xxx
alias bond0 bonding
options bond0 mode=4 miimon=100
### BEGIN MPP Driver Comments ###
remove mppUpper if [ `ls -a /proc/mpp | wc -l` -gt 2 ]; then echo -e "Please Unload Physical HBA Driver prior to unloading mppUpper."; else /sbin/modprobe -r --ignore-remove mppUpper; fi
# Additional config info can be found in /opt/mpp/modprobe.conf.mppappend.
# The Above config info is needed if you want to make mkinitrd manually.
# Please read the Readme file that came with MPP driver for building RamDisk manually.
# Edit the '/etc/modprobe.conf' file and run 'mppUpdate' to create Ramdisk dynamically.
### END MPP Driver Comments ###
#alias eth e1000
#alias eth2 e1000
#alias eth3 e1000
#alias dev16113 tg3

[root@xxx ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

802.3ad info
LACP rate: slow
Active Aggregator Info:
        Aggregator ID: 2
        Number of ports: 1
        Actor Key: 17
        Partner Key: 2
        Partner Mac Address: 00:25:84:dd:f0:c0

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:19:99:14:c7:96
Aggregator ID: 1

Slave Interface: eth3
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:11:0a:63:b0:99
Aggregator ID: 2


-Modificamos el /etc/hosts.