OCM_Session7_1_配置/etc/hosts

一、配置/etc/hosts
 
在安装rac第一步是配置/etc/hosts文件,在OCM环境中已经配置好,我们只需要查看:cat /etc/hosts

 
 

2.7.1 IP Address Requirements

Before starting the installation, you must have the following IP addresses available for each node:

  • An IP address with an associated network name registered in the domain name service (DNS) for the public interface. If you do not have an available DNS, then record the network name and IP address in the system hosts file, /etc/hosts.

  • One virtual IP (VIP) address with an associated network name registered in DNS. If you do not have an available DNS, then record the network name and VIP address in the system hosts file, /etc/hosts. Select an address for your VIP that meets the following requirements:

    • The IP address and network name are currently unused

    • The VIP is on the same subnet as your public interface

    Before installation, check that the default gateway can be accessed by a ping command. During installation, OUI uses the ping command to ensure that the VIP is reachable. To find the default gateway, use the route command, as described in your operating system's help utility. After installation, configure clients to use either the VIP address, or the network name associated with the VIP. If a node fails, then the node's virtual IP address fails over to another node.

  • A private IP address with a host name for each private interface

    Oracle recommends that you use private network IP addresses for these interfaces (for example: 10.*.*.* or 192.168.*.*). Use the /etc/hosts file on each node to associate private network names with private IP addresses.

For example, with a two node cluster where each node has one public and one private interface, you might have the configuration shown in the following table for your network interfaces, where the hosts file is /etc/hosts:

NodeInterface NameTypeIP AddressRegistered In
rac1 rac1 Public 143.46.43.100 DNS (if available, else the hosts file)
rac1 rac1-vip Virtual 143.46.43.104 DNS (if available, else the hosts file)
rac1 rac1-priv Private 10.0.0.1 Hosts file
rac2 rac2 Public 143.46.43.101 DNS (if available, else the hosts file)
rac2 rac2-vip Virtual 143.46.43.105 DNS (if available, else the hosts file)
rac2 rac2-priv Private 10.0.0.2 Hosts file

To enable VIP failover, the configuration shown in the preceding table defines the public and VIP addresses of both nodes on the same subnet, 143.46.43. When a node or interconnect fails, then the associated VIP is relocated to the surviving instance, enabling fast notification of the failure to the clients connecting through that VIP. If the application and client are configured with transparent application failover options, then the client is reconnected to the surviving instance.

--------------------------------------------------------------------------------------------------------------------------------------------------

我的修改如下:

rac1节点修改/etc/hosts文件
---------------------------------------------------------------------------------------
[root@rac1 ~]# cp /etc/hosts /etc/hosts.bak
[root@rac1 ~]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost
::1             localhost6.localdomain6 localhost6

#node1
192.168.1.151   rac1.localdomain       rac1
192.168.1.152   rac1-vip.localdomain   rac1-vip
172.168.1.14    rac1-priv.localdomain  rac1-priv


#node2
192.168.1.153   rac2.localdomain       rac2
192.168.1.154   rac2-vip.localdomain   rac2-vip
172.168.1.15    rac2-priv.localdomain  rac2-priv
~
~
~
"/etc/hosts" 17L, 482C written
[root@rac1 ~]# 

------------------------------------------------------------------------------------
rac2节点修改/etc/hosts文件

[root@rac2 ~]# cp /etc/hosts /etc/hosts.bak
[root@rac2 ~]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost
::1             localhost6.localdomain6 localhost6

#node1
192.168.1.151   rac1.localdomain       rac1
192.168.1.152   rac1-vip.localdomain   rac1-vip
172.168.1.14    rac1-priv.localdomain  rac1-priv


#node2
192.168.1.153   rac2.localdomain       rac2
192.168.1.154   rac2-vip.localdomain   rac2-vip
172.168.1.15    rac2-priv.localdomain  rac2-priv
~
~
~
"/etc/hosts" 15L, 480C written
[root@rac2 ~]# 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值