34
Virtualizing Oracle 11g/R2 RAC Database on Oracle VM: Methods/Tips Kai Yu Oracle Solutions Engineering Lab Dell Inc.

Virtualizing Oracle 11g/R2 RAC Database on Oracle VM ...»º立 Oracle VM Infrastructure 12 •Virtual Infrastructure 系统架构 ... 本地磁盘:xvdd for Oracle Home ... •OVM上创建Oracle

Embed Size (px)

Citation preview

Virtualizing Oracle 11g/R2 RAC Database on Oracle VM:

Methods/Tips

Kai Yu Oracle Solutions Engineering Lab Dell Inc.

Global Marketing

• Kai Yu, [email protected] – 16年oracle 相关从业经验:DBA、应用DBA、架构师 –从硬件到软件的IT解决方案,都有丰富的实践经验 –主要专注于 Oracle RAC, Oracle E-Business Suite and Oracle VM

– Oracle ACE 总监, 作者和演讲者 – IOUG Oracle RAC SIG President (2009-2010) – IOUG Virtualization Special Interest Group member – 2011 年oracle applications users group 年度创新奖得主 – Oracle Blog: http://kyuoracleblog.wordpress.com/

• Dell Oracle Solutions Engineering: www.dell.com/oracle – Dell 系统/存储 上的Oracle技术解决方案 – Dell | Oracle Solutions Components –解决方案包括: 服务器, 存储, 网络, 操作系统, Oracle VM, Oracle RAC, Oracle Applications

关于作者

2

Global Marketing

戴尔电脑公司企业技术与解决方案实验室

关于演讲者

3

Global Marketing

Oracle VM 和 Oracle RAC介绍

建立 Oracle VM Infrastructure

建立 Oracle VM虚拟机

在Oracle VM 上配置11g R2 RAC database

记录演示: Oracle 11g RAC on Oracle VM

4

纲要

Global Marketing

• Oracle VM 虚拟化技术介绍

–X86平台上基于软件的虚拟化解决方案 –服务分割与整合 –高可用性与可伸缩性 –能够快速部署与标准化 –为网格/云服务提供虚拟化技术支持

• Oracle VM 架构

–Oracle VM 服务: 使用Xen Hypervisor, 管理IO、设备 Linux kernel, networking 等 –VM:运行在domU上的guest OS 和应用

5

Oracle VM 和 RAC介绍

Global Marketing

6

Oracle VM 和 RAC介绍

虚拟服务池: VM 服务的自我管理区域

Oracle VM管理器: 为Oracle VM管理提供图形用户界面解决方案

Oracle VM 代理: 与VM 服务器一同安装配置并帮助VM服务 器与 Oracle VM 管理器进行通信

Global Marketing

• Oracle VM 3.0 New Features – 应用驱动虚拟化 – 可伸缩性: 最大支持160个物理CPU,2TB的内存 对于每个子虚拟服务,最大支持128个虚拟CPU和1TB的内存 – Oracle VM Manager 提供集中式管理

聚合Weblogic and Database的中间件应用 提供基于浏览器的图形用户界面接口 提供完整的网络管理与存储管理 可以对子虚拟机进行克隆、资源共享、配置与迁移 子虚拟机的资源可动态管理 所有的虚拟机操作都作为job来提交 使用Oracle Enterprise Manager管理

– 集中的网络管理 逻辑网络拆分; 通过图形用户界面管理 – 集中的存储配置管理 将存储连接起来集中管理, 自动的存储仓库管理

Oracle VM 和 RAC介绍

Global Marketing

8

Oracle VM 和 RAC介绍

• 为什么要在 Oracle VM上运行RAC –服务分割与整合 –Sub-capacity 许可 –在单一物理服务器上建立虚拟集群 –基于模板的部署调度

Global Marketing

9

Oracle VM 和 RAC介绍

• Oracle Real Application Clusters (RAC) –多实例通过高速Private Network相互联系,共享一个数据库 –使用Oracle Cache Fusion进行节点同步

