Tuesday, June 24, 2008

LAB 1: Install OS Zone & DB2

1.LAB 1: Install OS Zone & DB2

1.1.Prerequisites / Hardware Requirement

  1. Solaris OS needs 4 GB disk space and 400MB RAM

  2. Each additional zone needs 70MB hard disk

  3. Swap space

    1. Normally same as the VM physical RAM

    2. Disk space for tmp folder

    3. Check how many swap space for each application servers and sum up (may check from info center)

      • WAS & WPS 6.0, tmp folder needs minimum 1.5GB

      • DB2 512MB RAM

      • IBM HTTP Server 0.5GB RAM, 1GB disk space

      • LDAP

      • Network Deployment

  4. VM Hard disk space = Solaris OS disk space + Swap space

  5. How many zones required? Depending on the infrastructure designs.

Define Zone

Memory

Hard disk (GB)

Zone 1: DB2

0.5 GB

0.2

Zone 2: Network Deployment

0.5 GB (512MB)

0.3

Zone 3: WAS/WPS Cluster 1


(1.7x2)+(1.5x2) = 6.4

Zone 4: WAS/WPS Cluster 2


(1.7x2)+(1.5x2) = 6.4

Zone 5: Web Server

0.5 GB

1

Zone 6: LDAP


0.2

Zone 7: Solaris 10

0.4 GB

4

Swap Space

Equal to physical memory

1.5

TOTAL:

4 GB

20 GB

1.2.Create Virtual Machine

  1. Name and Location

  1. Guest Operating System – Solaris Operating System (64-Bit)

  1. Memory and Processor - 4GB and 2 processors

  1. Hard Disk – 20GB

  1. Network Adapter – Bridged

Notes:

  • Bridged – network created is visible inside and outside.

  • Host Only – invisible from inside and outside.

  • NAT – invisible inside, but can go out.

  1. CD / DVD Drive – Use an ISO image (sol-10-u4-ga-x86-dvd.iso)

  1. Floppy Drive – Don’t add a floppy drive.

  1. USB Controller – either one will do.

  2. Ready to complete – verify summary and click finish.

1.3.Install Solaris 10

  1. Installation Summary

Network: Yes

DHCP: No

Hostname: [Juice/Kfc/Arsenal]

IP: [192.168.16.1 / 192.168.17.1 / 192.168.18.1]

Subnet mask: 255.255.0.0

Enable IPv6: No

  1. Steps for installing

Check Route Table

$ netstat -rn

Shut down Solaris

$ shutdown –g0 –i5 –y OR $ init 5

Reboot Solaris

$ shutdown –g0 –i6 –y OR init 6 OR reboot

  1. DHCP is dynamically assigned IP. If yes, the server is dependant on DHCP (not HA), means if DHCP server down, this will affect our own server.

  2. To know which network it routes to, netmask (BINARY) AND destination IP.

  3. After installation, at VMWare console, click “Add VMWare Plugin” to install plugin to Guest. Select 800x600 resolution.

1.4.Configure SSH

  1. To allow root login remotely

    1. $ cd /etc/ssh

    2. $ vi sshd_config (server config)

  1. edit PermitRootLogin from no to yes

    1. $ svcadm restart ssh

    2. Verify: ssh from another machine

  1. Generate trust key (Every time root remotely login, no need to key in password)

  1. Navigate to root’s home directory

  2. $ ls –a

  3. $cd .ssh

  4. Check if there is id_rsa.pub inside. If no, generate the public and private key:

    1. $ ssh-keygen –t rsa [-f keyname]

  5. If no directory .ssh, generate using command:

    1. $ ssh localhost date (generate .ssh directory in home directory)

  6. $scp id-rsa.pub_root@coffee:/tmp

  7. in coffee server, mv /tmp/id_rsa.pub /root/.ssh/authorized_keys2

  1. Disable send mail

$ svcadm disable sendmail

1.5.Create Virtual Hard Disk

  1. At the VMWare Host,

    1. $ vmware-vdiskmanager –c –s 4GB 0a lsilogic –t 0 disk1.vmdk

  2. At the VMWare Guest GUI, Add Hardware > Add Hard disk

  1. At the VMWare Guest

    1. $ touch/reconfigure (Issue scan OS hardware)

    2. $ init 6

1.6.Create Storage Pool and Zone

Check available disk

$ format

c1t0d0

c1t1d0 (new virtual disk)

Check file system usage

$ df –h

Create storage pool

- zpool create <pool> <virtual device>

$ zpool create tank c1t1d0

Check storage pool status

$ zpool status

Create new ZFS file system

$ zfs create tank/zones

Set mount point to global zone

