Redhat 7.5 Oracle 11g RAC ASM+裸設(shè)備 安裝小記

Redhat 7.5 Oracle 11g RAC ASM+裸設(shè)備 安裝小記

一腔呜、安裝環(huán)境
??1、簡(jiǎn)介
??2江掩、規(guī)劃
二学辱、外部環(huán)境準(zhǔn)備
??1、系統(tǒng)安裝
??2环形、硬件策泣、源和時(shí)間
??3、iscsi 服務(wù)器配置
??4抬吟、DNS 服務(wù)器配置
三萨咕、安裝環(huán)境準(zhǔn)備
??1、DNS客戶端
??2火本、iSCSI 客戶端
??3危队、裸設(shè)備配置
??4、創(chuàng)建用戶&用戶組
??5钙畔、ssh 免密登錄配置
??6茫陆、依賴包安裝
??7、用戶環(huán)境變量設(shè)置.bash_profile
??8擎析、系統(tǒng)參數(shù)
四簿盅、安裝事項(xiàng)
??1、集群測(cè)試
??2揍魂、oracle cluster 安裝
??3桨醋、Oracle 程序安裝
五、經(jīng)典問(wèn)題
??1现斋、RHEL 7 及以后系統(tǒng)版本 圖形化安裝過(guò)程中彈出框是一個(gè)小豎條喜最,且無(wú)法放大的問(wèn)題
??2、cluster 腳本報(bào)錯(cuò):Failed to create keys in the OLR, rc = 127 libcap.so.1
??3步责、cluster 腳本報(bào)錯(cuò):ohasd failed to start
??4返顺、asmca 圖形化管理界面中彈出框是一個(gè)小豎條

安裝感受:
??復(fù)雜~~

一、安裝環(huán)境

1蔓肯、簡(jiǎn)介

??本次安裝環(huán)境是 VMware&VSphere 6.0 環(huán)境的兩臺(tái)虛擬機(jī)遂鹊。(并不是很熟悉這套虛擬化產(chǎn)品,所以中間趟了很多雷蔗包。)
??RAC安裝系統(tǒng)為 Redhat 7.5 秉扑。(對(duì)于安裝 11g 來(lái)說(shuō)不是最佳的兼容系統(tǒng),中間會(huì)出現(xiàn)很多不可預(yù)估的錯(cuò)誤及警告)
??共享存儲(chǔ):由于沒(méi)有外置存儲(chǔ),且虛擬化環(huán)境的存儲(chǔ)共享問(wèn)題出于個(gè)人能力問(wèn)題實(shí)在解決不了舟陆,最后又創(chuàng)建了一臺(tái)虛擬機(jī)用于做 SCSI 共享和 DNS 解析误澳。(這么做實(shí)屬無(wú)奈之舉,個(gè)中辛酸不足為外人道也)

2秦躯、規(guī)劃

NODE 資源 ip 規(guī)劃 備注
1 CPU:2 Core<br />RAM:4 GB <br />DISK: 60 GB 192.168.0.101<br />192.168.0.103<br />192.168.1.11 whdatarac1<br />whdatarac1-vip<br />whdatarac1-priv <br />虛擬地址<br />心跳地址
2 CPU:2 Core<br />RAM:4 GB <br />DISK: 60 GB 192.168.0.102<br />192.168.0.104<br />192.168.1.12 whdatarac2<br />whdatarac2-vip<br />whdatarac2-priv <br />虛擬地址<br />心跳地址
3 CPU:1 Core<br />RAM:1 GB <br />DISK1: 20 GB<br />DISK2: 30 GB<br />DISK3: 20 GB<br />DISK4: 20 GB<br />DISK2: 30 GB 192.168.0.109 iscsi <br />SCSIDNS 服務(wù)器<br /><br />shared1<br />shared2<br />shared3<br />shared4

二忆谓、外部環(huán)境準(zhǔn)備

1、系統(tǒng)安裝

NODE 主機(jī)名 系統(tǒng)安裝 說(shuō)明
1 whdatarac1 Development Tools<br />GUI 關(guān)閉kdump
2 whdatarac2 Development Tools<br />GUI 關(guān)閉kdump
3 iscsi 最簡(jiǎn)安裝 關(guān)閉kdump

2踱承、硬件倡缠、源和時(shí)間

  1. RAC 節(jié)點(diǎn)各需要兩塊網(wǎng)卡,一塊用來(lái)做普通地址茎活,另一塊用來(lái)作心跳地址昙沦。
    ?誤區(qū):VIP 不需要綁定到單獨(dú)的網(wǎng)卡
  2. VSphere 模擬的網(wǎng)絡(luò)環(huán)境是一個(gè)交換機(jī),只需要單獨(dú)劃分 VLAN 即可载荔。
    ?誤區(qū):單獨(dú)劃分 VLAN 直接配置和原始網(wǎng)段不同的地址
  3. Redhat 系統(tǒng)的在線源替換為相應(yīng)版本的 CentOS 系統(tǒng)源盾饮。
  4. RHEL 7 中使用 timedatectl 控制時(shí)間同步,執(zhí)行 timedatectl set-timezone UTC 否則系統(tǒng)時(shí)間和北京時(shí)間差8小時(shí)懒熙。
  5. 關(guān)閉防火墻和 SElinux丘损。

