Вы находитесь на странице: 1из 8

How to mirror an AIX rootvg

The following steps will guide you trough the mirroring of an AIX rootvg.
This info is valid for AIX 4.3.3, AIX 5.1, AIX 5.2 and AIX 5.3.

• Make sure you have an empty disk, in this example its hdisk1
• Add the disk to the vg via "extendvg rootvg hdisk1
• Mirror the vg via: "mirrorvg rootvg"
• Adapt the bootlist to add the current disk, the system will then fail to hdisk1 is
hdisk0 fails during startup
o do bootlist -o -m normal
o this will list currently 1 disk, in this exmaple hdisk0
o do bootlist -m normal hdisk0 hdisk1
• Run a bosboot on both new disks, this will install all software needed for boot on
the disk
o bosboot -ad hdisk0
o bosboot -ad hdisk1

AIX performance tips and tricks


The following commands can be used in order to debug performance problems on an AIX
machine.
This info is valid for AIX 4.3.3, AIX 5.1, AIX 5.2 and AIX 5.3.

Nmon tools

nmon performance -- free tool to analyze AIX performance


This free tool gives you a huge amount of information all on one screen. Even though
IBM doesn't officially support the tool and you must use it at your own risk, you can get a
wealth of performance statistics. Why use five or six tools when one free tool can give
you everything you need? The tool can be found here.

nmon analyser -- free tool to produce AIX performance reports


This free tool is designed to take files produced by the NMON performance tool and turn
them into spreadsheets containing high quality graphs ready to cut and paste into
performance reports. The tool also produces analyses for ESS and EMC subsystems. It is
available for both Lotus 1-2-3 and Microsoft Excel. The tool can be found here.

Determine your AIX level


oslevel -r
[root@sys /] oslevel -r
5100-07
[root@sys /]
Determine the load of your system
By executing uptime, you get the load on your system. The load indicates the amount of
programs that are being executed @ the same time.
[root@sys /] uptime
04:19PM up 62 days, 1:57, 3 users, load average: 12.26, 11.86,
8.77
[root@sys /]

Determine the cpu usage (user/sys/idle/wait)


Use the command vmstat 10 10.
[root@sys /] vmstat 10 10
kthr memory page faults cpu
----- ----------- ------------------------ ------------ -----------
r b avm fre re pi po fr sr cy in sy cs us sy id wa
4 1 257816 2166 0 0 0 315 287 0 615 10202 1030 9 19 51 22
8 1 257579 2412 0 0 0 147 1407 0 588 32601 1745 17 81 1 1
11 1 259625 171 0 0 0 494 10911 0 647 31634 1440 18 82 0 0
11 1 259720 270 0 0 0 281 2413 0 593 34101 1652 21 79 0 0
11 1 259282 555 0 0 0 246 2619 0 669 33614 1814 16 84 0 0
...
[root@sys /]

Determine the memory/swap usage of an AIX system


Use the commands svmon and lsps.
[root@sys /] lsps -a
Page Space Physical Volume Volume Group Size %Used Active
Auto Type
hd6 hdisk0 rootvg 768MB 47 yes
yes lv
[root@sys /] svmon
size inuse free pin virtual
memory 262128 260139 288 66603 258643
pg space 196608 91566

work pers clnt lpage


pin 66609 0 0 0
in use 228672 7884 23583 0
[root@sys /]

Svmon uses frames, multiply every frame by 1024 to get the size in bytes. Also be sure to
install the packages bos.perf.tools in order to get svmon work.

Determine the IO load on your systems disks


Use the command iostat, do know thet the first entry is the entry since boot.
[root@sys /] lslpp -w /usr/bin/svmon
File Fileset Type
---------------------------------------------------------------------
-------
/usr/bin/svmon bos.perf.tools File
[root@sys /] iostat 5 2
tty: tin tout avg-cpu: % user % sys % idle %
iowait
0.1 4.8 8.7 18.5 51.2
21.6

Disks: % tm_act Kbps tps Kb_read Kb_wrtn


hdisk1 1.6 16.4 3.5 6873724 81062953
hdisk0 1.8 16.9 3.7 10202425 80417825
cd0 0.0 0.0 0.0 0 0