$ zfs set mountpoint=/zones tank/zones

List all ZFS

$ zfs list

Create a new zone

- zfs create <zone path/zone name>

$ zfs create tank/zones/db

Create zone conf file to install the zone

$ vi /zones/db/db.cfg

Create

set zonepath=/zones/db

set autoboot=false

add net

set physical=e1000g0

set address=192.168.16.2

end

add fs

set type=lofs

set special=/software

set dir=/sw

end

verify

commit

Configure zone

$ zonecfg –z db –f db.cfg

List zones with status

Status: CONFIGURED, INSTALLED, RUNNING

$ zoneadm –z list –cv (zone now is configured)

$ zonecfg –z db info

Change zone mod

Change the file permission for zone root before install

$ chmod 700 db

Install package to zone

(It takes some time to install)

$ zoneadm –z db install

Boot/Start the zone

(Boot the zone since set the autoboot to false)

$ zoneadm –z boot

Login to zone’s system console

$ zlogin –C db

Choose DECVT100 Terminal

Logout zone

$ exit

Login: ~.

Password: ~.

Check zone status continually

$ while true; do zoneadm list –cv; sleep 3; done

1.7.Add Domain Name

  1. Login to the zone

  2. Edit /etc/hosts

  3. Add one domain name to the server ip address

  4. Test the domain name

$ ping <ip address>

$ ping –s <domain name>

1.8.Install DB2 Server on DB Zone

Copy installation file (SSH & Untar)

$ cat C9658ML.tar | ssh root@192.168.16.1 “(mkdir -p /software/db2; cd /software/db2; gzip -cd; tar -xvf -)”

Install DB2 Server

$ cd /software/db2

$ ./db2_install

Enter: DB2.ESE

Import DB2 License

$ /opt/IBM/db2/v8.1/adm/db2licm -a <license: db2ese.lic >

Create group

$ groupadd –g 100 db2fgrp1

$ groupadd –g 101 db2agrp

$ groupadd –g 102 db2igrp1

Create user

$ useradd –u 100 –g db2fgrp1 –d /export/home/db2fenc1-m db2fenc1

$ useradd –u 101 –g db2agrp –d /export/home/db2adm -m db2adm

$ useradd –u 100 –g db2igrp1 –d /export/home/db2inst1-m db2inst1

Change user password

$ passwd db2fenc1

$ passwd db2adm

$ passwd db2inst1

Add instance service port

$ vi /etc/services

Add: db2c_db2inst1 50000/tcp

Create DB instance (It will generate sqllib directory)

$ cd /opt/IBM/db2/V8.1/instance

$ ./db2icrt –a SERVER –p db2c_db2inst1 –s ese –w 64 –u db2fenc1 db2inst1

(To drop the instance, use db2idrop)

Add project

$ projadd –c “DB2 instance 1” user.db2inst1

Set tuning parameter on resources control

$ su – db2inst1

$ id –p

$ exit

Modify project

Login to the zone again and set these:

$ projmod –s –K “project.max-shm-memory=(priv,4G,deny)” user.db2inst1

$ projmod –s –K “project.max-shm-ids=(priv,4K,deny)” user.db2inst1

$ projmod –s –K “project.max-msg-ids=(priv,4K,deny)” user.db2inst1

$ projmod –s –K “project.max-sem-ids=(priv,4K,deny)” user.db2inst1

Create SAMPLE database

$ cd /opt/IBM/db2/V8.1/bin

$ ./db2sampl

Verify database connection

$ db2 list db directory

$ db2 connect to sample user db2inst1

1.9.Install DB2 Client on Application Zone

Install DB2 Client

$ cd /software/db2

$ ./db2_install

Enter: DB2.ADMCL

Create group

$ groupadd –g 100 db2fgrp1

$ groupadd –g 101 db2agrp

$ groupadd –g 102 db2cgrp1

Create user

$ useradd –u 100 –g db2cgrp1 –d /export/home/db2inst1-m db2inst1

Change user password

$ passwd db2inst1

Add instance port

$ vi /etc/services

Add: db2c_db2inst1 50000/tcp

Create instance

$ cd /opt/IBM/db2/instance

$ ./db2icrt –a SERVER –s client –w 32 –u db2inst1 db2inst1

Login as client user

$ su – db2inst1

Catalog node

$ db2 “catalog tcpip node WPSNODE remote <DB Server IP/Hostname> server db2c_db2inst1

Catalog database

$ db2 “catalog database SAMPLE as SAMPLE at node WPSNODE”

1.10.Create Zone Snapshot

Shutdown all zones

$ zlogin <zone> init 5

Snapshot zone

$ zfs snapshot –r tank/zones@<filename>