3、iscsi 服務(wù)器配置

??安裝服務(wù)組件: yum -y install targetd targetcli
??設(shè)置服務(wù)組件啟動(dòng)及開(kāi)機(jī)自啟:

systemctl start targetd  
systemctl enable targetd  

??在圖形化交互界面創(chuàng)建需要分享的硬盤或者分區(qū):

# 如下所示:將 /dev/sdb 以 iscsi1 的名稱共享:
[user@nnn ~]# targetcli
Warning: Could not load preferences file /root/.targetcli/prefs.bin.
targetcli shell version 2.1.fb34
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.
/> ls
o- / ................................................................................................. [...]
o- backstores ........................................................................................ [...]
| o- block ............................................................................ [Storage Objects: 0]
| o- fileio ........................................................................... [Storage Objects: 0]
| o- pscsi ............................................................................ [Storage Objects: 0]
| o- ramdisk .......................................................................... [Storage Objects: 0]
o- iscsi ...................................................................................... [Targets: 0]
o- loopback ................................................................................... [Targets: 0
/> cd /backstores/block
/backstores/block> create iscsi1 /dev/sdb
Created block storage object iscsi1 using /dev/sdb.
/backstores/block>ls
/> ls
o- / ................................................................................................. [...]
  o- backstores ...................................................................................... [...]
  | o- block .......................................................................... [Storage Objects: 4]
  | | o- scsi1 ................................................... [/dev/sdb (30.0GiB) write-thru activated]
  | | | o- alua ........................................................................... [ALUA Groups: 1]
  | | |   o- default_tg_pt_gp ............................................... [ALUA state: Active/optimized]
  | | o- scsi2 ................................................... [/dev/sdc (30.0GiB) write-thru activated]
  | | | o- alua ........................................................................... [ALUA Groups: 1]
  | | |   o- default_tg_pt_gp ............................................... [ALUA state: Active/optimized]
  | | o- scsi3 ................................................... [/dev/sdd (20.0GiB) write-thru activated]
  | | | o- alua ........................................................................... [ALUA Groups: 1]
  | | |   o- default_tg_pt_gp ............................................... [ALUA state: Active/optimized]
  | | o- scsi4 ................................................... [/dev/sde (20.0GiB) write-thru activated]
  | |   o- alua ........................................................................... [ALUA Groups: 1]
  | |     o- default_tg_pt_gp ............................................... [ALUA state: Active/optimized]
  | o- fileio ......................................................................... [Storage Objects: 0]
  | o- pscsi .......................................................................... [Storage Objects: 0]
  | o- ramdisk ........................................................................ [Storage Objects: 0]
  o- iscsi .................................................................................... [Targets: 0]
  o- loopback ................................................................................. [Targets: 0]

??創(chuàng)建iSCSI target名稱煌珊,進(jìn)入到 /iscsi 目錄下号俐,執(zhí)行 create 命令,會(huì)自動(dòng)創(chuàng)建 iqn 開(kāi)頭的 iscsi 共享項(xiàng)目:

/> cd /iscsi 
/iscsi> create
Created target iqn.2003-01.org.linux-iscsi.scsi.x8664:sn.7e2a0b039f3e
Created TPG 1.

??其次定庵,分別在該項(xiàng)目的 tgp1 目錄下的 acl吏饿、lunsportals 目錄下創(chuàng)建客戶端連接名、共享的luns和共享地址及端口:
??創(chuàng)建共享IP和端口有可能不成功蔬浙,ls 看一下猪落,有可能已經(jīng)存在相應(yīng)的端口和地址了,deelete 刪除即可

創(chuàng)建 luns:
/iscsi> cd iqn.2003-01.org.linux-iscsi.scsi.x8664:sn.7e2a0b039f3e/
/iscsi/iqn.20....d497c356ad80> cd tpg1/luns
/iscsi/iqn.20...d80/tpg1/luns> create /backstores/block/iscsi1 
Created LUN 0.
/iscsi/iqn.20...d80/tpg1/luns> create /backstores/block/iscsi2 
Created LUN 1.
/iscsi/iqn.20...d80/tpg1/luns> create /backstores/block/iscsi3 
Created LUN 2.
/iscsi/iqn.20...d80/tpg1/luns> create /backstores/block/iscsi4 
Created LUN 3.
創(chuàng)建客戶端連接名:
/iscsi/iqn.20...d80/tpg1/luns> cd ..
/iscsi/iqn.20...d80/tpg1> cd acl
/iscsi/iqn.20...d80/tpg1/acl> create iqn.2003-01.org.linux-iscsi.scsi.x8664:sn.7e2a0b039f3e
Created Node ACL for iqn.2003-01.org.linux-iscsi.scsi.x8664:sn.7e2a0b039f3e
創(chuàng)建連接IP及端口:
/iscsi/iqn.20...d80/tpg1/acls> cd ..
/iscsi/iqn.20...c356ad80/tpg1> cd portals 
/iscsi/iqn.20.../tpg1/portals> create 192.168.0.109
Using default IP port 3260
Created network portal 192.168.0.109:3260.

??查看一下配置結(jié)果:

/iscsi/iqn.20...0b039f3e/tpg1> cd /
/> ls
o- / ................................................................................................. [...]
  o- backstores ...................................................................................... [...]
  | o- block .......................................................................... [Storage Objects: 4]
  | | o- scsi1 ................................................... [/dev/sdb (30.0GiB) write-thru activated]
  | | | o- alua ........................................................................... [ALUA Groups: 1]
  | | |   o- default_tg_pt_gp ............................................... [ALUA state: Active/optimized]
  | | o- scsi2 ................................................... [/dev/sdc (30.0GiB) write-thru activated]
  | | | o- alua ........................................................................... [ALUA Groups: 1]
  | | |   o- default_tg_pt_gp ............................................... [ALUA state: Active/optimized]
  | | o- scsi3 ................................................... [/dev/sdd (20.0GiB) write-thru activated]
  | | | o- alua ........................................................................... [ALUA Groups: 1]
  | | |   o- default_tg_pt_gp ............................................... [ALUA state: Active/optimized]
  | | o- scsi4 ................................................... [/dev/sde (20.0GiB) write-thru activated]
  | |   o- alua ........................................................................... [ALUA Groups: 1]
  | |     o- default_tg_pt_gp ............................................... [ALUA state: Active/optimized]
  | o- fileio ......................................................................... [Storage Objects: 0]
  | o- pscsi .......................................................................... [Storage Objects: 0]
  | o- ramdisk ........................................................................ [Storage Objects: 0]
  o- iscsi .................................................................................... [Targets: 1]
  | o- iqn.2003-01.org.linux-iscsi.scsi.x8664:sn.7e2a0b039f3e .................................... [TPGs: 1]
  |   o- tpg1 ....................................................................... [no-gen-acls, no-auth]
  |     o- acls .................................................................................. [ACLs: 1]
  |     | o- iqn.2003-01.org.linux-iscsi.scsi.x8664:sn.7e2a0b039f3e ....................... [Mapped LUNs: 4]
  |     |   o- mapped_lun0 ......................................................... [lun0 block/scsi1 (rw)]
  |     |   o- mapped_lun1 ......................................................... [lun1 block/scsi2 (rw)]
  |     |   o- mapped_lun2 ......................................................... [lun2 block/scsi3 (rw)]
  |     |   o- mapped_lun3 ......................................................... [lun3 block/scsi4 (rw)]
  |     o- luns .................................................................................. [LUNs: 4]
  |     | o- lun0 .............................................. [block/scsi1 (/dev/sdb) (default_tg_pt_gp)]
  |     | o- lun1 .............................................. [block/scsi2 (/dev/sdc) (default_tg_pt_gp)]
  |     | o- lun2 .............................................. [block/scsi3 (/dev/sdd) (default_tg_pt_gp)]
  |     | o- lun3 .............................................. [block/scsi4 (/dev/sde) (default_tg_pt_gp)]
  |     o- portals ............................................................................ [Portals: 1]
  |       o- 192.168.0.109:3260 ....................................................................... [OK]
  o- loopback ................................................................................. [Targets: 0]
/> 

4畴博、DNS 服務(wù)器配置

??安裝服務(wù)組件:yum install bind-libs bind bind-utils
??設(shè)置服務(wù)組件啟動(dòng)及開(kāi)機(jī)自啟:

systemctl start named  
systemctl enable named  

??編輯 /etc/named.conf 文件:

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// See the BIND Administrator's Reference Manual (ARM) for details about the
// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html

options {
    listen-on port 53 { any; };  --將127.0.0.1修改成any
    listen-on-v6 port 53 { ::1; };
    directory   "/var/named";
    dump-file   "/var/named/data/cache_dump.db";
    statistics-file "/var/named/data/named_stats.txt";
    memstatistics-file "/var/named/data/named_mem_stats.txt";
    allow-query     { any; };  --將127.0.0.1修改成any

    /* 
     - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
     - If you are building a RECURSIVE (caching) DNS server, you need to enable 
       recursion. 
     - If your recursive DNS server has a public IP address, you MUST enable access 
       control to limit queries to your legitimate users. Failing to do so will
       cause your server to become part of large scale DNS amplification 
       attacks. Implementing BCP38 within your network would greatly
       reduce such attack surface 
    */
    recursion yes;

    dnssec-enable yes;
    dnssec-validation yes;

    /* Path to ISC DLV key */
    bindkeys-file "/etc/named.iscdlv.key";

    managed-keys-directory "/var/named/dynamic";

    pid-file "/run/named/named.pid";
    session-keyfile "/run/named/session.key";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
    type hint;
    file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

??修改 /etc/host.conf 文件:

order bind,hosts    # 指定主機(jī)名查詢順序笨忌,這里規(guī)定先使用DNS來(lái)解析域名,然后再查詢“/etc/hosts”文件(也可以相反)俱病。
multi on    # 指定是否“/etc/hosts”文件中指定的主機(jī)可以有多個(gè)地址官疲,擁有多個(gè)IP地址的主機(jī)一般稱為多穴主機(jī)。
nospoof on    # 指不允許對(duì)該服務(wù)器進(jìn)行IP地址欺騙亮隙。IP欺騙是一種攻擊系統(tǒng)的手段途凫,把IP地址偽裝成別的計(jì)算機(jī),來(lái)取得其它計(jì)算機(jī)的信任溢吻。

??修改 /etc/named.rfc1912.zones 文件:

// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package 
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt
// (c)2007 R W Franks
// 
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

zone "localhost.localdomain" IN {
    type master;
    file "named.localhost";
    allow-update { none; };
};

zone "localhost" IN {
    type master;
    file "named.localhost";
    allow-update { none; };
};

zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
    type master;
    file "named.loopback";
    allow-update { none; };
};

zone "1.0.0.127.in-addr.arpa" IN {
    type master;
    file "named.loopback";
    allow-update { none; };
};

zone "0.in-addr.arpa" IN {
    type master;
    file "named.empty";
    allow-update { none; };
};

zone "localdomain." IN {
        type master;
        file "localdomain.zone";
        allow-update { none; };
};

// 添加內(nèi)容:(由于虛擬ip和心跳地址同在192.168.0.0/16網(wǎng)段维费,所以反向解析內(nèi)容使用了16位地址,也可以使用24位地址)

zone "whdata-rac.com" IN {
        type master;
        file "whdata-rac.com.zone";
        allow-update { none; };
};

zone "168.192.in-addr.arpa" IN {
        type master;
        file "168.192.zone";
        allow-update { none; };
};

??在 /var/named/ 目錄下分別創(chuàng)建正向解析文件和反向解析文件(名稱要和上段規(guī)則中的正反向解析zone名稱相同)
??注意:創(chuàng)建文件的所屬用戶用戶組及操作權(quán)限,用戶:root 用戶組:named 權(quán)限:644
??正向解析 whdata-rac.com.zone

$TTL 1D
@   IN SOA  @ rname.invalid. (
                    0   ; serial
                    1D  ; refresh
                    1H  ; retry
                    1W  ; expire
                    3H )    ; minimum
    NS  @
    A   127.0.0.1
    AAAA    ::1

iscsi        IN     A       192.168.0.109
whdatarac-scan   IN     A       192.168.0.105
whdatarac-scan   IN     A       192.168.0.106
whdatarac-scan   IN     A       192.168.0.107
whdatarac1       IN     A       192.168.0.101
whdatarac2       IN     A       192.168.0.102
whdatarac1-vip   IN     A       192.168.0.103
whdatarac2-vip   IN     A       192.168.0.104
whdatarac1-priv  IN     A       192.168.1.11
whdatarac2-priv  IN     A       192.168.1.12

??反向解析 168.192.zone

$TTL 1D
@   IN SOA  @ rname.invalid. (
                    0   ; serial
                    1D  ; refresh
                    1H  ; retry
                    1W  ; expire
                    3H )    ; minimum
    NS  @
    A   127.0.0.1
    AAAA    ::1
    PTR localhost.

109.0    IN      PTR    iscsi.whdata-rac.com.
105.0    IN      PTR    whdatarac-scan.whdata-rac.com.
106.0    IN      PTR    whdatarac-scan.whdata-rac.com.
107.0    IN      PTR    whdatarac-scan.whdata-rac.com.
101.0    IN      PTR    whdatarac1.whdata-rac.com.
102.0    IN      PTR    whdatarac2.whdata-rac.com.
103.0    IN      PTR    whdatarac1-vip.whdata-rac.com.
104.0    IN      PTR    whdatarac2-vip.whdata-rac.com.
11.1     IN      PTR    whdatarac1-priv.whdata-rac.com.
12.1     IN      PTR    whdatarac2-priv.whdata-rac.com

??修改 /etc/resolv.conf 文件:
??該文件每次重啟網(wǎng)卡或者主機(jī)重啟都會(huì)覆蓋原有內(nèi)容犀盟,可通過(guò) chattr +i /etc/resolv.conf 防止內(nèi)容被覆蓋而晒,但是 oracle cluster 安裝檢測(cè)會(huì)報(bào)找不到相應(yīng)節(jié)點(diǎn)的網(wǎng)絡(luò)錯(cuò)誤。
??很多帖子說(shuō)可以通過(guò)修改網(wǎng)卡配置文件來(lái)達(dá)到永久生效的目的, 修改/etc/sysconfig/network-scripts/ifcfg-* 文件阅畴,添加:DOMAIN=whdata-rac.com 倡怎。但測(cè)試無(wú)法生效。

# Generated by NetworkManager
search whdata-rac.com
nameserver 192.168.0.109
nameserver 202.*.*.*

??將DNS設(shè)置為 192.168.0.109 恶阴,重啟DNS服務(wù)并且在 DNS 服務(wù)器測(cè)試:

systemctl restart  named.service
dig -x 192.168.0.109
nslookup whdatarac-sacn
nslookup 192.168.0.102

三诈胜、安裝環(huán)境準(zhǔn)備

??以下準(zhǔn)備工作要在 oracle 兩個(gè)節(jié)點(diǎn)執(zhí)行

1豹障、創(chuàng)建用戶&用戶組

groupadd -g 1000 oinstall
groupadd -g 1001 asmadmin
groupadd -g 1002 asmdba
groupadd -g 1003 asmoper
groupadd -g 1004 dba
groupadd -g 1005 oper
useradd -u 1000 -g oinstall -G wheel,asmadmin,asmdba,asmoper,oper,dba grid
useradd -u 1001 -g oinstall -G wheel,dba,asmdba,oper oracle
echo "whdata" | passwd --stdin grid 
echo "whdata" | passwd --stdin oracle 

2冯事、DNS客戶端

??a. 修改 /etc/hosts 文件,此步非必要,可以不執(zhí)行

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

#DNS&iscsi
192.168.0.109 iscsi iscsi.whdata-rac.com
# Public
192.168.0.101 whdatarac1 whdatarac1.whdata-rac.com
192.168.0.102 whdatarac2 whdatarac2.whdata-rac.com
# Private
192.168.1.11 whdatarac1-priv whdatarac1-priv.whdata-rac.com
192.168.1.12 whdatarac2-priv whdatarac2-priv.whdata-rac.com
# Virtual
192.168.0.103 whdatarac1-vip whdatarac1-vip.whdata-rac.com
192.168.0.104 whdatarac2-vip whdatarac2-vip.whdata-rac.com
# SCAN
192.168.0.105 whdatarac-scan whdatarac-scan.whdata-rac.com
192.168.0.106 whdatarac-scan whdatarac-scan.whdata-rac.com
192.168.0.107 whdatarac-scan whdatarac-scan.whdata-rac.com

??b. 修改 /etc/resolv.conf 文件在 DNS 前加入 search whdata-rac.com 血公。
??c. 使用 nslookup 命令測(cè)試昵仅,生效。

3累魔、iSCSI 客戶端

??安裝 iscsi 客戶端:yum install iscsi-initiator-utils
??配置客戶端連接名:

[root@whdatarac1 ~]# vi /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2003-01.org.linux-iscsi.scsi.x8664:sn.7e2a0b039f3e

??啟動(dòng)iscsi客戶端摔笤,并設(shè)置開(kāi)機(jī)自啟

[root@whdatarac1 ~]# systemctl restart iscsid
[root@whdatarac1 ~]# systemctl enable iscsid

??通過(guò) iscsiadm 管理工具掃描遠(yuǎn)程iSCSI服務(wù)端,然后查看找到的服務(wù)端上有哪些可用的共享存儲(chǔ)資源垦写。
??-m discovery 參數(shù)的目的是掃描并發(fā)現(xiàn)可用的存儲(chǔ)資源吕世。
??-t st 參數(shù)為執(zhí)行掃描操作的類型,
??-p 192.168.0.109 參數(shù)為iSCSI服務(wù)端的IP地址:

[root@whdatarac1 ~]# iscsiadm -m discovery -t st -p 192.168.0.109
192.168.0.109:3260,1 iqn.2003-01.org.linux-iscsi.scsi.x8664:sn.7e2a0b039f3e

??登錄 iSCSI 服務(wù)端:
??-m node 參數(shù)為將客戶端所在主機(jī)作為一臺(tái)節(jié)點(diǎn)服務(wù)器梯投。
??-T iqn.2003-01.org.linux-iscsi.scsi.x8664:sn.7e2a0b039f3e 參數(shù)為要使用的存儲(chǔ)資源(也就是上面的輸出結(jié)果)
??-p 192.168.0.109 參數(shù)依然為對(duì)方iSCSI服務(wù)端的IP地址命辖。
??--login-l 參數(shù)進(jìn)行登錄驗(yàn)證。

[root@whdatarac1 ~]# iscsiadm -m node -T iqn.2003-01.org.linux-iscsi.scsi.x8664:sn.7e2a0b039f3e -p 192.168.0.109 -l
Logging in to [iface: default, target: iqn.2003-01.org.linux-iscsi.scsi.x8664:sn.7e2a0b039f3e, portal: 192.168.0.109,3260] (multiple)
Login to [iface: default, target: iqn.2003-01.org.linux-iscsi.scsi.x8664:sn.7e2a0b039f3e, portal: 192.168.0.109,3260] successful.

??然后查看分蓖,四塊硬盤已經(jīng)成功掛載:

[root@whdatarac1 ~]# lsblk
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda             8:0    0   60G  0 disk 
├─sda1          8:1    0  500M  0 part /boot
└─sda2          8:2    0 59.5G  0 part 
  ├─rhel-root 253:0    0 51.5G  0 lvm  /
  └─rhel-swap 253:1    0    8G  0 lvm  [SWAP]
sdb             8:16   0   30G  0 disk 
sdc             8:32   0   20G  0 disk 
sdd             8:48   0   20G  0 disk 
sde             8:64   0   30G  0 disk 

4尔艇、裸設(shè)備配置

??a. 修改規(guī)則文件

??vi /usr/lib/udev/rules.d/rules.d/60-raw.rules
??添加如下內(nèi)容:

ACTION=="add", KERNEL=="sdb", RUN+="/usr/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdc", RUN+="/usr/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdd", RUN+="/usr/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sde", RUN+="/usr/bin/raw /dev/raw/raw4 %N"
KERNEL=="raw1", OWNER="grid" GROUP="asmadmin", MODE="0660"
KERNEL=="raw2", OWNER="grid" GROUP="asmadmin", MODE="0660"
KERNEL=="raw3", OWNER="grid" GROUP="asmadmin", MODE="0660"
KERNEL=="raw4", OWNER="grid" GROUP="asmadmin", MODE="0660"

??b. 重啟主機(jī)或者重新載入規(guī)則文件

??udevadm control --reload-rules

??c. 檢查設(shè)備

[root@whdatarac1 ~]# ls -al /dev/raw/
total 0
drwxr-xr-x  2 root root        140 Dec 26 09:45 .
drwxr-xr-x 20 root root       3380 Dec 26 09:45 ..
crw-rw----  1 grid asmadmin 162, 1 Dec 28 12:04 raw1
crw-rw----  1 grid asmadmin 162, 2 Dec 26 09:45 raw2
crw-rw----  1 grid asmadmin 162, 3 Dec 28 12:04 raw3
crw-rw----  1 grid asmadmin 162, 4 Dec 28 12:04 raw4

5、ssh 免密登錄配置

??a. 分別配置雙節(jié)點(diǎn) grid 用戶和 oracle 用戶間 ssh 免密登錄么鹤。

ssh-keygen
cd 
cd .ssh
cp id_rsa.pub authorized_keys
scp authorized_keys grid@192.168.0.102:~/.ssh/
ssh grid@192.168.0.102
cd .ssh
cat id_rsa.pub >> authorized_keys
scp authorized_keys grid@192.168.0.101:~/.ssh/

??b. 然后逐一登錄測(cè)試(第一次需要輸入yes保存主機(jī)信息)

ssh whdatarac1 date
ssh whdatarac1-vip date
ssh whdatarac1-priv date
ssh whdatarac1 date
ssh whdatarac1-vip date
ssh whdatarac1-priv date

6终娃、依賴包安裝

??根據(jù)官方文檔,需要安裝以下包蒸甜,由于系統(tǒng)版本太高有些包安裝不上棠耕,這里可以先忽略。

binutils
compat-libcap1
cpp
gcc
gcc-c++-
glibc
glibc-devel
glibc-headers
ksh
libaio
libaio-devel
libgcc
libstdc++-
libstdc++-devel
libXi-
libXtst
make
mpfr
sysstat

??ASM 相應(yīng)的包安裝:

kmod-oracleasm    #asm的依賴包柠新,yum 安裝
oracleasmlib    #oracle官網(wǎng)下載窍荧,rpm 安裝報(bào)錯(cuò),使用強(qiáng)制安裝參數(shù) --force
oracleasm-support    #oracle官網(wǎng)下載登颓,rpm 安裝報(bào)錯(cuò)搅荞,使用強(qiáng)制安裝參數(shù) --force

7、用戶環(huán)境變量設(shè)置.bash_profile

??最基礎(chǔ)的環(huán)境變量只需要聲明四項(xiàng)即可,聲明越多越容易出問(wèn)題咕痛。
?? grid 用戶:

export ORACLE_SID=+ASM1
#export ORACLE_SID=+ASM2
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export PATH=$ORACLE_HOME/bin:$PATH

?? oracle 用戶:

export ORACLE_SID=orcl1
#export ORACLE_SID=orcl1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db1
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin

8痢甘、系統(tǒng)參數(shù)

??/etc/sysctl.conf

kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

# sysctl -p 立即生效

??/etc/security/limits.conf

grid soft nproc 655350 
grid hard nproc 655350
grid soft nofile 655350 
grid hard nofile 655350 
grid soft stack 655350
grid hard stack 655350

orcle soft nproc 655350 
orcle hard nproc 655350
orcle soft nofile 655350 
orcle hard nofile 655350
oracle soft stack 655350
oracle hard stack 655350

??/etc/pam.d/login

session    required     /lib64/security/pam_limits.so
session    required     pam_limits.so

四、安裝事項(xiàng)

1茉贡、集群測(cè)試

??整個(gè)安裝過(guò)程開(kāi)始之前塞栅,要先進(jìn)行集群的可用性測(cè)試:
??先安裝 cvuqdisk:安裝包在 grid 的安裝介質(zhì)上的 rpm 目錄中。
??測(cè)試命令如下:

./runcluvfy.sh stage -pre crsinst -n rac1,rac2  -fixup -verbose
./runcluvfy.sh stage -post hwos -n rac1,rac2 -verbose

2腔丧、oracle cluster 安裝

??oracle cluster 的安裝截圖請(qǐng)參照其他安裝手冊(cè)放椰。非關(guān)鍵步驟不插入截圖。
??開(kāi)始安裝前 grid 軟件會(huì)對(duì)集群可用性再次檢測(cè):

由于系統(tǒng)版本太高愉粤,我的警告內(nèi)容主要如下:
?三個(gè)包無(wú)法安裝或者安裝了無(wú)法檢測(cè)到:elfutils-libelf-devel compat-libcap1 libaio-devel
?解決方式: Ignore ALL
?安裝到最后跑腳本的時(shí)候會(huì)報(bào)錯(cuò)砾医,解決方式詳見(jiàn)本安裝記錄第五部分 經(jīng)典問(wèn)題

??需要以 root 執(zhí)行的腳本有如下兩個(gè),會(huì)報(bào)錯(cuò)的是后一個(gè)衣厘。

/u01/app/oraInventory/orainstRoot.sh 
/u01/app/11.2.0/grid/root.sh    #會(huì)執(zhí)行失敗

3如蚜、Oracle 程序安裝

??只安裝程序,過(guò)程無(wú)報(bào)錯(cuò)影暴。

五错邦、經(jīng)典問(wèn)題

1、RHEL 7 及以后系統(tǒng)版本 圖形化安裝過(guò)程中彈出框是一個(gè)小豎條型宙,且無(wú)法放大的問(wèn)題

??問(wèn)題原因猜測(cè):可能是由于 oracle 本身安裝程序的 java 版本所致
??解決方式:調(diào)用本地的 jre 包撬呢,運(yùn)行安裝程序

./runInstaller -jreLoc /usr/lib/jvm/jre-1.8.0

2、cluster 腳本報(bào)錯(cuò):Failed to create keys in the OLR, rc = 127 libcap.so.1

??報(bào)錯(cuò)詳細(xì)內(nèi)容如下:

Failed to create keys in the OLR, rc = 127, Message:
  /u01/app/11.2.0/grid/bin/clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory 

Failed to create keys in the OLR at /u01/app/11.2.0/grid/crs/install/crsconfig_lib.pm line 7660.
/u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install /u01/app/11.2.0/grid/crs/install/rootcrs.pl execution failed

??報(bào)錯(cuò)是說(shuō)找不到 libcap.so.1 庫(kù)妆兑,我猜多半是和源里缺失而沒(méi)有安裝上的包有些關(guān)系魂拦,一般 linux 源里沒(méi)有了的包都是被其他包所替代了,而 oracle 官方還沒(méi)來(lái)得及修改自家的文檔箭跳,先 find 一下名字差不太多的文件:

[root@whdatarac1 oui]# find / -name libcap*
find: ‘/run/user/1001/gvfs’: Permission denied
/usr/lib64/libcap-ng.so.0
/usr/lib64/libcap-ng.so.0.0.0
/usr/lib64/libcap.so.2
/usr/lib64/libcap.so.2.22
/usr/lib64/pkgconfig/libcap.pc
/usr/lib64/openssl/engines/libcapi.so
/usr/lib64/libcap.so.1
/usr/lib64/libcap.so
/usr/share/doc/libcap-ng-0.7.5
/usr/share/doc/libcap-2.22
/usr/share/doc/man-pages-overrides-7.5.2/libcap-ng
/usr/share/man/man3/libcap.3.gz

??進(jìn)入 /usr/lib64/ 目錄晨另,列出相關(guān)的包:

[root@whdatarac1 lib64]# ls -al libcap.so*
lrwxrwxrwx  1 root root    11 Dec 26 11:33 libcap.so -> libcap.so.2
lrwxrwxrwx. 1 root root    14 Dec 17 14:41 libcap.so.2 -> libcap.so.2.22
-rwxr-xr-x. 1 root root 20032 Mar  6  2017 libcap.so.2.22

??很明顯可以看到,真正的庫(kù)文件應(yīng)該是 libcap.so.2.22 其他兩個(gè)都是軟連接谱姓,那么我們不妨建立一個(gè) libcap.so.1 的軟連接指向它借尿。問(wèn)題解決。

3屉来、cluster 腳本報(bào)錯(cuò):ohasd failed to start

??詳細(xì)報(bào)錯(cuò)內(nèi)容如下:

CRS-4124: Oracle High Availability Services startup failed.
CRS-4000: Command Start failed, or completed with errors.
ohasd failed to start: Inappropriate ioctl for device
ohasd failed to start at/u01/app/11.2.0/grid/crs/install/rootcrs.pl line 443.

??這個(gè)是 Oraclebug 路翻,解決辦法如下:
??在執(zhí)行root.sh之前執(zhí)行以下命令

/bin/dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1

??重新執(zhí)行 root.sh 之前先調(diào)用腳本刪除配置:

/u01/app/11.2.0/grid/crs/install/roothas.pl -deconfig -force-verbose

4、asmca 圖形化管理界面中彈出框是一個(gè)小豎條

??此問(wèn)題無(wú)解茄靠。不過(guò)可以通過(guò)命令行管理 asm 磁盤組茂契。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市慨绳,隨后出現(xiàn)的幾起案子掉冶,更是在濱河造成了極大的恐慌真竖,老刑警劉巖,帶你破解...
    沈念sama閱讀 211,376評(píng)論 6 491
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件厌小,死亡現(xiàn)場(chǎng)離奇詭異恢共,居然都是意外死亡,警方通過(guò)查閱死者的電腦和手機(jī)璧亚,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,126評(píng)論 2 385
  • 文/潘曉璐 我一進(jìn)店門讨韭,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái),“玉大人癣蟋,你說(shuō)我怎么就攤上這事透硝。” “怎么了疯搅?”我有些...
    開(kāi)封第一講書人閱讀 156,966評(píng)論 0 347
  • 文/不壞的土叔 我叫張陵濒生,是天一觀的道長(zhǎng)。 經(jīng)常有香客問(wèn)我秉撇,道長(zhǎng)甜攀,這世上最難降的妖魔是什么? 我笑而不...
    開(kāi)封第一講書人閱讀 56,432評(píng)論 1 283
  • 正文 為了忘掉前任琐馆,我火速辦了婚禮,結(jié)果婚禮上恒序,老公的妹妹穿的比我還像新娘瘦麸。我一直安慰自己,他們只是感情好歧胁,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,519評(píng)論 6 385
  • 文/花漫 我一把揭開(kāi)白布滋饲。 她就那樣靜靜地躺著,像睡著了一般喊巍。 火紅的嫁衣襯著肌膚如雪屠缭。 梳的紋絲不亂的頭發(fā)上,一...
    開(kāi)封第一講書人閱讀 49,792評(píng)論 1 290
  • 那天崭参,我揣著相機(jī)與錄音呵曹,去河邊找鬼。 笑死何暮,一個(gè)胖子當(dāng)著我的面吹牛奄喂,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播海洼,決...
    沈念sama閱讀 38,933評(píng)論 3 406
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼跨新,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了坏逢?” 一聲冷哼從身側(cè)響起域帐,我...
    開(kāi)封第一講書人閱讀 37,701評(píng)論 0 266
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤赘被,失蹤者是張志新(化名)和其女友劉穎,沒(méi)想到半個(gè)月后肖揣,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體帘腹,經(jīng)...
    沈念sama閱讀 44,143評(píng)論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,488評(píng)論 2 327
  • 正文 我和宋清朗相戀三年许饿,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了阳欲。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 38,626評(píng)論 1 340
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡陋率,死狀恐怖球化,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情瓦糟,我是刑警寧澤筒愚,帶...
    沈念sama閱讀 34,292評(píng)論 4 329
  • 正文 年R本政府宣布,位于F島的核電站菩浙,受9級(jí)特大地震影響巢掺,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜劲蜻,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,896評(píng)論 3 313
  • 文/蒙蒙 一陆淀、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧先嬉,春花似錦轧苫、人聲如沸。這莊子的主人今日做“春日...
    開(kāi)封第一講書人閱讀 30,742評(píng)論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至衅胀,卻和暖如春岔乔,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背滚躯。 一陣腳步聲響...
    開(kāi)封第一講書人閱讀 31,977評(píng)論 1 265
  • 我被黑心中介騙來(lái)泰國(guó)打工雏门, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人哀九。 一個(gè)月前我還...
    沈念sama閱讀 46,324評(píng)論 2 360
  • 正文 我出身青樓剿配,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親阅束。 傳聞我的和親對(duì)象是個(gè)殘疾皇子呼胚,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,494評(píng)論 2 348

推薦閱讀更多精彩內(nèi)容