–在共享存储的单一数据库中,所有实例能并发执行事务 –应用的高可用性与可伸缩性

Global Marketing

• 总体架构 – 虚拟服务器连接到物理网络和存储上. – 虚拟的基本结构提供了CPU、内存、网络和存储资源 – 虚拟机作为RAC架构的节点 – 通过虚拟服务器管理所有网络和存储设备

Oracle VM 和 RAC介绍

Global Marketing

11

Oracle VM 和 RAC介绍

• Oracle VMs上的RAC部署方法 –子虚拟机与常规操作系统无异 –需要共享的存储以及公有/私有网络 –子操作系统上部署Oracle 11.R2 GI 和Oracle RAC软件 –使用Oracle VM上的RAC配置模板或者手工配置RAC

Global Marketing

建立 Oracle VM Infrastructure

12

• Virtual Infrastructure 系统架构(Oracle VM 3.0)

• 任务实施概览 – VM 服务器安装配置,VM 管理器安装配置 – VM 网络和存储的配置 – VM servers 与VM Manager连接 – 使用虚拟机模板创建子虚拟机 – 对这些子虚拟机配置网络和共享存储

Global Marketing

13

VM 服务安装 – Bare metal 安装,bios中启动虚拟化 – Oracle VM 2.2中需要更改Dom0 的内存为1024GB – Oracle VM 3.0:在安装完成后不需要手动配置

–确认 VM agent工作状态: #service ovs-agent status

VM 管理器安装 及 VM servers 与VM Manager连接 Discover/connect VM servers vs OVS agent

建立 Oracle VM Infrastructure

Global Marketing

建立 Oracle VM Infrastructure

–基于Oracle VM 3.0的Virtual Infrastructure (使用光纤存储)

Global Marketing

• Virtual Infrastructure 设计 –基于Virtual Infrastructure的Oracle VM 2.2 (使用iSCSI 存储)

ISCSI

eth0

Shared Virtual Disks

RAC Configure on Guest VMs

Guest1(RAC NODE 1) Guest2(RAC NODE 2)

xenbr0

eth0 eth1

eth2 eth3 eth4 eth1 eth0eth2eth3eth4

bond0

eth0eth1

bond0xenbr0

eth1

xenbr1

xenbr1

ISCSIPublic PublicPrivate Interconnect

dom0

VM server1

dom0

VM server2

建立 Oracle VM Infrastructure

Global Marketing

• VM server 网络配置 . Oracle VM 2.2 手工创建 bonding/Xen bridges . Oracle VM 3.0: separated networks, 通过VM Manager管理

.

建立Oracle VM Infrastructure

Global Marketing

17

逻辑网络(public, private,Management)

Public Network 到端口设置和绑定

建立 Oracle VM Infrastructure

Global Marketing

Management逻辑网络到端口设置和绑定 Private逻辑网络到端口设置和绑定

建立 Oracle VM Infrastructure

Global Marketing

• 存储配置 – 连接共享存储设备,设置多路径设备 Oracle VM 2.2: 手工管理, eg: iSCSI命令手工创建multipath devices Oracle VM 3.0: 使用Oracle VM manager ,通过插件(storage connect)连接存储 – Oracle generic iSCSI 插件和SCSI 插件 – 同样,创建多路径设备

建立 Oracle VM Infrastructure

Global Marketing

• 手工步骤创建VM 资料库 (Oracle VM 2.2) – 配置02cb 服务:$service o2cb configure – 在物理卷上创建OCFS2 cluster file system mkfs.ocfs2 -T datafiles -N 8 -L "OVS" /dev/mapper/ovsp1 – 创建VM repository:

$/opt/ovs-agent-2.3/utils/repos.py -n /dev/mapper/ovsp1 – 设置新创建的repository ,作为 cluster root repository

$/opt/ovs-agent-2.3/utils/repos.py -r <uuid> • VM 资料库 结构

