Professional Documents
Culture Documents
System z
Workshop
Part 2
Linux
Lab Exercises
Presented by
IBM
1
Virtualization and Linux on System z Workshop
User Agreement
This agreement ("Agreement") governs your use of the remotely accessed IBM system and the course
materials. By using the system or accessing the system (“Materials”) you agree to the terms of this
Agreement.
Under this Agreement, you may use the Materials only for the class attended and other use authorized
by IBM. Any other use (including distribution, reproduction, resale, publication or transmission) is not
permitted.
The Materials are provided on an "AS IS" basis. In addition, IBM makes no warranties or conditions,
either express or implied, including without limitation, warranties of title, non-infringement and the
implied warranties of merchantability and fitness for a particular purpose, concerning the Materials, or
any information accessed using the Materials.
The z/OS operating system and associated middleware Program(s) that were packaged with, or
preloaded onto, the IBM computer system are the property of the IBM Corporation. You receive no
express or implied patent or other license from IBM. IBM will not be liable for any damages resulting
from use of the Materials, including without limitation, lost profits, lost savings, or any incidental,
special or indirect damages or other economic consequential damages, even if IBM has been advised of
the possibility of such damages. Some jurisdictions do not allow the exclusion or limitation of
incidental or consequential damages, so the above limitation or exclusion may not apply to you.
This agreement does not grant you a license, either expressed or implied, to any IBM intellectual
property, including patents copyrights or trademarks. Unless IBM specifies otherwise, you may not
copy, modify, adapt, reproduce, translate, distribute, reverse engineer, decompile or disassemble any
aspect of the Materials. Neither IBM nor its Suppliers are responsible for: 1) the accuracy,
completeness, timeliness, reliability, content or availability of the Materials or any information
retrieved; 2) loss or damage to your records or data; or 3) your use of or results achieved from the
Materials or any information retrieved.
This Agreement is the complete and exclusive agreement regarding the Materials. IBM may, at any
time, 1) revoke your access to the Materials, or 2) modify, change or withdraw the Materials, in whole
or in part.
This Agreement is governed by the laws of the State of New York.
Notices
This information was developed for products and Materials offered in the U.S.A.
IBM may not offer the products, Materials, or features discussed in this document in other countries. Consult your local
IBM representative for information on the products and Materials currently available in your area. Any reference to an IBM
product, program, or Materials is not intended to state or imply that only that IBM product, program, or Materials may be
used. Any functionally equivalent product, program, or Materials that does not infringe any IBM intellectual property right
may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product,
program, or Materials.
IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of
this document does not give you any license to these patents. You can send license inquiries, in writing, to:
IBM Director of Licensing, IBM Corporation, North Castle Drive Armonk, NY 10504-1785 U.S.A.
2
Virtualization and Linux on System z Workshop
The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent
with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES
THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express
or implied warranties in certain transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically made to the
information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements
and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve
as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for this IBM product
and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any
obligation to you.
Information concerning non-IBM products was obtained from the suppliers of those products, their published
announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of
performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM
products should be addressed to the suppliers of those products.
This information contains examples of data and reports used in daily business operations. To illustrate them as completely
as possible, the examples include the names of individuals, companies, brands, and products. All of these names are
fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which illustrates programming techniques on
various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to
IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application
programming interface for the operating platform for which the sample programs are written. These examples have not been
thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, Materials ability, or function of
these programs. You may copy, modify, and distribute these sample programs in any form without payment to IBM for the
purposes of developing, using, marketing, or distributing application programs conforming to IBM's application
programming interfaces.
3
Virtualization and Linux on System z Workshop
Table of Contents
Unit 1: Install Linux .................................................................................................................................. 5
1.1 Prepare the Linux virtual server ..................................................................................................... 5
1.2 Installation ..................................................................................................................................... 7
Unit 2: Setup Common Services............................................................................................................. 12
2.1 Automount ....................................................................................................................................12
2.2 VNC Server................................................................................................................................... 12
2.3 Managing Software....................................................................................................................... 14
2.4 NFS Server .................................................................................................................................. 14
2.5 Other services................................................................................................................................ 15
Unit 3: ECKD Disk Management.......................................................................................................... 17
3.1 View information ......................................................................................................................... 17
3.2 Add DASD Device .......................................................................................................................18
3.3 DASD tools .................................................................................................................................. 19
3.4 Create Filesystem with LVM........................................................................................................ 21
Unit 4: IBM Software ............................................................................................................................ 24
4.1 Universal Database (UDB) V8.2...................................................................................................24
4.2 DB2 Runtime Client .....................................................................................................................27
4.3 WebSphere Application Server V6.1 ........................................................................................... 29
4.4 IBM HTTP Server and the WebSphere Application Server Plug-in.............................................33
Unit 5: Other software..............................................................................................................................35
5.1 Oracle 10g2 on System z Linux.................................................................................................... 35
Unit 6: References....................................................................................................................................40
6.1 Navigating in Linux.......................................................................................................................40
6.2 Vi Cheat Sheet...............................................................................................................................42
6.3 Books.............................................................................................................................................43
6.4 Web Sites.......................................................................................................................................43
4
Virtualization and Linux on System z Workshop
===> file
Execute the profile. Now you have a RETRIEVE key (F12) defined!
===> profile
Link to the disk that contains the FTP commands:
===> vmlink tcpmaint 592
5
Virtualization and Linux on System z Workshop
ftp> quit
These files should now be on your A-disk.
6
Virtualization and Linux on System z Workshop
1.2 Installation
Execute RHEL4 EXEC to start the initialization process.
===> rhel4
When you see the following messages, you are ready to start the loader, the core installation program.
Starting telnetd and sshd to allow login over the network.
1.2.1 Loader
Run the loader, the core installation program:
ssh to 129.40.35.<n>1
Login as root
There is no password at this point. The system presents a series of curses based panels to collect
information on how to proceed with the installation.
Language selection: Accept the default – English
Tab to OK and press Enter
Installation Media:
7
Virtualization and Linux on System z Workshop
FCP Devices
FCP (Fibre Channel protocol) devices enable System z Linux servers to use SCSI devices rather than
DASD devices. There is no FCP device to configure, skip this step.
Click on Next
You will receive warning messages about initializing your disk volumes,
Select Yes to format the devices
8
Virtualization and Linux on System z Workshop
Click on Next
Reply yes to remove all partitions:
Click on Yes
Disk Setup
The following partitions are now configured:
● A /boot partition of 100 MB - the partition mounted on /boot/ contains the operating system
kernel (which allows your system to boot Red Hat Enterprise Linux), along with files used
during the bootstrap process.
● Logical volume group VolGroup00
○ LogVol01 - A swap partition of 1504 MB - swap partitions are used to support virtual
memory. In other words, data is written to a swap partition when there is not enough RAM
to store the data your system is processing. Unlike the Intel or other UNIX platforms,
swapping is better managed by z/VM and it is typically unnecessary to allocate the normal
rule of thumb amount for swap. Reduce the amount to 256 MB
Double click on VolGroup00
Double click on LogVol01
Change the size to 256
Click on OK
Review the updated configuration and continue.
Click on Next
Reply yes to ignore the warning message about the SWAP space size too small.
Click on Yes
Network Configuration
The installation program automatically detects any network devices you have and displays them in the
Network Devices list. A network interface of eth0 is detected.
Manually enter the hostname in the field provided:
Enter pbc35<n>1.pbm.ihost.com
Click on Next
Firewall Configuration
In this workshop, you will disable the firewall.
No Firewall provides complete access to your system and does no security checking. Security
checking is the disabling of access to certain services. This should only be selected if you are running
on a trusted network (not the Internet) or plan to do more firewall configuration later
9
Virtualization and Linux on System z Workshop
Select No firewall
Click on Next
Reply Proceed to get past the No Firewall message.
Click Proceed
10
Virtualization and Linux on System z Workshop
Installing packages
A screen preparing you for the installation now appears. For your reference, a complete log of your
installation can be found in /root/install.log once you reboot your system.
This will take approximately 30-45 minutes.
11
Virtualization and Linux on System z Workshop
Create the file /etc/auto.mnt to contain information for the file system we want to automount.
# vi /etc/auto.mnt
Add the following line:
labstuff -ro,rsize=8192 129.40.35.3:/nfs/labstuff
This line specifies that the directory /labstuff at host IP address 129.40.35.3 to be mounted at mount
point /mnt/labstuff. The mounted file system will be read-only and have a read buffer size of 8192
bytes.
The autofs service is started automatically at boot time. To make the changes effective immediately,
restart the autofs status.
# service autofs restart
Verify that the new mount point has been added.
# service autofs status
# ls –l /mnt/labstuff
12
Virtualization and Linux on System z Workshop
13
Virtualization and Linux on System z Workshop
14
Virtualization and Linux on System z Workshop
Add a share
There are two ways to add shares to your NFS server under Red Hat Linux: use the NFS Server
Configuration Tool (system-config-nfs), or manually edit its configuration file (/etc/exports) and then
export the directories with the /usr/sbin/exportfs command.
First let's use the manual method.
1. Start the NFS server.
# chkconfig nfs on
# service nfs start
2. Edit the /etc/exports file:
# vi /etc/exports
3. Add a share as follows to allow everyone to access the /tmp directory:
/tmp *(ro,sync)
15
Virtualization and Linux on System z Workshop
16
Virtualization and Linux on System z Workshop
lsdasd
The lsdasd command uses sysfs to report information on DASD devices.
# lsdasd
0.0.0200(ECKD) at ( 94: 0) is dasda : active at blocksize 4096, 600840
blocks, 2347 MB
0.0.0201(ECKD) at ( 94: 4) is dasdb : active at blocksize 4096, 600840
blocks, 2347 MB
...
...
The DASD device driver uses a device name of the form dasd<x> for each DASD. In the name,
<x> is one to four lowercase letters. “dasda” refers to the whole of the first disk in the system,
device 200 added during installation of linux.
17
Virtualization and Linux on System z Workshop
systool
The systool command is another tool that uses sysfs to report devices by bus, class, and topology. The
-v option reports all device attributes; the -b option reports device information for a specific bus
(device):
# systool -vb ccw 0.0.0200
Bus = "ccw"
Device = "0.0.0200"
Device path = "/sys/devices/css0/0.0.0002/0.0.0200"
availability = "good"
cmb_enable = "0"
cutype = "3990/e9"
detach_state = "0"
devtype = "3390/0a"
discipline = "ECKD"
online = "1"
readonly = "0"
use_diag = "0"
3. After we modify modprobe.conf, we must then use the mkinitrd and zipl commands to create a
new initial RAM disk (initrd) for the system to use when it boots. The new initrd will include
the 2 new disks we have just added.
mkinitrd creates an initial image used by the kernel for preloading the block device modules
(such as DASD) which are needed to access the root filesystem. In this case initrd-2.6.9-
42a.EL.img is the image to be built and 2.6.9-42.EL is the kernel version.
# mkinitrd -v /boot/initrd-2.6.9-42a.EL.img 2.6.9-42.EL
4. Edit the /etc/zipl.conf file to tell the zipl command to use the new image we just built,
/boot/initrd-2.6.9-42a.EL.img:
18
Virtualization and Linux on System z Workshop
# vi /etc/zipl.conf
[defaultboot]
default=linux
target=/boot/
[linux]
image=/boot/vmlinuz-2.6.9-42.EL
ramdisk=/boot/initrd-2.6.9-42a.EL.img
parameters="root=/dev/VolGroup00/LogVol00"
5. Execute the zipl command to write the new initrd to the boot device:
# zipl
6. Shutdown and reboot your Linux server
# reboot
7. When the server comes back up, reconnect and login.
Login as root
2. Format DASD devices 300 and 301. Use a the file names obtained from the last step and a
block size of 4096.
# dasdfmt -b 4096 -f /dev/dasd<300>
Reply 'yes' to continue
# dasdfmt -b 4096 -f /dev/dasd<301>
Reply 'yes' to continue
fdasd
fdasd is used to make partitions on a DASD device. The compatible disk layout allows you to split
DASD into several partitions. Use fdasd to manage partitions on a DASD. You can use fdasd to
create, change and delete partitions, and also to change the volume serial number.
19
Virtualization and Linux on System z Workshop
1. Use the -a option to partition DASDs 300 and 301 into one single partition each:
# fdasd -a /dev/dasde
# fdasd -a /dev/dasdf
Dasdview
dasdview displays the following DASD information in hexadecimal, EBCDIC, and ASCII format :
• The volume label
• VTOC (Volume Table of Content) details
• Content of the DASD
1. Display VTOC information for device 300:
# dasdview -–vtoc -f /dev/dasde
--- VTOC info -----------------------------------------------------------------
The VTOC contains:
2 format 1 label(s)
1 format 4 label(s)
1 format 5 label(s)
0 format 7 label(s)
Other S/390 and zSeries operating systems would see the following data sets:
+----------------------------------------------+--------------+--------------+
| data set | start | end |
+----------------------------------------------+--------------+--------------+
| LINUX.V0X0200.PART0001.NATIVE | trk | trk |
| data set serial number : '0X0200' | 2 | 2134 |
| system code : 'IBM LINUX ' | cyl/trk | cyl/trk |
| creation date : year 2007, day 162 | 0/ 2 | 142/ 4 |
+----------------------------------------------+--------------+--------------+
| LINUX.V0X0200.PART0002.LVM | trk | trk |
| data set serial number : '0X0200' | 2135 | 50069 |
| system code : 'IBM LINUX ' | cyl/trk | cyl/trk |
| creation date : year 2007, day 162 | 142/ 5 | 3337/ 14 |
+----------------------------------------------+--------------+--------------+
20
Virtualization and Linux on System z Workshop
tunedasd
tunedasd is used to tune DASD performance. It can:
● Display and reset DASD performance statistics
● Query and set a DASD’s cache mode. Today’s ECKD devices support the following behaviors:
● normal for normal cache replacement
● bypass to bypass cache
● inhibit to inhibit cache
● sequential for sequential access
● prestage for sequential prestage
● record for record access.
● Reserve and release DASD
● Breaking the lock of a known DASD (for accessing a boxed DASD while booting Linux)
1. Query the current setting for the cache mode of DASD 300:
# tunedasd -g /dev/dasde
normal (0 cyl)
21
Virtualization and Linux on System z Workshop
# pvdisplay
22
Virtualization and Linux on System z Workshop
23
Virtualization and Linux on System z Workshop
24
Virtualization and Linux on System z Workshop
25
Virtualization and Linux on System z Workshop
26
Virtualization and Linux on System z Workshop
27
Virtualization and Linux on System z Workshop
Refresh the DB2 directory cache by exiting the DB2 Command Line Processor.
=> terminate
Start the DB2 Command Line Processor again.
$ db2
Now access the remote database you have just configured.
=> connect to mydb user db2user using db2user
5. Retrieve data from a sample employee table.
=> select * from dsn8810.emp
Your query should return data for 42 employees.
6. Release the remote connection and exit the DB2 Command Line Processor.
=> terminate
28
Virtualization and Linux on System z Workshop
29
Virtualization and Linux on System z Workshop
30
Virtualization and Linux on System z Workshop
31
Virtualization and Linux on System z Workshop
http://129.40.35.<n>1:9080/PlanstByWebSphere
3. Explore the rest of the available samples.
1. Http://129.40.35.<n>1:9080/WSsample
32
Virtualization and Linux on System z Workshop
33
Virtualization and Linux on System z Workshop
Click on Next
Click on Next
10. Review the confirmation panel to verify your selections. Begin installing IBM HTTP Server.
Click on Finish
11. When the installation is complete:
Click on Next
12. Start the HTTP Server.
# /opt/IBM/HTTPServer/bin/apachectl start
13. Launch a browser and start the test the HTTP server. You should see the IBM HTTP server
home page.
Http://129.40.35.<n>1
14. Test the plug-in to Websphere. Invoke the snoop servlet without using the application server
specific sport. The request will first send to the HTTP server and then forward to the
application server for processing via the plug-in.
Http://129.40.35.<n>1/snoop
34
Virtualization and Linux on System z Workshop
35
Virtualization and Linux on System z Workshop
# vi /etc/sysctl.conf
net.ipv4.ip_local_port_range=1024 65000
kernel.sem=250 32000 100 128
kernel.shmmax=536870912 #Set to roughly 2/3 of the guest memory size.
fs.file-max=65536
net.core.rmem_default=1048576
net.core.rmem_max=1048576
net.core.wmem_default=262144
net.core.wmem_max=262144
2. Apply the changes.
# sysctl -p
36
Virtualization and Linux on System z Workshop
37
Virtualization and Linux on System z Workshop
Click on Next
8. Accept the defaults for Home destination
Click on Next
9. Start the Product-Specific Prerequisite Checks
Click on Next
10. Ignore the warning. We do not have the recommended memory and swap space allocated. This
will not affect this installation.
Click on Yes
11. Accept the default Configuration Option to create a database
Click on Next
12. Accept the default of “General Purpose” database
Click on Next
13. Accept the default Database Configuration Options
Click on Next
14. Accept the default Database Management Option to use Database Control
Click on Next
15. Accept the default Database Storage Option of File System
Click on Next
16. Accept the default to Not enable Automated backups
Click on Next
17. Set account passwords
Select Use the same password for all the accounts
Type in a password of ‘oracle’
Click on Next
18. Review the summary and start the installation
Click on Next
19. When the Database Configuration Assistant presents the Database creation complete window.
Continue with next step
Click on OK
20. When the Execute Configuration scripts window appear, go to a root user session and execute
the scripts listed in this window...
# ________________________________________________________
# ________________________________________________________
38
Virtualization and Linux on System z Workshop
You can use this panel to manage your single instance database, such aschecking for patches, running
the Automatic Workload Repository, and so on.
39
Virtualization and Linux on System z Workshop
Unit 6: References
6.1 Navigating in Linux
Some basic commands
pwd Print current (working) directory.
Getting help
To get detailed help on a particular command or program, you can try the following:
Man pages If you want help on a specific command (ls for example), type man ls. You move around in
man as you do with less: SPACEBAR is forward a page, B is back a page, Q is quit.
Info pages Info pages are similar to man pages, but contain links and other complex structures. There are
many key-strokes for navigating info; if you call info without any arguments, then hit H, you'll
get some help on using info.
40
Virtualization and Linux on System z Workshop
Man pages If you want help on a specific command (ls for example), type man ls. You move around in
man as you do with less: SPACEBAR is forward a page, B is back a page, Q is quit.
/usr/share/doc Every package must install at least some minimal help into a subdirectory in
/usr/share/doc. Sometimes it's in html format (read with a browser),
sometimes it's plain text (read with less), sometimes it's compressed text (has an
ending like .gz, read with zless).
Down arrow key Scroll down to the next event in the history list.
!345 Execute command #345 in the history file.
!! Execute the last command you entered.
!$ Retrieve the parameter of the last command.
!<command> Execute the last <command> in the history list. For example, !cp will repeat
the last copy command in the history list.
41
Virtualization and Linux on System z Workshop
Editing commands: They can be preceded by a number of times to repeat the command, i.e. 4dd will
cut 4 lines.
dd cut line (delete)
yy copy line (yank)
p paste after cursor
P paste before cursor
42
Virtualization and Linux on System z Workshop
File commands:
:w save file
:w filename save as 'filename'
:q quit
:q! quit without saving
:e file open a file
:r file insert (read) a file
6.3 Books
• Linux in a Nutshell
• Linux for S/390 - Redbook
• zSeries HiperSockets - Redbook
• zSeries Linux Application Development - Redpiece
• ZSeries Linux Systems Management - Redpiece
• Linux for S/390: Device Drivers and Installation Commands
• Linux on IBM eServer zSeries and S/390: VSWITCH and VLAN Features of z/VM 4.4
www.redbooks.ibm.com/redpapers/pdfs/redp3719.pdf
• Getting Started with zSeries Fibre Channel Protocol - Redpaper
• Linux on IBM zSeries and S/390: High Availability for z/VM and Linux - Redpaper
• Linux on IBM zSeries and S/390: Securing Linux for zSeries with a Central z/OS LDAP Server (RACF)
-Redpaper
• Porting UNIX Applications to Linux - Hints and Tips (
ibm.com/servers/eserver/zseries/library/techpapers/pdf/gm130115.pdf)
• Linux for S/390 and zSeries porting hints and tips (
ibm.com/servers/esdd/articles/linux_s390/index.html)
43