Home Database Mysql Tutorial Oracle RAC 修改 IP 地址

Oracle RAC 修改 IP 地址

Jun 07, 2016 pm 03:50 PM
oracle rac Revise address shark

Oracle RAC 修改 IP 地址 实验对IP 地址做如下修改: Public IP 10.85.10.119/121 -- 10.85.10.219/221 Privite IP 192.168.1.119/121 -- 192.168.1.219/221 Virtual IP 10.85.10.122/123 -- 10.85.10.222/223 实验平台: redhat 4.7 + ORACLE 10G + raw +AS

Oracle RAC 修改 IP 地址

实验对IP 地址做如下修改:

Public IP 10.85.10.119/121    -- >  10.85.10.219/221

Privite IP 192.168.1.119/121   -- >  192.168.1.219/221

Virtual IP 10.85.10.122/123   -- >   10.85.10.222/223

 

实验平台: redhat 4.7 + ORACLE 10G + raw +ASM

 

一. 停止oracle相关的所有进程, 包括数据库, asm, node application, crs本身.

1.1 查看当前系统上crs运行的状态
[root@node1 bin]# pwd

/u01/app/oracle/product/crs/bin

[root@node2 bin]# ./crs_stat -t

Name           Type           Target    State     Host

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

ora....C1.inst application    ONLINE    ONLINE    node1

ora....C2.inst application    ONLINE    ONLINE    node2

ora.MYRAC.db   application    ONLINE    ONLINE    node2

ora....SM1.asm application    ONLINE    ONLINE    node1

ora....E1.lsnr application    ONLINE    ONLINE    node1

ora....E1.lsnr application    ONLINE    OFFLINE

ora.node1.gsd  application    ONLINE    ONLINE    node1

ora.node1.ons  application    ONLINE    ONLINE    node1

ora.node1.vip  application    ONLINE    ONLINE    node1

ora....SM2.asm application    ONLINE    ONLINE    node2

ora....E2.lsnr application    ONLINE    ONLINE    node2

ora....E2.lsnr application    ONLINE    OFFLINE

ora.node2.gsd  application    ONLINE    ONLINE    node2

ora.node2.ons  application    ONLINE    ONLINE    node2

ora.node2.vip  application    ONLINE    ONLINE    node2

 

1.2 关闭数据库
  [root@node1 bin]# ./srvctl stop database -d MYRAC
1.3 关闭asm实例
     [root@node1 bin]# ./srvctl stop asm -n node1

[root@node1 bin]# ./srvctl stop asm -n node2
1.4
关闭其他应用程序
    
[root@node1 bin]# ./srvctl stop nodeapps -n node1

[root@node1 bin]# ./srvctl stop nodeapps -n node2

1.5 关闭crs后台进程, 在操作系统一级中止运行的crs后台进程, 必须在所有节点上运行.
    
[root@node1 bin]# /etc/init.d/init.crs stop

Shutting down Oracle Cluster Ready Services (CRS):

Stopping resources.

Successfully stopped CRS resources

Stopping CSSD.

Shutting down CSS daemon.

Shutdown request successfully issued.

Shutdown has begun. The daemons should exit soon.


    
[root@node2 ~]# /etc/init.d/init.crs stop

Shutting down Oracle Cluster Ready Services (CRS):

Stopping resources.

Successfully stopped CRS resources

Stopping CSSD.

Shutting down CSS daemon.

Shutdown request successfully issued.

Shutdown has begun. The daemons should exit soon.

 

二 修改操作系统的ip设置

2.1 修改 /etc/hosts 文件。 保持2个节点的一致

[root@node1 bin]# vi /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1 localhost

 

10.85.10.219 node1

10.85.10.221 node2

 

192.168.1.219 node1-priv

192.168.1.221 node2-priv

 

10.85.10.222 node1-vip

10.85.10.223 node2-vip

 

2.2 在两个节点上分别修改eth0和eth1地址:

[root@node1 etc]# more /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

BOOTPROTO=static

IPADDR=10.85.10.219

NETMASK=255.255.255.0

ONBOOT=yes

GATEWAY=10.85.10.253

 

[root@node2 ~]# more /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

BOOTPROTO=static

IPADDR=10.85.10.221

NETMASK=255.255.255.0

ONBOOT=yes

GATEWAY=10.85.10.253

 

[root@node1 etc]# more /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1

BOOTPROTO=static

IPADDR=192.168.1.219

NETMASK=255.255.255.0

ONBOOT=yes

GATEWAY=192.168.1.1

 

[root@node2 ~]# more /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1

BOOTPROTO=static

IPADDR=192.168.1.221

NETMASK=255.255.255.0

ONBOOT=yes

GATEWAY=192.168.1.1

 

   2.3 在两个节点上分别重启网络服务,是修改的IP生效。

