116
1 Create the Linux VM’s for the Oracle 12c RAC Workshop on VirtualBox Notes on how to create an Oracle Linux 6.8 VM on VirtualBox for the Oracle RAC 12c Workshop

gavinsoorma.com.au  · Web view2018. 9. 12. · Change the public IP address from 192.168.56.100 to 192.168.56.101. Similarly change the MAC address for eth1 and eth2 and also the

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Notes on how to create an Oracle Linux 6.8 VM on VirtualBox for the

Oracle RAC 12c Workshop

Download and install VirtualBox

https://www.virtualbox.org/wiki/Downloads

Download the Linux 6 Update 8 software from the Oracle Software Delivery Cloud

https://edelivery.oracle.com

Launch Oracle VirtualBox and create the VM rac01

The machine will be created with a 40 GB root partition and 4.3 GB memory allocation.

Note: this assumes available machine memory to be 16 GB.

If 8 GB RAM is only available, set the VM memory size to 2500 MB.

Check subnet for Host-Only adapter is 192.168.56

Mount the Linux installation software using the .iso file we downloaded earlier

Configure Network Adapters

We will use 3 network adapters for the VM network:

1) One to communicate with the host directly from client (like putty)

2) One for host to host internal communication (RAC Interconnect)

3) One for external internet connectivity (to download RPMs via yum)

Note – on some machines to get internet connectivity from VM we need to use NAT instead of Bridged Adapter.

Configure shared folders

The shared folder will enable us to copy any downloaded files like software between our local machine and the VM. In this case I have shared the drive and directory C:\software. Files in this directory will be visible in the Linux VM in the /media/sf_software location. The share name is ‘software’.

Ensure it is set to Auto-mount.

Install the Linux 6 Update 8 Operating System

Note – use the Right Ctrl key to navigate out of the VM installation screen if required.

Click on Yes, discard any data

Networks

Enter hostname rac01.localdomain and click on Configure Network

Highlight System eth0 entry and click on Edit…

Ensure to check the box Connect automatically and clink on the IPV4 Settings tab.

Change the Method to Manual from Automatic (DHCP) and click on Add

Enter the IP address for the rac01 VM public network – 192.168.56.100.

Enter Netmask and Gateway as shown and click Apply…

Highlight System eth1 entry and click on Edit…

Change the Method to Manual from Automatic (DHCP) and click on Add

Enter the IP address for the rac01 VM private network – 192.168.10.100.

Enter Netmask and Gateway as shown and click Apply…

Ensure to check the box Connect automatically

Region and Time Zone Setting

Root Password (keep a note!)

Click Format

Click Write changes to disk

Click on Customize now

Select all the options in the Desktops group

Select option Internet Browser

Select option Development tools

Click Reboot

Click No thanks, I’ll connect later.

Install VirtualBox Guest Additions

Run as root

# yum update

Click OK

Enable sharing of Clipboard and Drag and Drop

Configure the rac01 VM for Oracle Grid Infrastructure 12c Installation

Ensure internet connectivity

Install the oracle-rdbms-server-12cR2-preinstall RPM

[root@rac01 ~]# yum install oracle-database-server-12cR2-preinstall -y

Loaded plugins: refresh-packagekit, security, ulninfo

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package oracle-database-server-12cR2-preinstall.x86_64 0:1.0-3.el6 will be installed

Installed:

oracle-database-server-12cR2-preinstall.x86_64 0:1.0-3.el6

Dependency Installed:

compat-libcap1.x86_64 0:1.10-1 compat-libstdc++-33.x86_64 0:3.2.3-69.el6

ksh.x86_64 0:20120801-37.el6_9 libaio-devel.x86_64 0:0.3.107-10.el6

Complete

Install the oracleasm-support RPM

# [root@rac01 ~]# yum install oracleasm-support

Loaded plugins: refresh-packagekit, security, ulninfo

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package oracleasm-support.x86_64 0:2.1.10-4.el6 will be installed

--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================

Package Arch Version Repository Size

==============================================================================================================================================================

Installing:

oracleasm-support x86_64 2.1.10-4.el6 public_ol6_latest 76 k

Transaction Summary

==============================================================================================================================================================

Install 1 Package(s)

Total download size: 76 k

Installed size: 225 k

Is this ok [y/N]: y

Downloading Packages:

oracleasm-support-2.1.10-4.el6.x86_64.rpm | 76 kB 00:00

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : oracleasm-support-2.1.10-4.el6.x86_64 1/1