tty: tin tout avg-cpu: % user % sys % idle %


iowait
0.0 135.2 17.4 82.6 0.0
0.0

Disks: % tm_act Kbps tps Kb_read Kb_wrtn


hdisk1 0.0 0.0 0.0 0 0
hdisk0 2.4 15.2 3.4 76 0
cd0 0.0 0.0 0.0 0 0
[root@sys /]
If you get as output:
[root@sys /] iostat

tty: tin tout avg-cpu: % user % sys % idle %


iowait
0.1 4.8 8.7 18.5 51.2
21.6
" Disk history since boot not available. "

[root@sys /]
you have to activate iostat counters by typing the following command:

• /usr/sbin/chdev -l sys0 -a "iostat=true"

AIX temperature sensors

By executing the command /usr/lpp/diagnostics/bin/uesensor, you can, on supported


platform, get the fan speeds and temperature of your system:

[root@sys /] /usr/lpp/diagnostics/bin/uesensor -a
3 0 11 31 P1
9001 0 11 2100 F1
9001 1 11 2760 F2
9001 2 11 1890 F3
9001 3 11 1890 F4
9002 0 11 5129 P1
9002 1 11 3129 P1
9002 2 11 5129 P1
9002 3 11 12077 P1
9004 0 11 3 P3-V1
9004 1 11 3 P3-V2
9004 2 11 3 P3-V3

[root@sys /]
How to clean an AIX wtmp log file
(/var/adm/wtmp)
This document explains how you can reduce the size of wtmp in a GOOD way
This info is valid for AIX 4.3.3, AIX 5.1, AIX 5.2 and AIX 5.3.

Cleaning of wtmp on AIX is not done by "echo >/var/adm/wtmp". There are 2 supported
ways to clean wtmp:

• cp /dev/null /var/adm/wtmp
• format /var/adm/wtmp to ASCII text, clean the 'bogus' entrys and convert it back
to wtmp format, you can do this by using the tool fwtmp:
o be sure /tmp has enough space
o convert the wtmp to ASCII --> /tmp/dummy.file
o /usr/sbin/acct/fwtmp </var/adm/wtmp >/tmp/dummy.file
o edit the file /tmp/dummy.file via "grep -v" or just plain vi
o convert the ASCII output back -->/var/adm/wtmp
o /usr/sbin/acct/fwtmp -ic <dummy.file >/var/adm/wtmp

How to configure AIX syslogd


(/etc/syslog.conf)
The following steps will guide you trough configuring syslog on an AIX system.
This info is valid for AIX 4.3.3, AIX 5.1, AIX 5.2 and AIX 5.3.

By default, an AIX system will not do syslog'ging. For a strange reason, the default
install on an AIX install will not place entry's in /etc/syslog.conf, leaving a totl userless
syslogd.

Even more, comparing the syslogd on AIX to another Unix, (ex: Linux), you will notice
that <facility>.* doesn't work. So make sure that your priority level is never *.

Comming from a Linux world, you most probably want the following config:

mail.debug /var/log/mail
user.debug /var/log/user
kern.debug /var/log/kern
syslog.debug /var/log/syslog
daemon.debug /var/log/daemon
auth.debug /var/log/secure
local2.debug /var/log/sudo

As AIX standard has no logrotate daemon running, you want to adapt syslogd todo the
rotating on his own, an example would be:

mail.debug /var/log/mail rotate size 100k files 4 # 4 files,


100kB each
user.debug /var/log/user rotate files 12 time 1m # 12
files, monthly rotate
kern.debug /var/log/kern rotate files 12 time 1m compress # 12
files, monthly rotate, compress
...

When adaptions are made to /etc/syslog.conf, make sure to restart syslogd.

[root@sys /] refresh -s syslogd


0513-095 The request for subsystem refresh was completed successfully.
[root@sys /]

How to configure AIX to use LDAP


authentication
The doc will guide you trough websites you can use to adapt AIX to use LDAP
authentication.
This info is valid for AIX 4.3.3, AIX 5.1, AIX 5.2 and AIX 5.3.

mksecldap command
LDAP Authentication Load Module

