Chapter 4. Linux-HA release 2 installation and initial configuration
4.3 Installing Linux-HA release 2 components
4.3.3 Building RPM packages for Red Hat Enterprise Linux 5
In the previous section, you transferred the rpm files to one of your z/VM guests.
We chose to use lnxrh1 and transferred the packages to the lnxrh1:/usr/src directory as shown in Example 4-9.
Example 4-9 Source packages files
# cd /usr/src/source-packages
# ls -la total 3484
drwxr-xr-x 2 root root 4096 Oct 21 16:26 . drwxr-xr-x 8 root root 4096 Oct 31 09:11 ..
-rw-r--r-- 1 root root 2470971 Oct 21 12:44 heartbeat-2.1.4-2.1.src.rpm -rw-r--r-- 1 root root 48237 Oct 21 16:26 ipvsadm-1.24-6.1.src.rpm -rw-r--r-- 1 root root 1023434 Oct 21 12:44 libnet-1.1.2.1-2.1.src.rpm
#
To build the RPM packages:
1. After you transfer the source packages, install them, which is done in the same way as for any other regular rpm package (Example 4-10).
Example 4-10 Installing the heartbeat source package
# rpm -i heartbeat-2.1.4-2.1.src.rpm
warning: heartbeat-2.1.4-2.1.src.rpm: Header V3 DSA signature:
NOKEY, key ID 1d362aeb
warning: user abuild does not exist - using root warning: group abuild does not exist - using root warning: user abuild does not exist - using root warning: group abuild does not exist - using root warning: user abuild does not exist - using root warning: group abuild does not exist - using root warning: user abuild does not exist - using root warning: group abuild does not exist - using root warning: user abuild does not exist - using root warning: group abuild does not exist - using root warning: user abuild does not exist - using root warning: group abuild does not exist - using root warning: user abuild does not exist - using root warning: group abuild does not exist - using root
#
The warnings are not important because they indicate that “rpm” was unable to verify the signature of the package that was downloaded. It also indicates
that an “abuild” account that belongs to the “abuild” group was expected to exist in the system for the build process. If you do not want to see the messages, import the key that is used to sign the package and create the
“abuild” account and group before you start building the binary packages.
2. Install the other two packages as shown in Example 4-11 and Example 4-12.
Example 4-11 Installing the libnet source package
# rpm -i libnet-1.1.2.1-2.1.src.rpm
warning: libnet-1.1.2.1-2.1.src.rpm: Header V3 DSA signature: NOKEY, key ID 1d362aeb
warning: user abuild does not exist - using root warning: group abuild does not exist - using root warning: user abuild does not exist - using root warning: group abuild does not exist - using root
#
Example 4-12 Installing the ipvsadm source package
# rpm -i ipvsadm-1.24-6.1.src.rpm
warning: ipvsadm-1.24-6.1.src.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
warning: user brewbuilder does not exist - using root warning: group brewbuilder does not exist - using root warning: user brewbuilder does not exist - using root warning: group brewbuilder does not exist - using root warning: user brewbuilder does not exist - using root warning: group brewbuilder does not exist - using root
#
The source rpm packages are not really installed because they are not binary packages yet, which is why you cannot see them in the list of installed packages (Example 4-13). This is expected to happen.
Example 4-13 Checking the installed packages
# rpm -qa | grep ^heartbeat
# rpm -qa | grep ^libnet
# rpm -qa | grep ^ipvsadm
#
The source packages place files in the structure under the /usr/src/redhat directory (Example 4-14).
Example 4-14 The /usr/src/redhat structure
# cd /usr/src/redhat/
# ls -la total 56
drwxr-xr-x 7 root root 4096 Oct 8 11:31 . drwxr-xr-x 8 root root 4096 Oct 31 09:11 ..
drwxr-xr-x 2 root root 4096 Jan 15 2008 BUILD drwxr-xr-x 4 root root 4096 Oct 8 11:31 RPMS drwxr-xr-x 2 root root 4096 Oct 31 09:13 SOURCES drwxr-xr-x 2 root root 4096 Oct 31 09:13 SPECS drwxr-xr-x 2 root root 4096 Jan 15 2008 SRPMS
#
The /usr/src/redhat directory has several files, but only those in the SPECS directory (Example 4-15) are of interest. They contain a type of script that is interpreted by rpmbuild, a binary program from the rpm package, to generate our Heartbeat binary packages, libnet and ipvsadm.
Example 4-15 The SPECS directory
# cd /usr/src/redhat/SPECS/
# ls -la total 100
drwxr-xr-x 2 root root 4096 Oct 31 09:13 . drwxr-xr-x 7 root root 4096 Oct 8 11:31 ..
-rw-r--r-- 1 root root 69488 Aug 20 07:20 heartbeat.spec -rw-r--r-- 1 root root 4888 Jul 12 2006 ipvsadm.spec -rw-r--r-- 1 root root 2507 Aug 18 09:22 libnet.spec
#
3. Compile the first package. Start with the ipvsadm package since it has only a few dependencies and everything is in place to start compiling it on the Red Hat Enterprise Linux 5 installation. Run rpmbuild with the -bb flag
(Example 4-16). The -bb flag indicates that rpmbuild must build a binary package. For more information about rpmbuild, enter man 8 rpmbuild.
Example 4-16 Building a package with rpmbuild
# rpmbuild -bb ipvsadm.spec
After entering the rpmbuild command, a lot of information is displayed on the panel. If the rpmbuild command was able compile the package, we might see something similar to the output in Example 4-17 upon completion.
Example 4-17 Sample rpmbuild output ...
The last line must read “exit 0,” which signals that everything was compiled without any errors. You can also see some lines starting with the word
“Wrote.” These lines indicate where rpmbuild placed the newly generated packages. In this case, we have the following two lines:
/usr/src/redhat/RPMS/s390x/ipvsadm-1.24-8.1.s390x.rpm
/usr/src/redhat/RPMS/s390x/ipvsadm-debuginfo-1.24-8.1.s390x.rpm 4. Install the ipvsadm-1.24-8.1.s390x.rpm package (Example 4-18) since
ipvsadm-debuginfo-1.24-8.1.s390x.rpm is used only when it is necessary to debug the generated binaries. This applies to all packages that have
“debuginfo” in their names.
Example 4-18 Installing the ipvsadm package
# cd /usr/src/redhat/RPMS/s390x
5. Build the libnet packages (Example 4-19).
Example 4-19 Building the libnet packages
# cd /usr/src/redhat/SPECS
# rpmbuild -bb libnet.spec
Example 4-20 shows the libnet package as compiling without errors.
Example 4-20 The rpmbuild output of the libnet build process ...
6. Install the libnet-1.1.2.1-2.1.s390x.rpm package as shown in Example 4-21.
Example 4-21 Installing the libnet package
# cd /usr/src/redhat/RPMS/s390x
7. Build the heartbeat packages (Example 4-22).
Example 4-22 Building the heartbeat packages
# cd /usr/src/redhat/SPECS
# rpmbuild -bb heartbeat.spec error: Failed build dependencies:
lynx is needed by heartbeat-2.1.4-2.1.s390x
net-snmp-devel is needed by heartbeat-2.1.4-2.1.s390x
#
As you can see in Example 4-22 on page 86, rpmbuild tried to compile heartbeat and noted that some dependencies were not met. This is not a big problem. We need to install lynx and net-snmp-devel packages before we can try to compile it again. Since these packages are in the list of
dependencies discussed at the beginning of this chapter, we already transferred to our system, lnxrh1. These two packages are on the Red Hat Enterprise Linux 5 installation CD.
8. Install the lynx package as shown in Example 4-23.
Example 4-23 Resolving the heartbeat package dependencies
# rpm -ivh lynx-2.8.5-28.1.s390x.rpm
warning: lynx-2.8.5-28.1.s390x.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
9. Install all dependencies of the net-snmp-devel package (Example 4-24) as shown in Example 4-25.
Example 4-24 net-snmp-devel package dependencies
# rpm -ivh net-snmp-devel-5.3.1-24.el5.s390x.rpm
warning: net-snmp-devel-5.3.1-24.el5.s390x.rpm: Header V3 DSA signature:
NOKEY, key ID 37017186 error: Failed dependencies:
beecrypt-devel is needed by net-snmp-devel-5.3.1-24.el5.s390x elfutils-devel is needed by net-snmp-devel-5.3.1-24.el5.s390x net-snmp = 1:5.3.1 is needed by net-snmp-devel-5.3.1-24.el5.s390x
#
Example 4-25 Resolving net-snmp-devel dependencies
# rpm -ivh net-snmp-devel-5.3.1-24.el5.s390x.rpm
net-snmp-5.3.1-24.el5.s390x.rpm beecrypt-devel-4.1.2-10.1.1.s390x.rpm elfutils-devel-0.125-3.el5.s390x.rpm
elfutils-devel-static-0.125-3.el5.s390x.rpm
warning: net-snmp-devel-5.3.1-24.el5.s390x.rpm: Header V3 DSA signature:
NOKEY, key ID 37017186
3:elfutils-devel ###########################################
All these packages are also on the Red Hat Enterprise Linux 5 installation CD.
10.Try to build the heartbeat package again (Example 4-26).
Example 4-26 Building the heartbeat packages after resolving the dependencies
# cd /usr/src/redhat/SPECS/
+ '[' -n /var/tmp/heartbeat-2.1.4-build -a /var/tmp/heartbeat-2.1.4-build '!=' / ']'
+ rm -rf /var/tmp/heartbeat-2.1.4-build + rm -rf /usr/src/redhat/BUILD/heartbeat-2.1.4 + exit 0
#
This time everything runs without any errors, and several packages are generated.
11.Install the packages that were generated (Example 4-27).
Example 4-27 More dependencies to resolve
# cd /usr/src/redhat/RPMS/s390x
There are more dependencies to resolve. perl(Mail::Send) is needed only if you want ldirectord to send e-mail for you or any other administrator to let you know that something on the cluster has changed. If you do not want to use this feature, skip it and install heartbeat-ldirectord with the --nodeps flag. We do not need this feature here, so we install heartbeat-ldirectord by using that flag.
12.With all the dependencies satisfied, install heartbeat-ldirectord again as shown in Example 4-28, Example 4-29, and Example 4-30 on page 90.
Example 4-28 Installing heartbeat-ldirectord
# cd /usr/src/redhat/RPMS/s390x
# rpm -ivh heartbeat-ldirectord-2.1.4-2.1.s390x.rpm --nodeps Preparing...
########################################### [100%]
Example 4-29 Installing more dependency packages
# rpm -ivh perl-Net-SSLeay perl-TimeDate
warning: perl-Net-SSLeay-1.30-4.fc6.s390x.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Example 4-30 Installing heartbeat-ldirectord package
Now heartbeat and all necessary packages have been installed.
13.Install the heartbeat-devel package (Example 4-31), which is a requirement to correctly compile snIPL.
Example 4-31 Installing the heartbeat and heartbeat-devel packages
# cd /usr/src/redhat/RPMS/s390x
14.Verify the installed packages as shown in Example 4-32.
Example 4-32 Verifying the installed packages
# rpm -qa | egrep "^(heartbeat|ipvsadm|libnet)" | sort heartbeat-2.1.4-2.1
heartbeat-ldirectord-2.1.4-2.1 heartbeat-pils-2.1.4-2.1 heartbeat-stonith-2.1.4-2.1
ipvsadm-1.24-8.1 libnet-1.1.2.1-2.1
#
With all packages compiled, there is no need to go through the building process again for the other nodes. Simply copy all generated rpm files and install them. In addition, remember to install all dependencies.