[root@node1 ~]# service network restart

[root@node2 ~]# service network restart

 

 

三. 启动crs, 设置oracle中ip地址相关的设置.
  3.1 在两个节点启动crs, 并关闭随crs启动的应用程序
         [root@node1 ~]# /etc/init.d/init.crs start

Startup will be queued to init within 90 seconds.

[root@node2 ~]#  /etc/init.d/init.crs start

Startup will be queued to init within 90 seconds.


由于oracle所有应用设置为自动启动, 所以在crs启动时会试图启动所有的服务, 但是在对oracle相关的ip地址进行设置时需要crs处于运行状态. 但是数据库, asm和node application处于停止状态, 在一个节点执行以下命令:
  [root@node1 bin]# ./srvctl stop database -d raw
   [root@node1 bin]# ./srvctl stop asm -n node1

[root@node1 bin]# ./srvctl stop asm -n node2
  
[root@node1 bin]# ./srvctl stop nodeapps -n node1

[root@node1 bin]# ./srvctl stop nodeapps -n node2

 

[root@node1 bin]# ./crs_stat -t

Name           Type           Target    State     Host

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

ora.raw.db     application    OFFLINE   OFFLINE

ora.raw.dmm.cs application    OFFLINE   OFFLINE

ora....aw2.srv application    OFFLINE   OFFLINE

ora....w1.inst application    OFFLINE   OFFLINE

ora....w2.inst application    OFFLINE   OFFLINE

ora....SM1.asm application    OFFLINE   OFFLINE

ora....W1.lsnr application    OFFLINE   OFFLINE

ora.node1.gsd   application    OFFLINE   OFFLINE

ora.node1.ons   application    OFFLINE   OFFLINE

ora.node1.vip   application    OFFLINE   OFFLINE

ora....SM2.asm application    OFFLINE   OFFLINE

ora....W2.lsnr application    OFFLINE   OFFLINE

ora.node2.gsd   application    OFFLINE   OFFLINE

ora.node2.ons   application    OFFLINE   OFFLINE

ora.node2.vip   application    OFFLINE   OFFLINE

 

3.2 使用oifcfg修改网卡设置, oifconfig可以用来设置和查看网卡使用的方式.

注: 如果修改的网段相同,可以不做这一步。

 

-- 查看当前配置:

[root@node1 bin]# ./oifcfg getif -global

eth0  10.85.10.0  global  public

eth1  192.168.1.0  global  cluster_interconnect


    
-- 删除当前配置

[root@node1 bin]# ./oifcfg delif -global eth0

[root@node1 bin]# ./oifcfg delif -global eth1

[root@node1 bin]# ./oifcfg getif

 

-- 重新添加

[root@node1 bin]# ./oifcfg setif -global eth0/10.85.10.0:public

[root@node1 bin]# ./oifcfg setif -global eth1/192.168.1.0:cluster_interconnect

[root@node1 bin]#  ./oifcfg getif

eth0  10.85.10.0  global  public

eth1  192.168.1.0  global  cluster_interconnect

  

[root@racnode2 bin]# ./oifcfg iflist

eth0  192.168.86.0

eth1  192.168.0.0

eth2  192.168.200.0

eth3  192.168.200.0

eth4  192.168.200.0

eth5  192.168.200.0

 

     注意: 这里IP 地址最一个为0.  代表的是一个网段。 修改的时候要切记。 否在在启动OCR 时 会报如下错误:

     [  CRSOCR][4054413904] OCR context init failure.  Error: PROC-44: 网络地址和网络接口操作中出错 网络地址和网络接口操作错误 [7]

     3.3 修改VIP

[root@node1 bin]# ./srvctl modify nodeapps -n node1 -A 10.85.10.222/255.255.255.0/eth0

[root@node1 bin]# ./srvctl modify nodeapps -n node2 -A 10.85.10.223/255.255.255.0/eth0

 

3.4 设置listener.ora和tnsnames.ora, 检查这些文件中是否有指定原来ip的地方, 修改为更改后的ip地址。

 

[root@node1 bin]# vi  /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora

# listener.ora.node1 Network Configuration File:

/u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora.node1

# Generated by Oracle configuration tools.

LISTENER_NODE1 =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521)(IP = FIRST))

      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.85.10.219)(PORT = 1521)(IP = FIRST))

    )

  )

注意:如果你使用了ocfs,修改ocfs配置文件(/etc/ocfs/cluster.conf),验证修改后是否可用。

 

3.5 启动node applications, asm, 数据库

[root@node1 bin]# ./srvctl start nodeapps -n node1                              

[root@node1 bin]# ./srvctl start nodeapps -n node2

[root@node1 bin]# ./srvctl start asm -n node1

