Beruflich Dokumente
Kultur Dokumente
https://martincarstenbach.wordpress.com/2015/01/05/installing-oracle-12-1-0-2-rac-on-oracle-linux-7-part-1/
Now that 12.1.0.2 is certified on RedHat Linux 7 and spin-off environments its time to test the
installation of RAC on such a system.
The installation of the OS is different from Oracle Linux 5 and 6-with these distributions was
very straight forward how to install the operating system the method has changed significantly in
release 7. I wont cover the complete installation here, as always Tim Hall was quicker than me,
but it makes me wonder who signed off the user interface for the partitioning wizard I
personally think that the kickstart partitioning-information is a lot easier to understand.
http://oracle-base.com/articles/linux/oracle-linux-7-installation.php
After walking through the steps in the graphical installer I thought that Id rather kickstart the
whole lot. If you have not yet used kickstart to create Oracle/Red Hat/CentOS hosts then now is
the time to start admiring the technology!
My host is Oracle Linux 6.6 and there arent any packages that arent part of the distribution,
with one exception: I have compiled dnsmasq from the current source since it had a bug when
specifying the bind-interfaces command line option if other dnsmasq processes were already
running. libvirt uses dnsmasq extensively for its own networking (I since then upgraded the host
to Oracle Linux 7 too and the problem is no longer present)
Anything that is repetitive is not the best use of anyones time, especially not mine. I prefer to
run a single command, do something different and come back with the OS already installed. For
the installation to work I am relying on PXE booting to pass the kernel and initial RAM disk.
TFTP is in charge of that. A Kickstart file is used for the silent installation. Lets start off with the
Pre Execution Boot Environment (I am putting a shameless plug in here for my 12c book which
covers this subject extensively if you need more background). Here is my default configuration
file in pxelinux.cfg:
default menu.c32
prompt 0
The next step is to ensure that you have the images you are pointing to.
[root@ol62 0]# cp -iv /media/ol70/images/pxeboot/* .
`/media/ol70/images/pxeboot/initrd.img' -> `./initrd.img'
`/media/ol70/images/pxeboot/TRANS.TBL' -> `./TRANS.TBL'
`/media/ol70/images/pxeboot/upgrade.img' -> `./upgrade.img'
`/media/ol70/images/pxeboot/vmlinuz' -> `./vmlinuz'
[root@ol62 0]# pwd
/tftpboot/webroot/images/ol/7/0
The Pre Execution Environment (PXE) will supply the KS (kickstart) directive to the boot
process. The Initial RAMdisk and kernel will be pulled via tftp-dont forget to enable xinetd and
tftp if you are not using dnsmasq like me or this wont work. You also need a DHCP server that
provides the NIC of the VM with an IP and the reference to the PXE boot configuration. If you
are using a lab server then dnsmasq can do this for you. I believe that admins in real life might
not do it that way The official Red Hat documentation has a nice section on how to configure
your environment for pxeboot with the ISC DHCP package, too. Here is the pxe.conf file I used
successfully (with that newly compiled dnsnasq-again the stock Oracle 6.x version cant handle
the bind-interface at the time of writing.
[root@ol62 ~]# cat /etc/dnsmasq.d/pxe.conf
tftp-root=/tftpboot/webroot
enable-tftp
dhcp-boot=pxelinux.0
dhcp-option=vendor:PXEClient,6,2b
dhcp-no-override
#log-queries
#log-dhcp
domain=example.com
dhcp-range=192.168.150.50,192.168.150.150,12h
This file then went into /etc/dnsmasq.d/ as you can see, and I restarted the daemon to make it
read the file. Initially I found the log-queries and log-dhcp output quite useful to work out what
was happening, you can see these messages in /var/log/messages. There are many so you
might want to turn that off as soon as you fixed any potential problems.
Kickstarting
My kickstart file assumes that the installation tree is available via http from 192.168.150.1/ol70.
Its just a loopback mounted ISO image so easy to implement in my host.
My kickstart file is not really special, it simply sets the partitioning schema creating 2 volume
groups: rootvg for system related things such as swap, boot and root plus oraclevg for the oracle
binaries. I based it primarily on the anaconda-ks.cfg file in /root that has been created during the
installation. The kickstart documentationis also rather nice. Since there is no preinstall RPM
available right now I resorted to a %post script to add the Oracle-specific settings:
UPDATE
Since I wrote this post Oracle Linux 7.1 has been released which features the 11.2 and 12.1
RDBMS preinstall RPMs rendering some of the steps shown here obsolete.
%post --log=/root/ks-post.log
sysctl -f --system
mkdir -p /u01/app/oracle
mkdir -p /u01/app/grid
This is of course just an example-you need to adjust this to your environment. I am assuming a
separation of duties here as well which not everyone will (and should!) apply in his environment.
There are also quite a few individual packages in the %package list right now that Ill replace
with the call to the preinstall RPM once its available. Oracle Linux 7 reflects the fact that many
system daemons use a conf.d directory to separate customisations from the main configuration
file. Oracle 12.1.0.2 does not check for this: when I tried moving my Oracle specific code into
/etc/sysctl.d/50-oracle.conf OUI could not find and parse the file. It subsequently complained
about an unknown configuration. So therefore we are back to the old days.
Now all I need to do is to call virt-install on the command line and wait for the KVM
environment to be created.
References
oracle-base.com enough said. Had the OS install first, and the installation of the RDBMS.
Kickstart reference for Red Hat Linux 7
Boot options can be found here they have changed a bit in release 7!
I have documented the whole process in more detail in Expert Consolidation in Oracle 12c
In the first part of the article series you could read how a kickstart file made the installation of
Oracle Linux 7 a lot more bearable. In this part of the series its all about configuring the
operating system. The installation of Grid Infrastructure and the Oracle database is for another
set of posts.
There are quite some differences between Oracle Linux 6 and 7
To me the transition from Oracle Linux 6 to 7 feels like the step from Solaris 9 to 10 at the time.
Personally I think that a lot has changed. Although, its fair to say that it has been quite some
time it has been announced that the network stack commands we know and love are deprecated
and might go Even with Oracle Linux 6 there was a threat that network manager would now
be the only tool to modify your network settings (which thankfully was not the case). A lot of
efforts of the Linux community have now come to fruition, and its time to adjust to the future.
Even when its painful (and it is, at least a bit).
The warning has been out there quite a while but now it seems to be true-no more system-config-
network-tui to configure the network! No more ifconfig! Oh dear-quite a bit of learning to be
done. Luckily someone else has done all the legwork and documented the changes. A good
example is this one:
https://dougvitale.wordpress.com/2011/12/21/deprecated-linux-networking-commands-and-their-
replacements/
So first of all-dont fear: although all network interfaces are configured using network manager
now, you can still use a command line tool: nmtui. After trying it out I have to say Im not really
convinced about its usability. What appears better is the use of the nmcli, network manager
command line tool. Its use is quite confusing, and it appears to me as if the whole network
manager toolset was developed for laptop users, not servers. But I digress. I have a few
interfaces in my RAC VM, the first was configured during the installation, eth[1-3] arent
configured yet.
At this point I have used eth0 as the management network (similar to the way Exadata does) and
will use the other networks for the database. eth1 will act as the public network, eth2 and eth3
will be private.
Although the network interfaces can be named differently for device name persistence I stick
with the old naming for now. I dont want to run into trouble with the installer just yet. On
physical hardware you are very likely to see very different network interface names, the kernel
uses a naming scheme identifying where the cards are (on the main board, or in extension cards
for example). Ill write another post about that soon.
Using dnsmasq (on the host) I configure my hosts for these addresses:
Configuring the interface is actually not too hard once you got the hang of it. It took me a little
while to get it though It almost appears as if something that was simple and easy to use was
made difficult to use.
[root@localhost ~]# nmcli con add con-name eth1 ifname eth1 type ethernet ip4
192.168.100.107/24 gw4 192.168.100.1
[root@localhost ~]# nmcli con add con-name eth2 ifname eth2 type ethernet ip4
192.168.101.107/24
[root@localhost ~]# nmcli con add con-name eth3 ifname eth3 type ethernet ip4
192.168.102.107/24
I can now verify the IP addresses using the ip tool (ifconfig was not installed, I havent yet
checked if there was a compatibility package though)
Now whats left is setting the hostname-which is a simple call to hostnamectl static set-
hostname rac12pri1. nmcli gives you an interface to changing the hostname as well. I repeated
the steps for node 2, they are identical except for the network IP addresses of course.
If you are curious about setting services at runlevel, then therell be another surprise:
Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.
If you just got familiar with upstart then there are some bad news: upstart is now replaced with
systemd This might be the right time to read up on that if you arent familiar with it yet:
https://access.redhat.com/documentation/en-
US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/chap-
Managing_Services_with_systemd.html
Things are a little different with that, so here is an example how to enable and start the NTP
service. It has to be installed first if that hasnt been the case. You also should add the -x flag
in /etc/sysconfig/ntpd. First I would like to see if the service is available. You use systemctl for
this-so instead of a chkconfig ntpd list you call systemctl as shown:
I have to get used to the new syntax: previously you used service <whatever> status and then,
if you needed, typed backspace a few times and changed status to start. The new syntax is closer
to human language but less practical: systemctl status <service>. Changing status to start
requires more typing.
The check proved that the service exists (i.e. the NTP package is installed), but it is not started.
We can change this:
There is a slight caveat with the use of NTP: it is not the default time keeping service. Another
tool, named chronyd is used instead.
This causes a problem after the next reboot: chronyd will be started, NTPd wont be. The Red
Hat documentation therefore has a section on how to switch:
Storage
Shared storage is provided by KVM. I am using my SSDs in the lab from where I create a few
LUNs. These must explicitly be made shareable to be accessible by more than one guest.
Since 12.1.0.2.0 Oracle installs a database for the cluster health monitor by default. Currently I
use the following setup for my lab 12.1.0.2 clusters:
If you use the guided installation of Grid Infrastructure the installer will prompt you for a single
disk group only. This means that the CHM database as well as the OCR and voting files be
installed in that disk group. I prefer to separate them though, which is why I create a second disk
group OCR after the installation has completed and move the voting files and OCR out of
+CHM.
DATA and RECO are standard Exadata disk groups and I like to keep things consistent for
myself.
I use fdisk to partition the future ASM disks with 1 partition spanning the whole LUN.
Other tasks
A lot of the other pre-installation tasks can actually be performed during the kickstart
installation. I still like to use SELinux in permissive mode even though-according to
Requirements for Installing Oracle Database 12.1 on RHEL6 or OL6 64-bit (x86-64) (Doc ID
1529864.1)-selinux can be in enforcing. The directive in the kickstart file is
selinux permissive
You shouldnt have to install additional packages-all packages to be installed should go into the
%packages section of the file. Simply copy the package names from the official documentation
and paste below the last package in the section. There is one exception to the rule: cvuqdisk must
be installed from the Oracle installation media.
Settings for /etc/sysctl.conf and /etc/security/limits.conf can also be made in the kickstart file as
shown in the first part of this series.
Storage to be made available to RAC must have permissions set. Since there isnt an ASMLib in
Oracle Linux 7 to my knowledge UDEV will have to be used, and my udev configuration file,
too, is in the first part.
To make sure my user and group IDs for the oracle and grid account are the same I create the
accounts in the kickstart file as well. Passwords are deliberately not set-they may evolve and I
cant possibly remember them all :)
User equivalence can be set up using a technique I have already described in an earlier blog post.
Although the user equivalence setup can be deferred to when you install Grid Infrastructure I still
perform it before to allow me to run the cluster verification tool with the -fixup option.