WPAR (Workload Partition) is a licensed program product
shipped with IBM® AIX® 610. Tthis article teaches WPAR
concepts and configurations. By following the examples
in this article, you will be able to install and
configure DB2® on a system and application WPAR.
Overview
WPAR is an isolated execution environment with its own
init processes inside standard AIX machines. To the end
user, WPAR appears as a standalone AIX machine with its own
set of processes similar to standard AIX machines. This
article concentrates on the following concepts, which are
useful in setting up a DB2 environment inside a WPAR:
- Types of WPARs (system and application WPARs)
- Creating system WPARs
- Installing and configuring DB2 on a WPAR
The instructions and tips provided in this article can
help users of WPARs with installation and configuration of
various products, such as DB2, Oracle, IDS, WebSphere®
Application Server, and SAP.
Types of WPARs
WPARs can be categorized as system and
application WPARs.
How do you create
system WPARs?
There are three ways to create system WPARs based on how
you allocate file systems to system WPARs:
- System WPAR with shared /usr
- System WPAR with private /usr
- System WPAR with remote OR NFS exported file systems
System WPAR
with shared /usr
In this WPAR, /usr and /opt of Global are shared by the
system WPAR. The following command creates the shared system
WPAR:
The following figure shows the file system mapping of
Global and the shared system WPAR.
Figure 1. Shared WPAR in Global
environment
File systems in shared WPARs
# lsfs|grep shared_wpar
/dev/fslv00 -- /wpars/shared_wpar jfs2
/dev/fslv01 -- /wpars/shared_wpar/home jfs2
/opt -- /wpars/shared_wpar/opt namefs
/proc -- /wpars/shared_wpar/proc namefs
/dev/fslv02 -- /wpars/shared_wpar/tmp jfs2
/usr -- /wpars/shared_wpar/usr namefs
/dev/fslv03 -- /wpars/shared_wpar/var jfs2
|
System WPARs
with private /usr
In this WPAR, /usr and /opt are created separately for
the system WPAR. Global gives Logical Volumes required to
create /usr and /opt file systems (see
Figure 2). The
following command creates the private system WPAR:
mkwpar -l -N interface=en0 address="IP" netmask=255.255.255.192
broadcast=9.2.60.255 -n "wpar name having DNS entry"
|
IP and DNS name are needed for system WPARs as DB2 probes
for it while creating the DB2 instance. The following figure
shows file system mapping of Global and the private system
WPAR.
Figure 2. Private WPAR in the Global
environment
File systems in a private WPAR
# lsfs|grep private_wpar
/dev/fslv04 -- /wpars/private_wpar jfs2
/dev/fslv05 -- /wpars/private_wpar/home jfs2
/dev/fslv06 -- /wpars/private_wpar/opt jfs2
/proc -- /wpars/private_wpar/proc namefs
/dev/fslv07 -- /wpars/private_wpar/tmp jfs2
/dev/fslv08 -- /wpars/private_wpar/usr jfs2
/dev/fslv09 -- /wpars/private_wpar/var jfs2
|
System WPAR
with remote OR NFS exported File systems
In this WPAR, all the file systems come from a NFS
server, which exports file systems using the mknfsexp
command. The following figure shows file system mapping of
Global and Remote System WPARs.
Figure 3. Remote WPAR in Global env
ironment
File systems in remote WPAR
# lsfs|grep remote_wpar
/remote_wpar janet01 /wpars/remote_wpar nfs
/remote_wpar/opt janet01 /wpars/remote_wpar/opt nfs
/proc -- /wpars/remote_wpar/proc namefs
/remote_wpar/tmp janet01 /wpars/remote_wpar/tmp nfs
/remote_wpar/usr janet01 /wpars/remote_wpar/usr nfs
/remote_wpar/var janet01 /wpars/remote_wpar/var nfs
|
The following command creates remote WPARs:
/usr/sbin/mkwpar -A -F -s -r -n remote_wpar -f remote_wpar.cf
|
remote_wpar.cf is the specification file used to create remote_wpar
WPAR.
Entries in remote_wpar.cf are:
#cat remote_wpar.cf
network:
interface = en0
netmask = 255.255.255.192
address = 9.2.65.91
general:
privateusr=yes
mount:
dev = /remote_wpar
directory = /
vfs = nfs
host = janet01
mount:
dev = /remote_wpar/usr
directory = /usr
vfs = nfs
host = janet01
mount:
dev = /remote_wpar/opt
directory = /opt
vfs = nfs
host = janet01
mount:
dev = /remote_wpar/var
directory = /var
vfs = nfs
host = janet01
mount:
dev = /remote_wpar/home
directory = /home
vfs = nfs
host = janet01
mount:
dev = /remote_wpar/tmp
directory = /tmp
vfs = nfs
host = janet01
|
Here janet01 is the NFS server holding file systems required for remote
system WPARs.
The following shows how to create and export
/remote_wpar/* file systems on an NFS server:
Creation of file systems
crfs -v jfs2 -g ${VG} -m /remote_wpar -A yes -a size=${SZ}
crfs -v jfs2 -g ${VG} -m /remote_wpar/usr -A yes -a size=${SZ}
crfs -v jfs2 -g ${VG} -m /remote_wpar/opt -A yes -a size=${SZ}
crfs -v jfs2 -g ${VG} -m /remote_wpar/var -A yes -a size=${SZ}
crfs -v jfs2 -g ${VG} -m /remote_wpar/home -A yes -a size=${SZ}
crfs -v jfs2 -g ${VG} -m /remote_wpar/tmp -A yes -a size=${SZ}
|
where VG is Volume Group and SZ is size of file system.
This example shows how to export file systems:
mknfsexp -d /remote_wpar -B -a 0 -v 3 -t rw -r *.ibm.com
mknfsexp -d /remote_wpar/usr -B -a 0 -v 3 -t rw -r *.ibm.com
mknfsexp -d /remote_wpar/opt -B -a 0 -v 3 -t rw -r *.ibm.com
mknfsexp -d /remote_wpar/var -B -a 0 -v 3 -t rw -r *.ibm.com
mknfsexp -d /remote_wpar/home -B -a 0 -v 3 -t rw -r *.ibm.com
mknfsexp -d /remote_wpar/tmp -B -a 0 -v 3 -t rw -r *.ibm.com
|
The previous steps are required to set up various types of system
WPARs. To create a DB2 environment, you can use any of the
three types. Here are the possible configurations:
- To install DB2 in the default directory (/opt is
default directory), you need either a private or remote
system WPAR.
- To install DB2 in a non-default location, you can
use any of the above-mentioned system WPAR types.
DB2 installation
and setup on a system WPAR:
The following shows how to install and configure DB2
inside of a system WPAR:
- Create a system WPAR (private or remote). DB2 needs
a bigger /usr, /opt and /home directories. You might
need to increase them in case of failure.
- Start the system WPAR:
- Log in to remote_wpar using either clogin or telnet.
- Install DB2. This is similar to how you do
installation on normal AIX machines (Global).
- Copy the DB2 images or mount a directory where
DB2 images are available.
mount "ImageServer":/DB2Images /mnt on your System WPAR
|
- Run db2_install (here we need to select the DB2
install path. You can change the path if you want to
go for a non-default location.)
- List all DB2 filesets.
- Create a DB2 instance just to reconfirm the
installation.
mkuser test
mkuser testfc
/DB2 Installation Dir/instance/db2icrt -a SERVER -s ESE -w 64 -u testfc test
|
- DB2 is now ready on system WPAR and can be used to
run DB2 applications.
This section described set up DB2 on a system WPAR. The
following section describes how set up DB2 setup on an
application WPAR.
DB2 installation
and setup on an application WPAR
As stated earlier, application WPARs use all the file
systems from Global only.
- Install DB2 on Global. There is no need to create
DB2 instance at this stage.
- Create the application WPAR using the wparexec
command and pass the createdb2instance script as the
startup script to wparexec command:
wparexec -N interface=en0 address="IP" netmask=255.255.255.192 broadcast=9.2.60.255
-n "App WPAR name having DNS entry" /"absolutePath"/createdb2instance
|
createdb2instance is a script, which creates the DB2 instance. We need
to create the DB2 instance in this manner so that DB2
will take the IP and hostname from the current execution
environment, which is nothing but the application WPAR
environment.
#cat createdb2instance:
mkuser test
mkuser testfc
/"DB2 Installation Dir"//instance/db2icrt -a SERVER -s ese -w 64 -u testfc test
|
- After completing the createdb2instance, we can
infer:
- Application WPAR exits.
- DB2 instance (test in this case) exists on
global file systems.
- DB2 instance (test) internally contains
application WPAR IP and DNS names.
- At this stage we have DB2 on Global and a DB2
instance with application WPAR references.
- Now we can start our application on the application
WPAR and its DB2 instance.
wparexec -N interface=en0 address="IP" netmask=255.255.255.192 broadcast=9.2.60.255
-n "App WPAR having DNS entry" /"absolutePath"/somedb2application
|
Here somedb2application is a DB2 application uses the DB2 instance
created inside the application WPAR.
Conclusion
This article discussed how to create various types of
WPARs and install DB2 inside of a WPAR. The instructions and
tips provided here can help users of WPARs with installation
and configuration of various products, such as DB2, Oracle,
IDS, WebSphere Application Server, and SAP.
Here are the importatnt points to be noted with respect
to WPAR and DB2:
- The WPAR name should have an IP and associated DNS
entry.
- /etc/hosts entry with WPAR IP and DNS name
- Selection of type of system WPAR to be used for DB2
installation
|
No comments:
Post a Comment