中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

怎么修改linux中rac上IP地址

發布時間:2021-11-05 11:25:33 來源:億速云 閱讀:155 作者:iii 欄目:關系型數據庫

本篇內容主要講解“怎么修改linux中rac上IP地址”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“怎么修改linux中rac上IP地址”吧!

修改前IP:

#####PUBLIC IP #####

192.168.11.100 db1

192.168.11.200 db2

##### VIP #####

192.168.11.111 db1_vip

192.168.11.222 db2_vip

#####SCAN IP #####

192.168.11.101 scanip

修改后IP:

#####PUBLIC IP #####

192.168.57.100 db1

192.168.57.200 db2

##### VIP #####

192.168.57.111 db1_vip

192.168.57.222 db2_vip

#####SCAN IP #####

192.168.57.101 scanip

修改網段11..改成57..

一準備

1 關閉數據庫

[grid@db1 ~]$ srvctl status database -d orcl
Instance orcl1 is running on node db1
Instance orcl2 is running on node db2
[grid@db1 ~]$ srvctl stop database -d orcl
[grid@db1 ~]$ srvctl status database -d orcl
Instance orcl1 is not running on node db1
Instance orcl2 is not running on node db2

2 查看原scan的信息

[grid@db1 ~]$ srvctl config scan
SCAN name: scanip, Network: 1/192.168.11.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /scanip/192.168.11.101
[grid@db1 ~]$ srvctl config listener
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
End points: TCP:1521

3 關閉listener、crs

[grid@db1 ~]$ srvctl stop listener
[grid@db1 ~]$ crsctl stop crs -f
CRS-4563: Insufficient user privileges.

CRS-4000: Command Stop failed, or completed with errors.
[grid@db1 ~]$ su root
Password:
[root@db1 grid]# crsctl stop crs -f

[root@db2 grid]# crsctl stop crs -f

4 修改/etc/hosts(兩個節點)

[root@db1 ~]# vi /etc/hosts

#####PUBLIC IP #####
192.168.57.100 db1
192.168.57.200 db2

5 修改os網卡信息(兩個節點)

vi /etc/sysconfig/network-scripts/ifcfg-eth0

service network restart

然后在虛擬機上重新配置網卡連接方式,(在宿主機上新建立一個虛擬網卡虛擬機橋接在該網卡上)

6 啟動crs(兩個節點)

[root@db1 grid]# crsctl start crs
CRS-4123: Oracle High Availability Services has been started.

[root@db2 grid]# crsctl start crs
CRS-4123: Oracle High Availability Services has been started.

1 修改public ip

--節點1

1 查看信息(原)

[root@db1 grid]# oifcfg getif
eth2  10.0.0.0  global  cluster_interconnect
eth0  192.168.11.0  global  public

2 刪除原ip

[root@db1 grid]# oifcfg delif -global eth0/192.168.11.0

3 注冊新ip

[root@db1 grid]# oifcfg setif -global eth0/192.168.57.0:public

4 驗證

[root@db1 grid]# oifcfg getif
eth2  10.0.0.0  global  cluster_interconnect
eth0  192.168.57.0  global  public

--節點2

[root@db2 grid]#  oifcfg getif
eth2  10.0.0.0  global  cluster_interconnect
eth0  192.168.57.0  global  public                    --網段已經改過來了。我感覺已經不用刪除,再添加了

[root@db2 grid]# oifcfg delif -global eth0/192.168.11.0
[root@db2 grid]# oifcfg setif -global eth0/192.168.57.0:public
[root@db2 grid]# oifcfg getif
eth2  10.0.0.0  global  cluster_interconnect
eth0  192.168.57.0  global  public

2 修改vip 

1 查看vip配置

[root@db2 admin]# srvctl config nodeapps -a
Network exists: 1/192.168.11.0/255.255.255.0/eth0, type static
VIP exists: /db1_vip/192.168.11.111/192.168.11.0/255.255.255.0/eth0, hosting node db1
VIP exists: /db2_vip/192.168.11.222/192.168.11.0/255.255.255.0/eth0, hosting node db2

2 停實例和vip

[root@db1 grid]# srvctl stop instance -d rac -n db1
[root@db1 grid]# srvctl stop vip -n db1 -f

[root@db2 grid]# srvctl stop instance -d rac -n db2
[root@db2 grid]# srvctl stop vip -n db2 -f

3 修改hosts文件(root兩個節點)

vi /etc/hosts