Verifying : oracleasm-support-2.1.10-4.el6.x86_64 1/1

Installed:

oracleasm-support.x86_64 0:2.1.10-4.el6

Complete!

Download and install the oracleasmlib RPM.

http://www.oracle.com/technetwork/server-storage/linux/asmlib/ol6-1709075.html

[root@rac01 ~]# cd /media/sf_software/

[root@rac01 sf_software]# ls *asm*

oracleasmlib-2.0.12-1.el6.x86_64.rpm

[root@rac01 sf_software]# rpm -ivh oracleasmlib-2.0.12-1.el6.x86_64.rpm

Preparing... ########################################### [100%]

1:oracleasmlib ########################################### [100%]

[root@rac01 sf_software]#

Create the grid user

[root@rac01 sf_software]# /usr/sbin/groupadd -g 54331 asmadmin

[root@rac01 sf_software]# /usr/sbin/groupadd -g 54332 asmdba

[root@rac01 sf_software]# /usr/sbin/groupadd -g 54333 asmoper

[root@rac01 sf_software]# /usr/sbin/useradd -g oinstall -G asmdba,dba,asmadmin,asmdba,asmoper,vboxsf grid

Configure ASMlib

[root@rac01 sf_software]# /usr/sbin/oracleasm configure -i

Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library

driver. The following questions will determine whether the driver is

loaded on boot and what permissions it will have. The current values

will be shown in brackets ('[]'). Hitting without typing an

answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface []: grid

Default group to own the driver interface []: asmadmin

Start Oracle ASM library driver on boot (y/n) [n]: y

Scan for Oracle ASM disks on boot (y/n) [y]:

Writing Oracle ASM library driver configuration: done

[root@rac01 sbin]# /usr/sbin/oracleasm init

Creating /dev/oracleasm mount point: /dev/oracleasm

Loading module "oracleasm": oracleasm

Configuring "oracleasm" to use device physical block size

Mounting ASMlib driver filesystem: /dev/oracleasm

[root@rac01 sbin]# /usr/sbin/oracleasm status

Checking if ASM is loaded: yes

Checking if /dev/oracleasm is mounted: yes

Create the directory for the 12c Grid Infrastructure installation

[root@rac01 sf_software]# cd /

[root@rac01 /]# mkdir u01

[root@rac01 /]# cd u01

[root@rac01 u01]# mkdir app

[root@rac01 u01]# chown grid:oinstall app

Configure the oracle and grid OS user accounts

[root@rac01 u01]# /usr/sbin/usermod -g oinstall -G dba,asmadmin,asmdba,vboxsf oracle

[root@rac01 u01]# passwd oracle

Changing password for user oracle.

New password:

BAD PASSWORD: it is based on a dictionary word

BAD PASSWORD: is too simple

Retype new password:

passwd: all authentication tokens updated successfully.

[root@rac01 u01]# passwd grid

Changing password for user grid.

New password:

BAD PASSWORD: it is based on a dictionary word

BAD PASSWORD: is too simple

Retype new password:

passwd: all authentication tokens updated successfully.

Configure /etc/hosts file

[root@rac01 u01]# vi /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

192.168.56.100 rac01.localdomain rac01

192.168.56.101 rac02.localdomain rac02

Check the network IPs are correct via ifconfig

Note that the IP entry for eth2 will differ as this is the IP of your internet provider.

[root@rac01 u01]# ifconfig

eth0 Link encap:Ethernet HWaddr 08:00:27:ED:5A:42

inet addr:192.168.56.100 Bcast:192.168.56.255 Mask:255.255.255.0

inet6 addr: fe80::a00:27ff:feed:5a42/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:32 errors:0 dropped:0 overruns:0 frame:0

TX packets:13 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:2880 (2.8 KiB) TX bytes:1008 (1008.0 b)

eth1 Link encap:Ethernet HWaddr 08:00:27:1D:A8:8B

inet addr:192.168.10.100 Bcast:192.168.10.255 Mask:255.255.255.0

inet6 addr: fe80::a00:27ff:fe1d:a88b/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:0 errors:0 dropped:0 overruns:0 frame:0

TX packets:18 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:0 (0.0 b) TX bytes:1308 (1.2 KiB)

eth2 Link encap:Ethernet HWaddr 08:00:27:EF:D8:C1

