Linux下vcs安装及oracle部署-裸设备版本
发布时间:2024-11-21
发布时间:2024-11-21
{Linux下vcs安装及oracle部署-裸设备版
本}
北京握奇数据系统有限公司
版本历史
目录
1
引言.......................................................................................................................... 5 1.1 1.2 1.3 1.4 2
文档目的 ........................................................................................................ 5 读者对象 ........................................................................................................ 5 约定 ............................................................................................................... 5 术语与缩写解释.............................................................................................. 5
安装前准备 ............................................................................................................... 5
2.1 支持的linux操作系统 ................................................................................... 5 VCS 支持的卷管理及文件系统 .......................................................................................... 6
2.2 软硬件准备及检查 .......................................................................................... 7
2.3 3 4 5
修改/etc/hosts文件...................................................................................... 7
2.4 建立双机信任机制 .......................................................................................... 7 VCS软件安装 ............................................................................................................ 9 配置vcs .................................................................................................................. 12 验证VCS ................................................................................................................. 16 5.1 5.2 6 7
验证LLT和GAB的配置文件 .......................................................................... 16 验证LLT,GAB和Cluster操作 ..................................................................... 17
创建VG及逻辑卷.................................................................................................... 19 创建双机数据库-裸设备方式.................................................................................... 22 7.1 创建数据库................................................................................................... 22 7.2 7.3 7.4 7.5 7.6 7.7 7.8
设置用户密码 ............................................................................................... 25 使用裸设备文件............................................................................................ 26 不指定恢复区 ............................................................................................... 26 不勾选任何特性............................................................................................ 27 设置memory.................................................................................................. 28 选择数据库字符集 ........................................................................................ 29 指定初始化参数文件位置.............................................................................. 29
7.9 修改控制文件的路径..................................................................................... 31 7.10 修改控制文件记录..................................................................................... 31 7.11 配置数据文件............................................................................................ 32 7.12 配置redo .................................................................................................. 34 7.13 7.14 8
完成数据库的创建..................................................................................... 34 将安装好的数据库软件及数据库copy到备机 ............................................ 36
7.15 新增加表空间或数据文件的维护................................................................ 37 配置Oracle资源组 .................................................................................................. 38 8.1 安装VCS agent for Oracle ......................................................................... 38 8.2 8.3 8.4 8.5 8.6 8.7
修改listener.ora文件 (以oracle用户登录) ......................................... 40 导入双机管理脚本 ........................................................................................ 40 创建service group ......................................................................................... 41 增加资源 ...................................................................................................... 46 建立依赖关系 ............................................................................................... 49 启动资源 ...................................................................................................... 51
9
配置应用程序资源组 ............................................................................................... 53
9.1 9.2 9.3 9.4 9.5 9.6 10
创建用户 ...................................................................................................... 53 署产品包 ...................................................................................................... 53 查看系统启动脚本 ........................................................................................ 57 配置和查看系统日志..................................................................................... 57 备机环境拷贝 ............................................................................................... 58 创建service group ..................................................................................... 59 VCS的卸载 ....................................................................................................... 64
1 引言
1.1 文档目的
文档详细介绍VCS的安装过程已经如何配置oracle资源,针对裸设备配置数据库方面。
1.2 读者对象
技术支持、开发人员及系统维护人员
1.3 约定
文档中无特殊说明,所进行的操作都以root用户。如果需要oracle或其他业务用户会在操作前说明。
1.4 术语与缩写解释
2 安装前准备
2.1 支持的linux操作系统
This section lists the supported operating systems for this release of Veritas products.
For important updates regarding this release, review the Late-Breaking News TechNote on the Symantec Technical Support website: http:///docs/335001
The Veritas 5.1 SP1 release operates on the following operating systems and
hardware:
■ Red Hat Enterprise Linux 5 (RHEL 5) with Update 3 (2.6.18-128.el5 kernel) or later on AMD Opteron or Intel Xeon EM64T (x86_64)
■ SUSE Linux Enterprise Server 10 (SLES 10) with SP2 (2.6.16.60-0.21 kernel) or SP3 on AMD Opteron or Intel Xeon EM64T (x86_64)
■ SUSE Linux Enterprise Server 11 (SLES 11) (2.6.27.19-5-default kernel) or SUSE Linux Enterprise Server 11 (SLES 11) with SP1 on AMD Opteron or Intel Xeon EM64T (x86_64)
■ Oracle Enterprise Linux (OEL 5) with Update 3 or later
需要的rpm包
■ ext2, ext3, reiserfs, NFS, and bind on LVM2, raw disks, and VxVM.
■ Veritas Storage Foundation (SF): Veritas Volume Manager (VxVM) with Veritas File System (VxFS)
2.2 软硬件准备及检查
软硬件要求:
需要两台服务器,一台存储设备,交换机一台,网卡2个以上,最好至少3个) 服务器配置:需要安装同一版本企业版本Linux 系统,服务器最少配置3块网卡(心跳网卡,数据网卡),连接磁盘阵列所需要的HBA 卡。
磁盘阵列配置:要求把磁盘阵列的同一LUN 分别映射给服务器A,服务器B,并确认每台服务器都可以正常识别到同一分区 VCS软件一套(需要license)
软硬件检查:
1:确保主机与磁盘阵列,网卡物理连接正确无误 2: 确保两台主机均能访问到相同的共享磁盘设备,
3:应用服务或数据库不能配置为开机自启动
4: 在配置和使用过程中,确保同时只有一台主机挂载共享磁盘;切忌两台主机同时挂载共享磁盘。共享磁盘不能配置为操作系统启动时自动挂载
2.3 修改/etc/hosts文件
本文档两台主机名定义为Mainha,standbyha。系统安装后首先编辑两台主机的hosts文件,列出两台主机及浮动IP 的名字及其对应名字。一定要在两台主机上都先编辑好主机表。 注意:本操作要在两台主机上完成
[root@mainha vg]# vi /etc/hosts –红色的三行为新增加 # Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 mainha localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 10.0.76.2 mainha 10.0.76.3 standbyha 10.0.76.24 vip
2.4 建立双机信任机制
VCS 安装和配置需要使用rsh 或者ssh,配置成不需要密码访问。目前我们都采用ssh 方式。首先在mainha上生成私钥和公钥,拷贝公钥到standbyha 上。红色为输入,[Enter]代表不需要输入任何值,直接回车确认。
另外如果你已经做过,但没有成功,再次按照此步骤做时,会需要覆盖原先的.ssh 目录 下的文件,回答y 确认
--创建公钥、私钥
[root@mainha~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): [Enter] Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): [Enter] Enter same passphrase again: [Enter]
Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is:
59:20:a2:7b:7f:64:be:94:99:74:e5:a3:b9:6b:f3:fe root@mainha --创建standbyha的/root/.ssh 目录
[root@mainha~]# ssh standbyha mkdir /root/.ssh
The authenticity of host 'standbyha (10.20.35.11)' can't be established. RSA key fingerprint is 39:65:39:35:ff:8f:29:f1:18:94:09:8b:c7:48:0c:d0. Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'standbyha,10.20.35.11' (RSA) to the list of known hosts. root@standbyha's password:wa1234 --root 用户密码 --拷贝公钥
[root@mainha ~]# scp /root/.ssh/id_rsa.pub standbyha:/root/.ssh/authorized_keys root@standbyha's password: wa1234 --root 用户密码 id_rsa.pub 100% 395 0.4KB/s 00:00 --使用下列命令测试,
#ssh standbyha ls /root 不需要口令即可访问
测试成功后使用相同的办法,在standbyha上生成私钥和公钥,拷贝公钥到mainha上,达到双向都能不输口令访问
注意:这步如果不成功,不能继续做下一节的操作
3 VCS软件安装
本文档以Veritas Cluster Server 5.1 SP1为例介绍VCS的安装过程,其他版本的可能和此版本有细微的差别,但是方法是一样的
进入vcs安装文件所在目录
[root@mainha cluster_server]# pwd
/root/dvd1-redhatlinux/rhel5_x86_64/cluster_server –解压缩后的路径 [root@mainha cluster_server]# ./installvcs –install --下面开始安装
[root@mainha cluster_server]# ./installvcs -install
Veritas Cluster Server 5.1 SP1 Install
Logs are being written to /var/tmp/installvcs-201105121609eSY while installvcs is in progress.
Do you agree with the terms of the End User License Agreement as specified in the cluster_server/EULA/en/EULA_VCS_Ux_5.1SP1.pdf file present on media? [y,n,q,?] 输入y --询问你是否读了license内容
Veritas Cluster Server 5.1 SP1 Install Program
1) Install minimal required Veritas Cluster Server rpms - 272 MB required 2) Install recommended Veritas Cluster Server rpms - 306 MB required 3) Install all Veritas Cluster Server rpms - 341 MB required 4) Display rpms to be installed for each option
Select the rpms to be installed on all systems? [1-4,q,?] (2) –enter即可—选择安装类型
Enter the 64 bit RHEL5 system names separated by spaces: [q,?] (mainha standbyha) mainha standbyha
–输入要安装配置vcs的节点的名称(主机名)
这里vcs会检查这些机器之间的通讯,如前面的ssh配置是否正确,
检查这些操作系统是否满足vcs安装需求 检查操作系统中是否有vcs服务需要的rpms包 检查vcs服务需要的空间等
当出现类似下面的内容时表示系统检查是通过了,
System verification checks completed successfully
The following warnings were discovered on the systems:--警告信息
Nodes have difference in clock by more than 5 sec
Do you want to continue? [y,n,q] (y) y --输入y继续安装
The following Veritas Cluster Server rpms will be installed on all systems:
Rpm Rpm Description
VRTSvlic Veritas Licensing
VRTSperl Veritas Perl 5.10.0 Redistribution
VRTSspt Veritas Software Support Tools by Symantec VRTSatClient Symantec Product Authentication Service Client VRTSatServer Symantec Product Authentication Service VRTSllt Veritas Low Latency Transport
VRTSgab Veritas Group Membership and Atomic Broadcast VRTSvxfen Veritas I/O Fencing by Symantec
VRTSamf Veritas Asynchronous Monitoring Framework by Symantec VRTSvcs Veritas Cluster Server
VRTSvcsag Veritas Cluster Server Bundled Agents by Symantec VRTSvcsdr Veritas Cluster Server Disk Reservation Modules VRTSvcsea Veritas Cluster Server Enterprise Agents by Symantec
Press [Enter] to continue: --列出安装内容列表,按enter继续
安装成功
如果是商用环境,这里会提示输入license,如下图
1) Enter a valid license key
2) Enable keyless licensing and complete system licensing later How would you like to license the systems? [1-2,q] (2)
VCS is licensed on all systems. Do you wish to enter additional licenses? [y,n,q] (n) 是否要键入附加key,如果需要配置全局clusters需要选择y,(我们应该不需要都是本地clusters 因此我们输入n)
Would you like to configure VCS on mainha standbyha? [y,n,q] (n) n –是否在每个节点上配置vcs,我们选择n,配置将在下一步完成。
4 配置vcs
[root@mainha cluster_server]# ./installvcs –configure --执行该命令进行配置
Enter the 64 bit RHEL5 system names separated by spaces: [q,?] (mainha standbyha) mainha standby
--和安装一样,输入需要配置的节点名称
System verification checks completed successfully
The following warnings were discovered on the systems:
Nodes have difference in clock by more than 5 sec
Do you want to continue? [y,n,q] (y) y –检查发现节点的时钟差别超过5秒,这里忽略这个警告,不过尽量将两个系统的时间设置到一样
I/O Fencing
A split brain can occur if servers within the cluster become unable to communicate for any number of reasons. If I/O Fencing is not
enabled, you run the risk of data corruption should a split brain occur. Therefore, to avoid data corruption due to split brain in CFS
environments, I/O Fencing has to be enabled.
Do you want to configure I/O Fencing in enabled mode? [y,n,q,?] (y) n
--这里提示我们是否配置I/O Fencing,这个功能用来保护共享存储数据不会被并发访问,但是需要安装其他软件来支持这个选项,我们这里选择n
Configuring the cluster name and ID
Press [Enter] to continue: --提示信息之间enter
Enter the unique cluster name: [q,?] cletest -- 给Cluster 命名
Enter a unique cluster ID number between 0-65535: [b,q,?] 8
----ClusterID 数字随意定,但同网络内VCS 不能有相同的数字,否则会导致LLT 无法运行
Configuring private heartbeat links
1) Configure heartbeat links using LLT over Ethernet 2) Configure heartbeat links using LLT over UDP
3) Automatically detect configuration for LLT over Ethernet b) Back to previous menu
How would you like to configure heartbeat links? [1-3,b,q,?] (1)
--Symantec建议使用 LLT over Ethernet,所以我们选择1
Discovering NICs on mainha ................................................................................. Discovered eth0 eth1 sit0 –发现的网卡设备
Enter the NIC for the first private heartbeat link on mainha: [b,q,?] (sit0) eth1 –eth1作为第一个心跳线,正式系统上应该配置2个心跳线,这里测试服务器只有一个网卡作为心跳线 Are you sure you want to use eth1 for the first private heartbeat link? [y,n,q,b,?] (n) y Would you like to configure a second private heartbeat link? [y,n,q,b,?] (y)
正式系统上应该配置2个心跳线,这里测试服务器只有一个网卡,所以选择了n ,正式系统选择y
说明:SIT是IPv6-in-IPv4 tunnel interfaces, 这个interfaces(界面或是接口)也称作sitx, sit是"Simple Internet Transition"的缩写. 它可以将IPv6的数据包塞进IPv4, 通过IPv4到达另一个地点.sit0 不能使用在专用的tunnels 上.
Enter the NIC for the low-priority heartbeat link on mainha: [b,q,?] (eth0) 这里由于只配置了一个心跳线,所以强制要求配置一个低优先级的心跳,而实际生产环境中由于配置了两个心跳网卡,因此不需要配置low-priority heartbeat 这里选择n即可 ,实际生产环境的配置参照下面
Are you using the same NICs for private heartbeat links on all systems? [y,n,q,b,?] (y) y 是否确认所有节点上都使用同样的网卡设备名(如每个节点上都用eth1、eth2作为心跳线),选择y ,这样能够统一好管理
Cluster information verification:
Cluster Name: cletest Cluster ID Number: 8
Private Heartbeat NICs for mainha: link1=eth1
Low-Priority Heartbeat NIC for mainha: link-lowpri1=eth0
Private Heartbeat NICs for standbyha: link1=eth1
Low-Priority Heartbeat NIC for standbyha: link-lowpri1=eth0
Is this information correct? [y,n,q,b,?] (y) 确认信息是否正确,直接回车
Configuring the virtual IP of the cluster
You can configure the virtual IP of the cluster to use to connect to the Cluster Manager (Java Console) or to specify in the RemoteGroup resource.
Do you want to configure the Virtual IP? [y,n,q,?] (n) n
--是否通过虚拟ip来连接和管理集群软件,我们选择n
Would you like to configure VCS to use Symantec Security Services? [y,n,q] (n) --是否需要配置Security Services 选择n跳过
配置用户
Do you want to set the username and/or password for the Admin user
(default username = 'admin', password='password')? [y,n,q] (y) –是否需要配置admin用户或增加其他用户
Do you want to set the username and/or password for the Admin user (default username = 'admin', password='password')? [y,n,q] (n) y Enter the user name: [b,q,?] (admin) admin Enter the password: Enter again:
Do you want to add another user to the cluster? [y,n,q] (n) y –创建另一个用户
Enter the user name: [b,q,?] zhangjs --这个是备用用户,自行定义,暂时还没有用到 Enter the password: Enter again:
Enter the privilege for user zhangjs (A=Administrator, O=Operator, G=Guest): [b,q,?] o Would you like to add another user? [y,n,q] (n) n
VCS User verification:
User: admin Privilege: Administrators User: zhangjs Privilege: Operators
Passwords are not displayed
Is this information correct? [y,n,q] (y) y
--验证信息是否正确,输入y回车
Do you want to configure SMTP notification? [y,n,q,?] (n) n –配置smtp通知,现在n Do you want to configure SNMP notification? [y,n,q,?] (n) n
All VCS processes that are currently running must be stopped
Do you want to stop VCS processes now? [y,n,q,?] (y) y
到此Vcs的安装配置完成
5 验证VCS
说明:验证工作要在两个节点上分别操作
5.1 验证LLT和GAB的配置文件
验证前将/opt/VRTS/bin分别配置到/etc/profile 或者root 用户的配置文件 例如:
[root@mainha ~]# vi /etc/profile --增加下面的内容到文件末尾 PATH=$PATH:/opt/VRTS/bin
1、验证LLT配置文件:
安装之后,/etc/llthosts和/etc/llttab文件会包含LLT的配置信息,类似信息如下所示(分别在各个节点验证)。
[root@mainha ~]# more /etc/llthosts 0 mainha 1 standbyha
[root@standbyha ~]# more /etc/llthosts 0 mainha 1 standbyha [root@standbyha ~]#
第一列为主机在集群中的系统ID,第二列为主机在集群中的主机名
[root@mainha ~]# more /etc/llttab set-node mainha set-cluster 8
link eth1 eth-00:1a:64:69:df:e2 - ether - - link-lowpri eth0 eth-00:1a:64:69:df:e0 - ether - -