Monday, December 31, 2012

1 Disable the SELinux at GRUB

While play around the SELinux setting , I got the Kernel panic during the system booting.

The error message shows as screenshot below.

image

In order to by pass the selinux setting and log in to the OS, I have to edit the Kernel parameter to disable the SELinux temporary. 

selinux=0

image

After this, the kernel will disable the selinux and continue to boot to the normal startup.

Friday, December 28, 2012

1 Share Host Folder to the Guest OS in Virtual Box

  • Guest OS: Oracle Linux 6.2
  • Host OS: Windows Server 2012
  • Virtual Box 4.2.6

To enable this feature, the guest OS needs to install Guest additions first.

 

Create the share Folders

image

Create the Mount Point

Mount point must exist first. If no mount point, use mkdir create it.

 

Mount the share folder

mount -t vboxsf  sharename mountpoint

in my example, the share name is “SGU” and the mount point is /mnt/sgu

image

To make it munt automatically, add the mount point to the /etc/fstab.

sharename   mountpoint   vboxsf   defaults  0   0

 

image

Reference

http://www.virtualbox.org/manual/ch04.html

Thursday, December 27, 2012

2 Partition Disk on Linux

 

After add the new disk to the host, we need to partition the disk first. Below screenshot shows that I have 5 disks on the host ( sda,sdb, sdc,sdd and sde). sda has 2 partitions , sda1 and sda2.

 

image

We can use fdisk to partition the disk.

fdisk

  • n –> Add new partition
  • P-> Primary Partition
  • 1 –> Partition number
  • w->write table to disk and exit

image

1 Create share disks for Virtual Box

In order to build the cluster environment, we need to have the share disk between nodes. In production environment, this can be achieve by NAS or SAN. Since I am testing with Virtualization environment, I can use Virtual Box command line utilities “VBoxManage” to create the share disks between VMs.

 

Create Virtual Box disk file

"C:\program Files\Oracle\VirtualBox\VBoxManage.exe" createhd --filename D:\ShareDisk\asm1.vdi --size 5120 --format VDI --variant Fixed
"C:\program Files\Oracle\VirtualBox\VBoxManage.exe" createhd --filename D:\ShareDisk\asm2.vdi --size 5120 --format VDI --variant Fixed
"C:\program Files\Oracle\VirtualBox\VBoxManage.exe" createhd --filename D:\ShareDisk\asm3.vdi --size 5120 --format VDI --variant Fixed
"C:\program Files\Oracle\VirtualBox\VBoxManage.exe" createhd --filename D:\ShareDisk\asm4.vdi --size 5120 --format VDI --variant Fixed

image

image

Connect Virtual Box disk file to the VM

"C:\program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RAC1 --storagectl "SATA" --port 1 --device 0 --type hdd --medium D:\ShareDisk\asm1.vdi --mtype shareable
"C:\program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RAC1 --storagectl "SATA" --port 2 --device 0 --type hdd --medium D:\ShareDisk\asm2.vdi --mtype shareable
"C:\program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RAC1 --storagectl "SATA" --port 3 --device 0 --type hdd --medium D:\ShareDisk\asm3.vdi --mtype shareable
"C:\program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RAC1 --storagectl "SATA" --port 4 --device 0 --type hdd --medium D:\ShareDisk\asm4.vdi --mtype shareable

image

image

Mark the Virtual Box Disk file shareable

"C:\program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd D:\ShareDisk\asm1.vdi --type shareable
"C:\program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd D:\ShareDisk\asm2.vdi --type shareable
"C:\program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd D:\ShareDisk\asm3.vdi --type shareable
"C:\program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd D:\ShareDisk\asm4.vdi --type shareable

image

0 Oracle Linux 6.3 Installation on Virtual Box

This is the installation notes follow by the article on the Oracle Base.

Oracle Linux is another Red Hat Compatible Linux distribution. It is maintained and supported by Oracle. The kernel is Oracle modified “Unbreakable Enterprise Kernel”. By default, it is also configure Oracle YUM repository.

Here are the software I used for the installation.

 

Create New VM

 

image_thumb

Set for 4GB RAM

image_thumb4

Create new Hard drive.

image_thumb5

Set up 2 network interface.

  • Adapter 1 for bridged adapter.
  • Adapter 2 for bridged adapter or internal

image

 

image_thumb7

 

Install Oracle Linux

Download the Linux ISO file and attaché to the VM’s DVC Drive..

 

image_thumb[9]

image

image

image

image

image

image

image

Network card configuration. We can leave it for now and customize it later.

image

 

image

image

image

image

image

Make sure include the Oracle YUM repository and select the Customize now.

image

  • Base System: Base ,Client management tools ,Compatibility libraries, Hardware monitoring utilities,Large Systems Performance, Network file system client, Performance Tools, Perl Support.
  • Servers: Server Platform, System administration tools .
  • Desktops: Desktop, Desktop Platform, Fonts, General Purpose Desktop, Graphical Administration Tools, Input Methods, X Window System
  • Applications: Internet Browser
  • Development: Additional Development, Development Tools.

image

image

image

 

image

image

image

image

image

image

image

image

image

Setup IP address for Ethernet card

Please refer here .

 

Disable Firewall

Please refer here.

Disable SELinux

su root
vi /etc/selinux/config

image

SELINUX=disabled

 

Kernel configure

No kernel parameter requires for the guest OS using Oracle Linux 6.2. For the 5.X distribution, many suggest to add “divider=10” to "/etc/grub.conf"

 

Install Guest additions

image

 

image

image

0 Configure network on Linux

 

Manage network interface

ifconfig
ifconfig eth0
ifconfig eth0 down
ifconfig eth0 up

image

 

Network Service

Use service command would bring up/down all the network interface. Use service command to control the internet adapter would also update the routing table.

 

service network status
service network stop
service network start

image

Network configuration file

We can modify the ifcfg-* configure file and bounce the network card to make the changes effective.

/etc/sysconfig/network-scripts/ifcfg-*

image

Below is the example of the ifcfg-eth0 file:

image

Default gateway

/etc/sysconifg/network

image

GATEWAY value can be overwrite by the ifcfg-* file.

DNS Server

/etc/resolve.conf

namesserver value can be overwritten by the parameter “DNS*” in the ifcfg-* file.

 

SQL Panda Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates