Oracle 11gR2 RAC网络配置,更改public ip、vip和scanip
转载。 https://blog.csdn.net/Martin201609/article/details/52557037
Oracle RAC网络配置,修改public IP以及VIP地址
Oracle Clusterware Network管理
#public ip和private ip
An Oracle Clusterware configuration requires at least two interfaces:
A public network interface, on which users and application servers connect to access data on the database server.
–pulibc网卡,是VIP所绑定的网卡,客户端连接所使用的,对外提供服务连的网卡
A private network interface for internode communication.
–private network interface,用于rac节点之间作信息同步的。
–Oracle RAC系统中每个节点至少有两个interface。public网卡,对外提供服务的,用于客户端连接。
SCAN IP属于虚拟IP,是对外提供的IP,oracle推荐使用scan ip,通过配置scan ip可以将客户端来的请求,负载均衡的分配到集群的各个节点上。
配置要求:
public ip 和 private ip对应的操作系统网卡在集群中各节点的名称要一致,比如都用eth0和eth1,若不一致,则rac软件无法成功安装。
操作系统hosts文件对应正确,需要配置public ip ,public vip ,private ip以及scan ip
关于修改网络配置的各种情况说明
实验环境信息:(linux 64 + RAC 11.2.0.4)
–public ip
192.168.56.101 rac1.wtest.com rac1
192.168.56.103 rac2.wtest.com rac2
192.168.56.102 rac1-vip.wtest.com rac1-vip
192.168.56.104 rac2-vip.wtest.com rac2-vip
192.168.56.105 rac.wtest.com rac
–priv
192.168.57.11 rac1-priv
192.168.57.13 rac2-priv
–网卡信息
node1:
eth0 inet addr:192.168.56.101 Bcast:192.168.56.255 Mask:255.255.255.0
eth1 inet addr:192.168.57.11 Bcast:192.168.57.255 Mask:255.255.255.0
node2:
eth0 inet addr:192.168.56.103 Bcast:192.168.56.255 Mask:255.255.255.0
eth1 inet addr:192.168.57.13 Bcast:192.168.57.255 Mask:255.255.255.0
Case 1、修改主机名(hostname)
public hostname是在软件安装期间,自动在OCR中配置,不能被随便修改。
要想修改hostname,则只有通过将节点踢出集群,然后重新加入的方式,修改hostname
Case 2、修改public ip
修改public ip,如果不修改网卡的名称和掩码等,修改后的IP地址,仍然在原网络的局域内,则可以直接进行修改。
直接在OS操作系统层处理,不需要再在oracle clusterware层做一些其它的处理
node1:
eth0 192.168.56.101 –> 192.168.56.111
node2:
eth0 192.168.56.103 –> 192.168.56.113
原网卡的名称保持不变
1. Shutdown Oracle Clusterware stack
node1:
./crsctl stop crs
node2:
./crsctl stop crs
2. Modify the IP address at network layer, DNS and /etc/hosts file to reflect the change
修改/etc/hosts文件
修改/etc/sysconfig/network-scripts/ifcfg-eth0
重开网络服务
service network restart
3. Restart Oracle Clusterware stack
使用新网卡登录到机器
cd /app/grid/11.2.0/bin
./crsctl start crs
查看状态
crsctl stat res -t
[grid@rac2 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATADG.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.DGSYS.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.EXTDG.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.SYSDG.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE OFFLINE rac1
OFFLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.registry.acfs
ONLINE ONLINE rac1
ONLINE ONLINE rac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1
ora.cvu
1 ONLINE ONLINE rac1
ora.mar.db
1 OFFLINE OFFLINE Instance Shutdown
2 OFFLINE OFFLINE Instance Shutdown
ora.oc4j
1 ONLINE ONLINE rac1
ora.rac.db
1 OFFLINE OFFLINE Instance Shutdown
2 OFFLINE OFFLINE Instance Shutdown
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac1
crs_stat -t -v
[grid@rac2 ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.DATADG.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1
ora.DGSYS.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1
ora.EXTDG.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1
ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac1
ora.SYSDG.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1
ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE rac1
ora.cvu ora.cvu.type 0/5 0/0 ONLINE ONLINE rac1
ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE
ora.mar.db ora....se.type 0/2 0/1 OFFLINE OFFLINE
ora....network ora....rk.type 0/5 0/ ONLINE ONLINE rac1
ora.oc4j ora.oc4j.type 0/1 0/2 ONLINE ONLINE rac1
ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE rac1
ora.rac.db ora....se.type 0/2 0/1 OFFLINE OFFLINE
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac1
ora....C1.lsnr application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.gsd application 0/5 0/0 OFFLINE OFFLINE
ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac1
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac2
ora....C2.lsnr application 0/5 0/0 ONLINE ONLINE rac2
ora.rac2.gsd application 0/5 0/0 OFFLINE OFFLINE
ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac2
ora....ry.acfs ora....fs.type 0/5 0/ ONLINE ONLINE rac1
ora.scan1.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac1
---------------------
Case 3、Changing public network interface, subnet or netmask
修改网卡、子网掩码等信息,需要通过oifcfg命令完成对应的修改
If the change involves different subnet(netmask) or interface, delete the existing interface information from OCR and add it back with the correct information is required.
原先使用eth0,分别为192.168.56.111 和 192.168.56.113
修改网卡名到eth2,使用ip为192.168.56.121 和 192.168.56.123
node1:
eth2 192.168.56.121
node2:
eth2 192.168.56.123
---------------------
srvctl stop database -d RAC -o immediate
srvctl stop asm -n rac1
srvctl stop asm -n rac2
srvctl stop nodeapps -n rac1
srvctl stop nodeapps -n rac2
1.停止数据库 srvctl stop database -d RAC -o immediate
2.停止nodeapps
从11gR2以后:
srvctl config nodeapps -a
./crsctl stop crs (两个节点都要执行)
---------------------
[grid@rac1 ~]$ srvctl config nodeapps -a
网络存在: 1/192.168.56.0/255.255.255.0/eth0, 类型 static
VIP 存在: /rac1-vip/192.168.56.102/192.168.56.0/255.255.255.0/eth0, 托管节点 rac1
VIP 存在: /rac2-vip/192.168.56.104/192.168.56.0/255.255.255.0/eth0, 托管节点 rac2
[grid@rac2 ~]$ srvctl stop asm -n rac2
PRCR-1014 : 无法停止资源 ora.asm
PRCR-1065 : 无法停止资源 ora.asm
CRS-2529: Unable to act on 'ora.asm' because that would require stopping or relocating 'ora.DATADG.dg', but the force option was not specified
oerr crs 2529
[grid@rac2 ~]$ oerr crs 2529
2529, 1, "Unable to act on '%s' because that would require stopping or relocating '%s', but the force option was not specified"
// *Cause: Acting on the resource requires stopping or relocating other resources,
// which requires that force option be specified, and it is not.
// *Action: Re-evaluate the request and if it makes sense, set the force option and
// re-submit
强制关闭(加f选项)
srvctl stop asm -n rac2 -f
servctl stop asm -n rac1 -f
查看oifcfg getif
[root@rac1 bin]# ./oifcfg getif
PRIF-10: failed to initialize the cluster registry
当关闭asm实例时,则执行这个会报错的
---------------------
3.所以 crsctl start crs
处理:cd /app/grid/11.2.0/bin
./oifcfg getif
[root@rac1 bin]# ./oifcfg getif
eth0 192.168.56.0 global public
eth1 192.168.57.0 global cluster_interconnect
[root@rac1 bin]# ./oifcfg iflist
eth0 192.168.56.0
eth1 192.168.57.0
eth1 169.254.0.0
eth2 192.168.56.0
---------------------
查看hosts
#public ip
192.168.56.111 rac1.wtest.com rac1
192.168.56.113 rac2.wtest.com rac2
192.168.56.102 rac1-vip.wtest.com rac1-vip
192.168.56.104 rac2-vip.wtest.com rac2-vip
192.168.56.105 rac.wtest.com rac
#priv
192.168.57.11 rac1-priv
192.168.57.13 rac2-priv
#新的所使用的public ip
192.168.56.121 rac1.wtest.com rac1
192.168.56.123 rac2.wtest.com rac2
---------------------
4.处理
通过 oifcfg 命令修改所使用的public ip的网卡
[root@rac1 bin]# ./oifcfg delif -global eth0/192.168.56.0
[root@rac1 bin]#
[root@rac1 bin]# ./oifcfg getif
eth1 192.168.57.0 global cluster_interconnect
./oifcfg delif -global eth0/192.168.56.0
./oifcfg setif -global eth2/192.168.56.0:public
禁用eth0,启动eth2,模拟启动新的名称的网卡,换掉旧的网卡
ifdown eth0 停用原有网卡
ifup eth2 使用网卡eth2
./crsctl stop crs
./crsctl start crs
6.查看各资源状态
crsctl stat res -t
发现 两个节点上的VIP并没有启动
尝试启动两节点的VIP
[grid@rac2 ~]$ srctl start vip -n rac2
-bash: srctl: command not found
[grid@rac2 ~]$ srvctl start vip -n rac2
PRCR-1079 : 无法启动资源 ora.rac2.vip
CRS-2674: Start of 'ora.net1.network' on 'rac2' failed
CRS-2632: There are no more servers to try to place resource 'ora.rac2.vip' on that would satisfy its placement policy
[grid@rac2 ~]$ oerr crs 2632
2632, 1, "There are no more servers to try to place resource '%s' on that would satisfy its placement policy"
// *Cause: After one or more attempts, the system ran out of servers
// that can be used to place the resource and satisfy its placement
// policy.
// *Action: None.
[grid@rac2 ~]$ oerr crs 2674
2674, 1, "Start of '%s' on '%s' failed"
// *Cause: This is a status message.
// *Action: None.
7.查看vip的信息,仍然绑定在eth0上
[grid@rac2 ~]$ srvctl config nodeapps -a
网络存在: 1/192.168.56.0/255.255.255.0/eth0, 类型 static
VIP 存在: /rac1-vip/192.168.56.102/192.168.56.0/255.255.255.0/eth0, 托管节点 rac1
VIP 存在: /rac2-vip/192.168.56.104/192.168.56.0/255.255.255.0/eth0, 托管节点 rac2
故:修改public ip所在的网卡名称之后,因所有的VIP绑定对PUBLIC IP所在的网卡上,所以同样要同步修改VIP的相关配置的
修改VIP所绑定的网卡
通过原有的方式修改
root用户操作
cd /app/grid/11.2.0/bin
srvctl config nodeapps -n rac1 -A 192.168.56.102/255.255.255.0/eth2
srvctl config nodeapps -n rac2 -A 192.168.56.104/255.255.255.0/eth2
查看修改后的状态
[grid@rac2 ~]$ srvctl config nodeapps -a
网络存在: 1/192.168.56.0/255.255.255.0/eth2, 类型 static
VIP 存在: /rac1-vip/192.168.56.102/192.168.56.0/255.255.255.0/eth2, 托管节点 rac1
VIP 存在: /rac2-vip/192.168.56.104/192.168.56.0/255.255.255.0/eth2, 托管节点 rac2
在11.2.0.2以后的版本中,也可以通过直接修改network资源完成类似的操作
更改相关的配置:
srvctl modify network -k 1 -S 192.168.56.102/255.255.255.0/eth2
srvctl modify network -k 1 -S 192.168.56.104/255.255.255.0/eth2
注:
How to ModifyPublic Network Information including VIP in Oracle Clusterware (文档 ID 276434.1)
Note 1: Starting with 11.2, the VIPs depend on the network resource (ora.net1.network), the OCR only records the VIP
hostname or the IP address associated with the VIP resource. The network attributes (subnet/netmask/interface) are
recorded with the network resource. When the nodeapps resource is modified, the network resoure(ora.net1.network)
attributes are also modified implicitly.
From 11.2.0.2 onwards, if only subnet/netmask/interface change is required, network resource can be modified directly via
srvctl modify network command.
as root user:
# srvctl modify network -k <network_number>] [-S <subnet>/<netmask>[/if1[|if2...]]
eg:
# srvctl modify network -k 1 -S 110.11.70.0/255.255.255.0/eth2
8.查看资源状态
crsctl stat res -t
crs_stat -t
9.如果保证放心,有停机时间窗口,可以尝试两个节点重启一起,保证安全请放心
crsctl stop crs
crsctl start crs
crsctl stat res -t
servctl start database -d RAC -o immediate
Case 4: Changing VIPs associated with public network change
如果涉及VIP的修改以及public ip所在的网卡名称,掩码等特性的修改。参照上述Case 3的步骤修改。这里不在重复测试记录。
---------------------
作者:Martin201609
来源:CSDN
原文:https://blog.csdn.net/Martin201609/article/details/52557037
版权声明:本文为博主原创文章,转载请附上博文链接!
Oracle 11gR2 RAC网络配置,更改public ip、vip和scanip的更多相关文章
- Oracle 11gR2 RAC 安装配置
1. 简介 Oracle RAC,全称real application clusters,译为"实时应用集群", 是Oracle新版数据库中采用的一项新技术,是高可用性的一种, ...
- Oracle 11gR2 RAC 新特性说明
最近接触了一下Oracle 11g R2 的RAC,发现变化很大. 所以在自己动手做实验之前还是先研究下它的新特性比较好. 一. 官网介绍 先看一下Oracle 的官网文档里对RAC 新特性的一 ...
- 更改oracle RAC public ip,vip,scan ip和private ip
更改oracle RAC public ip,vip,scan ip和private ip oifcfg - Oracle 接口配置工具 用法: oifcfg iflist [-p [-n]] ...
- Linux平台 Oracle 11gR2 RAC安装Part1:准备工作
一.实施前期准备工作 1.1 服务器安装操作系统 1.2 Oracle安装介质 1.3 共享存储规划 1.4 网络规范分配 二.安装前期准备工作 2.1 各节点系统时间校对 2.2 各节点关闭防火墙和 ...
- 一步一步搭建oracle 11gR2 rac+dg之环境准备(二)【转】
一步一步在RHEL6.5+VMware Workstation 10上搭建 oracle 11gR2 rac + dg 之环境准备 (二) 一步一步搭建oracle 11gR2 rac+dg之环境准备 ...
- ORACLE 11gR2 RAC添加删除(正常及强制)节点操作步骤(删除篇)
ORACLE 11gR2 RAC添加删除(正常及强制)节点操作步骤(删除篇) 本文主要转载 [ http://www.cnxdug.org/?p=2511 ] 有部分细节自己实验添加,再此谢谢前辈. ...
- 一步一步搭建 oracle 11gR2 rac+dg之grid安装(四)【转】
一步一步在RHEL6.5+VMware Workstation 10上搭建 oracle 11gR2 rac + dg 之grid安装 (四) 转自 一步一步搭建 oracle 11gR2 rac+d ...
- 一步一步搭建oracle 11gR2 rac+dg之database安装(五)【转】
一步一步在RHEL6.5+VMware Workstation 10上搭建 oracle 11gR2 rac + dg 之database安装 (五) 转自 一步一步搭建oracle 11gR2 ...
- Linux平台 Oracle 11gR2 RAC安装Part2:GI安装
三.GI(Grid Infrastructure)安装 3.1 解压GI的安装包 3.2 安装配置Xmanager软件 3.3 共享存储LUN的赋权 3.4 使用Xmanager图形化界面安装GI 3 ...
随机推荐
- 非常详细的 (VMware安装Centos7超详细过程)
本篇文章主要介绍了VMware安装Centos7超详细过程(图文),具有一定的参考价值,感兴趣的小伙伴们可以参考一下 1.软硬件准备 软件:推荐使用VMwear,我用的是VMwear 12 镜像:Ce ...
- java之生产者和消费者问题
package testThread; public class Test3 { public static void main(String[] args) { Clerk c = new Cler ...
- swoole如何使php永久运行
有需要学习交流的友人请加入交流群的咱们一起,有问题一起交流,一起进步!前提是你是学技术的.感谢阅读! 点此加入该群jq.qq.com soole可以通过开启守护进程使PHP永久运行. 守护进程化.设 ...
- 2019年腾讯PHP程序员面试题目分享
有需要学习交流的友人请加入交流群的咱们一起,有问题一起交流,一起进步!前提是你是学技术的.感谢阅读! 点此加入该群jq.qq.com 1. php 的垃圾回收机制 PHP 可以自动进行内存管理,清除 ...
- IT兄弟连 HTML5教程 使用盒子模型设计页面布局
布局所涉及的技术非常很多,足以另写单独的一本书了.在本节中主要介绍网站中最常用的布局方案,包括区块框居中.两列浮动.三列浮动及多列浮动的区块框. 1 居中设计 区块框居中的设计是在网页布局中常用的技 ...
- IT兄弟连 HTML5教程 W3C盒子模型
日常生活中所见的盒子也就是能装东西的一种箱子,如果家里的东西很多,那么就需要按类别装到不同的箱子中.网页中的内容表现也是一样的,如果页面内容比较多,又想让页面更整洁.更美观.有很好的用户体验,则也需要 ...
- tf读取图片,matplotlib可视化
代码: """ 使用tf读取图片 """ import tensorflow as tf import matplotlib.pyplot ...
- DomDom: 1 Vulnhub Walkthrough
主机层面扫描: ╰─ nmap -p1-65535 -A -sV 10.10.202.140 You name 存在XSS 漏洞 右键源码有隐藏form表单 修改其type属性为:text 尝试了SQ ...
- 43.QT-访问远程SQLite数据库
在上章42.QT-QSqlQuery类操作SQLite数据库(创建.查询.删除.修改)详解学习了如何操作SQLite,本章来学习如何访问远程SQLite 1.首先设置共享,映射(用来实现远程访问) 将 ...
- diango使用顺序
使用顺序 settings 静态文件配置 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) #文件夹根目录 ...