[root@node1 bin]# ./srvctl start asm -n node2

[root@node1 bin]# ./srvctl start instance -d MYRAC -i node1

[root@node1 bin]# ./srvctl start instance -d MYARC -i node2

 

[root@node1 bin]# ./crs_stat -t

Name           Type           Target    State     Host

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

ora....C1.inst application    ONLINE    ONLINE    node1

ora....C2.inst application    ONLINE    ONLINE    node2

ora.MYRAC.db   application    ONLINE    ONLINE    node2

ora....SM1.asm application    ONLINE    ONLINE    node1

ora....E1.lsnr application    ONLINE    ONLINE    node1

ora....E1.lsnr application    ONLINE    OFFLINE

ora.node1.gsd  application    ONLINE    ONLINE    node1

ora.node1.ons  application    ONLINE    ONLINE    node1

ora.node1.vip  application    ONLINE    ONLINE    node1

ora....SM2.asm application    ONLINE    ONLINE    node2

ora....E2.lsnr application    ONLINE    ONLINE    node2

ora....E2.lsnr application    ONLINE    OFFLINE

ora.node2.gsd  application    ONLINE    ONLINE    node2

ora.node2.ons  application    ONLINE    ONLINE    node2

ora.node2.vip  application    ONLINE    ONLINE    node2 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How long will Oracle database logs be kept? How long will Oracle database logs be kept? May 10, 2024 am 03:27 AM

The retention period of Oracle database logs depends on the log type and configuration, including: Redo logs: determined by the maximum size configured with the "LOG_ARCHIVE_DEST" parameter. Archived redo logs: Determined by the maximum size configured by the "DB_RECOVERY_FILE_DEST_SIZE" parameter. Online redo logs: not archived, lost when the database is restarted, and the retention period is consistent with the instance running time. Audit log: Configured by the "AUDIT_TRAIL" parameter, retained for 30 days by default.

Function to calculate the number of days between two dates in oracle Function to calculate the number of days between two dates in oracle May 08, 2024 pm 07:45 PM

The function in Oracle to calculate the number of days between two dates is DATEDIFF(). The specific usage is as follows: Specify the time interval unit: interval (such as day, month, year) Specify two date values: date1 and date2DATEDIFF(interval, date1, date2) Return the difference in days

The order of the oracle database startup steps is The order of the oracle database startup steps is May 10, 2024 am 01:48 AM

The Oracle database startup sequence is: 1. Check the preconditions; 2. Start the listener; 3. Start the database instance; 4. Wait for the database to open; 5. Connect to the database; 6. Verify the database status; 7. Enable the service (if necessary ); 8. Test the connection.

How to use interval in oracle How to use interval in oracle May 08, 2024 pm 07:54 PM

The INTERVAL data type in Oracle is used to represent time intervals. The syntax is INTERVAL <precision> <unit>. You can use addition, subtraction, multiplication and division operations to operate INTERVAL, which is suitable for scenarios such as storing time data and calculating date differences.

How much memory does oracle require? How much memory does oracle require? May 10, 2024 am 04:12 AM

The amount of memory required by Oracle depends on database size, activity level, and required performance level: for storing data buffers, index buffers, executing SQL statements, and managing the data dictionary cache. The exact amount is affected by database size, activity level, and required performance level. Best practices include setting the appropriate SGA size, sizing SGA components, using AMM, and monitoring memory usage.

How to see the number of occurrences of a certain character in Oracle How to see the number of occurrences of a certain character in Oracle May 09, 2024 pm 09:33 PM

To find the number of occurrences of a character in Oracle, perform the following steps: Get the total length of a string; Get the length of the substring in which a character occurs; Count the number of occurrences of a character by subtracting the substring length from the total length.

How to replace string in oracle How to replace string in oracle May 08, 2024 pm 07:24 PM

The method of replacing strings in Oracle is to use the REPLACE function. The syntax of this function is: REPLACE(string, search_string, replace_string). Usage steps: 1. Identify the substring to be replaced; 2. Determine the new string to replace the substring; 3. Use the REPLACE function to replace. Advanced usage includes: multiple replacements, case sensitivity, special character replacement, etc.

Oracle database server hardware configuration requirements Oracle database server hardware configuration requirements May 10, 2024 am 04:00 AM

Oracle database server hardware configuration requirements: Processor: multi-core, with a main frequency of at least 2.5 GHz. For large databases, 32 cores or more are recommended. Memory: At least 8GB for small databases, 16-64GB for medium sizes, up to 512GB or more for large databases or heavy workloads. Storage: SSD or NVMe disks, RAID arrays for redundancy and performance. Network: High-speed network (10GbE or higher), dedicated network card, low-latency network. Others: Stable power supply, redundant components, compatible operating system and software, heat dissipation and cooling system.

See all articles