建立 Oracle VM Infrastructure

Global Marketing

• 创建存储资料库 (Oracle VM 3.0) – 通过Oracle VM Manager,自动完成创建步骤: 自动任务建立分区, 创建OCFS2 file system,建立资料库

.

建立 Oracle VM Infrastructure

Global Marketing

• Oracle VM 3.0

• 准备物理磁盘 (VM 3.0)

.

建立 Oracle VM Infrastructure

Global Marketing

• 建立 Oracle VM 虚拟机 不同方法: – 用ISO file of an Installation DVD – Booting VM via PXE – 用 Oracle VM 模板 or Assemblies

• 用 Oracle VM 模板 建立 Oracle VM 虚拟机 – 下载 VM templates from Oracle e-delivery – 进口 (import) the Oracle VM 模板:

– 建立 Oracle VM 虚拟机 (Oracle VM 模板复制)

建立 Oracle VM 虚拟机

Global Marketing

• 配置虚拟机上的网络(VM 3.0)

', ]

建立 Oracle VM 虚拟机

Global Marketing

Private Network

建立 Oracle VM 虚拟机

Public

Network

Network configuration of the virtual machine: eth0 and eth1

Global Marketing

添加本地磁盘与共享磁盘到虚拟机(VM 3.0):

建立 Oracle VM Infrastructure

Global Marketing

• 共享磁盘: xvdb and xvdc

for Data and FRA 本地磁盘:xvdd for Oracle Home

建立 Oracle VM Infrastructure

数据库物理磁盘

Global Marketing

OVM上配置 11g R2 RAC Database

28

• OVM上创建Oracle RAC Database – 手工安装配置 – 通过EM Provisioning Procedure实现自动化功能 – 基于Oracle RAC 11g R2 Oracle VM 模板: 详细可以参考Saar的文章

Power of the New Oracle RAC 11g Release 2 Oracle VM Templates

• 安装、配置Oracle RAC OVM – 网络配置: private, private, SCAN IPs, VIPs – 关闭防火墙服务: $service iptables stop $chkconfig iptables off – 先决条件检查: rpms, kernel configs, ntpd, etc limits in /etc/security/limits.conf for grid user and oracle user

./runcluvfy.sh stage -pre crsinst -n owirac1,owirac2 -r 11gR2 –verbose

– 在虚拟磁盘上创建 ASM 磁盘 : $service oracleasm configure -- 配置 ASM (所有节点) $fdisk /dev/xvdc, kpartx /dev/xvdc -- 虚拟磁盘分区 $service oracleasm createdisk OCR1 /dev/xvdc1 (所有节点)

Global Marketing

OVM上配置 11g R2 RAC Database

29

– 安装 11gR2 Grid Infrastructure = Clusterware + ASM

Global Marketing

OVM上配置 11g R2 RAC Database

30

• 指定网络接口:

• 创建OCR和Votingdisk 磁盘

troubleshooting: /usr/sbin/oracleasm-discover ‘ORCL:*’

Global Marketing

OVM上配置 11g R2 RAC Database

31

oracle用户下安装 Oracle RAC software ./cluvfy stage -pre dbinst -fixup -n owirac1,owirac2 -r 11gR2 -osdba dba -verbose ./runInstaller

Select two RAC nodes Select the software location

Global Marketing

OVM上配置 11g R2 RAC Database

32

– 使用grid用户为数据库创建ASM磁盘组: ./asmca

– Create RAC database : ./cluvfy stage -pre dbcfg -fixup -n owirac1,owirac2, -d $ORACLE_HOME -verbose run ./dbca as oracle

Select Oracle Real Application Clusters database Select two RAC nodes Select +DATA for database area, +FRA for flash recovery area

Specify the database configuration

Global Marketing

Recorded Demo: Oracle 11g R2 RAC on OVM

33

Global Marketing

34

Thank You and QA Visit my Oracle Blog at http://kyuoracleblog.wordpress.com