inet addr:10.1.1.24 Bcast:10.1.1.255 Mask:255.255.255.0

inet6 addr: fe80::a00:27ff:feef:d8c1/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:2199 errors:0 dropped:0 overruns:0 frame:0

TX packets:68 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:368359 (359.7 KiB) TX bytes:11124 (10.8 KiB)

lo Link encap:Local Loopback

inet addr:127.0.0.1 Mask:255.0.0.0

inet6 addr: ::1/128 Scope:Host

UP LOOPBACK RUNNING MTU:65536 Metric:1

RX packets:12 errors:0 dropped:0 overruns:0 frame:0

TX packets:12 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:720 (720.0 b) TX bytes:720 (720.0 b)

Set Security Enhanced Linux (SELINUX) to disabled as we are not enabling any firewall traffic

[root@rac01 u01]# vi /etc/selinux/config

SELINUX=disabled

Stop NTP daemon(if they are running) as we will be using Cluster Time Synchronization Service instead

[root@rac01 u01]# service ntpd stop

Shutting down ntpd: [FAILED]

[root@rac01 u01]# chkconfig ntpd off

[root@rac01 u01]# mv /etc/ntp.conf /etc/ntp.conf.orig

[root@rac01 u01]# rm /var/run/ntpd.pid

rm: cannot remove `/var/run/ntpd.pid': No such file or directory

Disable Firewall

[root@rac01 ~]# service iptables stop

iptables: Setting chains to policy ACCEPT: filter [ OK ]

iptables: Flushing firewall rules: [ OK ]

iptables: Unloading modules: [ OK ]

[root@rac01 ~]# chkconfig iptables off

Edit /etc/resolv.conf

[root@rac01 rpm]# cat /etc/resolv.conf

# Generated by NetworkManager

search localdomain

nameserver 10.1.1.1

Change to

[root@rac01 rpm]# vi /etc/resolv.conf

# Generated by NetworkManager

options timeout:3

search localdomain rac.localdomain

nameserver 192.168.56.102

[root@rac01 rpm]# chattr +i /etc/resolv.conf

[root@rac01 app]# nslookup rac01

Server:192.168.56.102

Address:192.168.56.102#53

Name:rac01.localdomain

Address: 192.168.56.100

[root@rac01 app]# nslookup rac-gns

Server:192.168.56.102

Address:192.168.56.102#53

Name:rac-gns.localdomain

Address: 192.168.56.150

Configure limits.conf file

[root@rac01 ~]# vi /etc/security/limits.conf

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

grid soft nproc 2047

grid hard nproc 16384

grid soft nofile 1024

grid hard nofile 65536

grid soft stack 10240

oracle soft stack 10240

Shutdown the VM

[root@rac01 rpm]# shutdown -h now

Create a backup .ova file

Click on Export

Clone the rac01 VM and create the second VM rac02

Ensure we do not check the box to Reinitialize the MAC address!

Change the hostname

[root@rac01 ~]# vi /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=rac02.localdomain

# oracle-rdbms-server-12cR1-preinstall : Add NOZEROCONF=yes

NOZEROCONF=yes

[root@rac01 ~]# hostname rac02.localdomain

Edit and Update the Network IP addresses on the cloned VM

System > Preferences > Network Connections menu

Original MAC address

Change the original MAC address by replacing last two characters with ‘00’. Click Apply…

Change the public IP address from 192.168.56.100 to 192.168.56.101.

Similarly change the MAC address for eth1 and eth2 and also the private IP address for eth1 as shown.

Rename 70-persistent-net.rules file as it will be regenerated on next VM start

[root@rac01 ~]# cd /etc/udev/rules.d

[oracle@rac01 rules.d]$ mv 70-persistent-net.rules 70-persistent-net.rules.old

Shutdown the cloned VM

[root@rac01 rules.d]# shutdown -h now

Disable the 3rd network adapter as we will not need external internet connectivity from the cloned rac02 VM

For Adapter 1 and Adapter 2 update the MAC address replacing the last two characters with ‘00’

Disable the Adapter 3 for rac01 VM as well as we do not need any internet connectivity anymore

Start both rac01 and rac02 VMs

Connect as root and check connectivity between both rac01 and rac02 for both the public as well as private networks

Connect to rac02 and carry out the same ‘ping’ check to confirm connectivity with rac01.

Also confirm the network IPs on rac02.

Create the Linux VM’s for the Oracle 12c RAC Workshop

on VirtualBox

172