Make sure that if you use AIX systems <5.2, you'll need to setup an AIX schema. This
also means that systems <5.2 cannot auth. against an OpenLDAP server doing auth. for
multiple platforms, you'll need the AIX schema in the OpenLDAP server.
RFC2307 is implemented from AIX5.2 onwards.

How to create an AIX LPP / BFF package


This page will explain you HOWTO create an AIX LPP / BFF package
This info is valid for AIX 4.3.3, AIX 5.1, AIX 5.2 and AIX 5.3.

To start with, you'll need the mklpp package from Bull. You can find the tool here. A
mirror you can find here. Install this package via the smitty interface:

• chmod +x bull.mklpp-1.2.9.0.exe
• ./bull.mklpp-1.2.9.0.exe
• inutoc .
• smitty install_all

Make a lv volume lvlpp and make a filesystems on it. Mount this filesystem under
/lppdir.
Create following directory's under /lppdir: bff, in, lpp, out, and build:

• cd /lppdir
• mkdir bff in lpp out build

Example package build: zlib

First we create the build env:

• mkdir /lppdir/lpp/zlib
• mkdir /lppdir/build/zlib

Download the source of zlib and place it in /lppdir/build/zlib

• cd /lppdir/build/zlib
• wget http://www.zlib.net/zlib-1.2.2.tar.gz (can change)
• gunzip zlib-1.2.2.tar.gz
• tar -xvf zlib-1.2.2.tar
• ln -s zlib-1.2.2 zlib

Be sure to change the umask to 022, so your install directory is ok. (umask 022)
Adapt the path and add /usr/local/bin to it. (export PATH=$PATH:/usr/local/bin)

Run the compille instructions for zlib:

• cd /lppdir/build/zlib/zlib
• ./configure
• make

Install zlib in a changed root env:

• make install prefix=/lppdir/lpp/zlib/usr/local

Make the lpp subdirs for the package

• mkdir /lppdir/lpp/zlib/usr/lpp

Pick a name for your package, take for exmaple: freeware.zlib


Make the lpp subdir for your package:

• mkdir /lppdir/lpp/zlib/usr/lpp/freeware.zlib
Go into the directory /lppdir/lpp/zlib and create the lpp_name file:

4 R I freeware.zlib {
freeware.zlib.rte 1.2.1.1 01 N U en_US Zlib, Data compression library
[
*prereq bos.net.tcp.client v=4 r>1
%
INSTWORK 70 70
%
%
%
%
]
}

You will have to place the version in there(1.2.1.1) the name of the package
(freeware.zlib / freeware.zlib.rte) and an explanation (Zlib, Data compression library). If
needed, you can place prereq's. All other fields will be auto generated.

Make the .info subdir and create the copyright file:

• mkdir /lppdir/lpp/zlib/.info
• touch /lppdir/lpp/zlib/.info/freeware.zlib.rte.copyright (you can add whatever you
want in this file)

Now you can build your package by doing:

• cd /lppdir/lpp/zlib
• mklpp

[root@sys /lppdir/lpp/zlib] mklpp


rm -f .info/freeware.zlib.rte.al
rm -f .info/freeware.zlib.rte.size
rm -f .info/freeware.zlib.rte.inventory
rm -f .info/backup_files
rm -f usr/lpp/freeware.zlib/liblpp.a
rm -f usr/lpp/freeware.zlib/inst_root/liblpp.a
rm -f .info/liblpp.a
rm -f //lppdir/out/zlib-1.2.1.1.bff //lppdir/out/zlib-
1.2.1.1.bff.asc \
//lppdir/zip/zlib-1.2.1.1.exe //lppdir/bff/zlib-
1.2.1.1.bff \
//lppdir/bff/zlib-1.2.1.1.bff.asc
No freeware.zlib.rte.al, applying logic to the problem...
No size file, try this for size...
No inventory file, inventing it...
No cfgfiles script, no pre-configured option, forget it
Making .info/liblpp.a archive
No root part to make
Making list of files to backup
Updating lpp_name
Making installp format distribution on //lppdir/out/zlib-1.2.1.1.bff
Target "all" is up to date.
[root@sys /lppdir/lpp/zlib]

Do note that mklpp automaticly create post and pre scripts for install and de-install in the
.info/. You can add extra commands in these scripts for your own purpose

Вам также может понравиться