##### VIP #####

192.168.57.111 db1_vip

192.168.57.222 db2_vip

4 修改vip的配置

--節點1

[root@db1 grid]# /grid/11.2.0/grid/bin/srvctl modify nodeapps -n db2 -A 192.168.57.111/255.255.255.0/eth0

--節點2

[root@db2 grid]# /grid/11.2.0/grid/bin/srvctl modify nodeapps -n db2 -A 192.168.57.222/255.255.255.0/eth0

5 啟動

--節點1

[root@db1 grid]# srvctl start vip -n db1
PRKO-2420 : VIP is already started on node(s): db1
[root@db1 grid]# srvctl start listener -n db1
[root@db1 grid]# srvctl start instance -d rac -n db1

--節點2

[root@db2 grid]# srvctl start vip -n db2
[root@db2 grid]# srvctl start listener -n db2
[root@db2 grid]# srvctl start instance -d rac -n db2

6 驗證

[root@db2 grid]# srvctl config nodeapps -a
Network exists: 1/192.168.57.0/255.255.255.0/eth0, type static
VIP exists: /db1_vip/192.168.57.111/192.168.57.0/255.255.255.0/eth0, hosting node db1
VIP exists: /192.168.57.222/192.168.57.222/192.168.57.0/255.255.255.0/eth0, hosting node db2

不知道什么原因,這里vip的名字不出現,也不太影響

3 修改scan ip(單節點執行)

1停止scan服務和scan

[root@db1 grid]# srvctl stop scan_listener
[root@db1 grid]# srvctl stop scan  

2 修改host文件

vi /etc/hosts

#####SCAN IP #####

192.168.57.101 scanip

3  修改scan配置(root)  
[root@db1 grid]# srvctl modify scan -n scanip              --這里是自己hosts解析的scanip的名字

4  修改scan listener配置

[root@db1 grid]# srvctl modify scan_listener -u

5 啟動

[root@db1 grid]# srvctl start scan_listener

6 啟動數據庫

[root@db1 grid]# srvctl start database -d orcl

7 驗證

[root@db1 grid]# srvctl config scan
SCAN name: scanip, Network: 1/192.168.57.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /scanip/192.168.57.101

--查看集群資源

[root@db1 grid]# crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       db1                                          
               ONLINE  ONLINE       db2                                          
ora.gsd
               OFFLINE OFFLINE      db1                                          
               OFFLINE OFFLINE      db2                                          
ora.net1.network
               ONLINE  ONLINE       db1                                          
               ONLINE  ONLINE       db2                                          
ora.ons
               ONLINE  ONLINE       db1                                          
               ONLINE  ONLINE       db2                                          
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       db2                                          
ora.db1.vip
      1        ONLINE  ONLINE       db1                                          
ora.db2.vip
      1        ONLINE  ONLINE       db2                                          
ora.orcl.db
      1        ONLINE  ONLINE       db1                      Open                
      2        ONLINE  ONLINE       db2                      Open                
ora.scan1.vip
      1        ONLINE  ONLINE       db2 

知識補充:

--添加scan

[root@db1 grid]# srvctl add scan scanip

--添加實例

$ srvctl add instance -d orcl -i orcl1 -n db1

$ srvctl add instance -d orcl -i orcl2 -n db2

srvctl start instance -d orcl -n db1

srvctl start instance -d orcl -n db2

--添加database

  srvctl add database -d orcl -o /oracle/home -p +DATA/orcl/spfileorcl.ora

srvctl start database -d orcl

--添加本地監聽

srvctl add listener -l listener

crsctl start resource ora.LISTENER.lsnr

--添加scan資源

srvctl add scan -n scanip

srvctl start scan

到此,相信大家對“怎么修改linux中rac上IP地址”有了更深的了解,不妨來實際操作一番吧!這里是億速云網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

阜城县| 吴旗县| 申扎县| 德阳市| 五家渠市| 靖安县| 普安县| 吴旗县| 长武县| 玉溪市| 名山县| 渝北区| 红原县| 鄂托克旗| 和平区| 积石山| 汝州市| 合江县| 滁州市| 金湖县| 靖西县| 屏边| 高唐县| 湖南省| 岐山县| 宕昌县| 金湖县| 内乡县| 张家界市| 综艺| 昌江| 阜城县| 平陆县| 灵璧县| 朝阳市| 磐安县| 古蔺县| 苍溪县| 信宜市| 禹城市| 吴忠市|