您好,登錄后才能下訂單哦!
主機名 | 服務器配置 | 操作系統版本 | 安裝數據庫版本 | 雙機軟件版本 |
Jzzf-db1 | E5-2609 v3*2 128GB內存 300G硬盤 | Redhat linux 6.5 x64 | Oracle 10.2.0.5 | Rose ha 9.0 |
Jzzf-db2 | E5-2609 v3*2 128GB內存 300G硬盤 | Redhat linux 6.5 x64 | Oracle 10.2.0.5 | Rose ha 9.0 |
主機名 | IP地址 | 浮動IP |
Jzzf-db1 | Eth0:10.20.160.165 Eth2:192.168.1.1 Eth3:172.16.0.1 | 10.20.160.101 |
Jzzf-db2 | Eth0:10.20.160.166 Eth2:192.168.1.2 Eth3:172.16.0.2 |
主機名 | 數據磁盤 | 仲裁磁盤 |
Jzzf-db1 | sdb/sdd聚合為/dev/mapper/oradata 1TB | sdc/sde聚合為/dev/mapper/vote 10GB |
Jzzf-db2 | sdb/sdd聚合為/dev/mapper/oradata 1TB | sdc/sde聚合為/dev/mapper/vote 10GB |
具體的修改方法我就不寫了。VI編輯就行
[root@jzzf-db1 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.20.160.165 jzzf-db1
10.20.160.166 jzzf-db2
[root@jzzf-db1 ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=jzzf-db1
[root@jzzf-db1 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago) //先安裝10.2.0.1,要修改該文件,修改過程見2.2
[root@jzzf-db1 ~]# uname -a
Linux localhost.localdomain 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@jzzf-db1 ~]# uname -r
2.6.32-431.el6.x86_64
[root@jzzf-db2 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.20.160.165 jzzf-db1
10.20.160.166 jzzf-db2
[root@jzzf-db2 ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=jzzf-db2
[root@jzzf-db2 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)
[root@jzzf-db2 ~]# uname -a
Linux localhost.localdomain 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@jzzf-db2 ~]# uname -r
2.6.32-431.el6.x86_64
[root@jzzf-db1 ~]# grep -v "^#" /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[root@jzzf-db2 ~]#grep -v "^#" /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[root@jzzf-db1 ~]# grep -v "^#" /etc/sysctl.conf
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
[root@jzzf-db2 ~]# grep -v "^#" /etc/sysctl.conf
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
[root@jzzf-db1 tmp]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)
[root@jzzf-db1 tmp]# cp /etc/redhat-release /tmp/
[root@jzzf-db1 tmp]# vi /etc/redhat-release
[root@jzzf-db1 tmp]# cat /etc/redhat-release
redhat-4
groupadd -g 6000 oinstall
groupadd -g 6001 dba
useradd -g oinstall -G dba -u 601 oracle
passwd oracle
mkdir -p /u01/app/oracle/product/10.2.0/db_1
chown -R oracle:oinstall /u01/
chmod -R 775 /u01
兩節點都需要配置
配置YUM源
掛載操作系統光盤到mnt目錄
[root@jzzf-db1 ~]#mount /dev/cdrom /mnt
[root@jzzf-db1 ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[root@jzzf-db1 ~]# cat /etc/yum.repos.d/local.repo
[DISK]
name=DISK
baseurl=file:///mnt/Server
gpgchekc=0
enable=1
安裝需求包:
[root@jzzf-db1 ~]# mount -o loop /tmp/rhel-server-6.5-x86_64-dvd.iso /mnt
yum install -y libXp.i686 libXp.x86_64 libXp-devel.i686 libXp-devel.x86_64 libXpm.i686 libXpm-devel.i686 libXpm-devel.x86_64 libXpm.x86_64
yum install -y libXtst.x86_64 libXtst-devel.x86_64 libXtst.i686 libXtst-devel.i686
yum install -y binutils* compat-libstdc++-* elfutils-libelf-* elfutils-libelf-devel-* elfutils-libelf-devel-static-* gcc-* gcc-c++-* glibc-* glibc-common-* glibc-devel-* glibc-headers-* ksh libaio-* libaio-devel-* libgcc libstdc++-* libstdc++-devel make sysstat unixODBC unixODBC-devel compat-libstdc++-33.i386 compat-libstdc++-296.i386 glibc.i686 glibc-devel.i386 unixODBC.i386 unixODBC-devel.i386 libaio.i386 libaio-devel.i386 libgcc.i386 libstdc++.i386 libstdc++-devel.i386 libaio-devel.i386 libXp.i386
yum install -y binutils* compat-db setarch compat-libstdc++-* control-center elfutils-libelf-* elfutils-libelf-devel-* elfutils-libelf-devel-static-* gcc-* gcc-c++-* glibc-* glibc-common-* glibc-devel-* glibc-headers-* ksh libaio-* libaio-devel-* libgcc libstdc++-* libstdc++-devel make sysstat unixODBC unixODBC-devel compat-libstdc++-33.i386 compat-libstdc++-296.i386 glibc.i686 glibc-devel.i386 unixODBC.i386 unixODBC-devel.i386 libaio.i386 libaio-devel.i386 libgcc.i386 libstdc++.i386 libstdc++-devel.i386 libaio-devel.i386 libXp.i386
yum install binutils compat-db compat-libstdc++-33 glibc glibc-devel glibc-headers gcc gcc-c++ libstdc++ cpp make libaio ksh elfutils-libelf sysstat libaio libaio-devel setarch gcc make binutils openmotif glibc setarch libaio compat-db libXp openmotif compat-libstdc++-33-3.2.3 compat-gcc-34-c++-
cd /mnt/Packages
rpm -ivh glibc-devel-2.12-1.132.el6.i686.rpm
[root@jzzf-db1 ~]# yum install device-mapper*
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Package device-mapper-persistent-data-0.2.8-2.el6.x86_64 already installed and latest version
Package device-mapper-event-libs-1.02.79-8.el6.x86_64 already installed and latest version
Package device-mapper-1.02.79-8.el6.x86_64 already installed and latest version
Package device-mapper-libs-1.02.79-8.el6.x86_64 already installed and latest version
Package device-mapper-event-1.02.79-8.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package device-mapper-multipath.x86_64 0:0.4.9-72.el6 will be installed
---> Package device-mapper-multipath-libs.x86_64 0:0.4.9-72.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================================
Package Arch Version Repository Size
======================================================================================================================================
Installing:
device-mapper-multipath x86_64 0.4.9-72.el6 DISK 116 k
device-mapper-multipath-libs x86_64 0.4.9-72.el6 DISK 180 k
Transaction Summary
======================================================================================================================================
Install 2 Package(s)
Total download size: 297 k
Installed size: 653 k
Is this ok [y/N]: y
Downloading Packages:
--------------------------------------------------------------------------------------------------------------------------------------
Total 7.2 MB/s | 297 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : device-mapper-multipath-libs-0.4.9-72.el6.x86_64 1/2
Installing : device-mapper-multipath-0.4.9-72.el6.x86_64 2/2
Verifying : device-mapper-multipath-0.4.9-72.el6.x86_64 1/2
Verifying : device-mapper-multipath-libs-0.4.9-72.el6.x86_64 2/2
Installed:
device-mapper-multipath.x86_64 0:0.4.9-72.el6 device-mapper-multipath-libs.x86_64 0:0.4.9-72.el6
Complete!
配置多路徑服務開機啟動
[root@jzzf-db2 ~]# chkconfig --level 35 multipathd on
[root@jzzf-db2 ~]# chkconfig --list |grep multipathd
multipathd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
[root@jzzf-db2 /]# /etc/init.d/multipathd start
Starting multipathd daemon: [ OK ]
[root@jzzf-db2 /]# touch /etc/multipath.conf
[root@jzzf-db2 /]# multipath -ll
2694f7863475a3844 dm-1 INSPUR,SANVDSK
size=10G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=active
| `- 1:0:0:2 sdc 8:32 active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
`- 2:0:0:2 sde 8:64 active ready running
270746443556c555a dm-0 INSPUR,SANVDSK
size=1.0T features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=active
| `- 1:0:0:1 sdb 8:16 active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
`- 2:0:0:1 sdd 8:48 active ready running
[root@jzzf-db2 /]# grep -v "^#" /etc/multipath.conf
blacklist {
devnode "^sda"
}
defaults {
user_friendly_names yes
}
multipaths {
multipath {
wwid 2694f7863475a3844
alias vote
path_grouping_policy multibus
path_selector "round-robin 0"
failback manual
rr_weight priorities
no_path_retry 5
}
multipath {
wwid 270746443556c555a
alias oradata
path_grouping_policy multibus
path_selector "round-robin 0"
failback manual
rr_weight priorities
no_path_retry 5
}
}
[root@jzzf-db2 /]# /etc/init.d/multipathd restart
[root@jzzf-db2 /]# multipath -F
[root@jzzf-db2 /]# multipath -v2
create: oradata (270746443556c555a) undef INSPUR,SANVDSK
size=1.0T features='0' hwhandler='0' wp=undef
`-+- policy='round-robin 0' prio=1 status=undef
|- 1:0:0:1 sdb 8:16 undef ready running
`- 2:0:0:1 sdd 8:48 undef ready running
create: vote (2694f7863475a3844) undef INSPUR,SANVDSK
size=10G features='0' hwhandler='0' wp=undef
`-+- policy='round-robin 0' prio=1 status=undef
|- 1:0:0:2 sdc 8:32 undef ready running
`- 2:0:0:2 sde 8:64 undef ready running
[root@jzzf-db2 /]# multipath -ll
oradata (270746443556c555a) dm-0 INSPUR,SANVDSK
size=1.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 1:0:0:1 sdb 8:16 active ready running
`- 2:0:0:1 sdd 8:48 active ready running
vote (2694f7863475a3844) dm-1 INSPUR,SANVDSK
size=10G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 1:0:0:2 sdc 8:32 active ready running
`- 2:0:0:2 sde 8:64 active ready running
[root@jzzf-db2 mapper]# pwd
/dev/mapper
[root@jzzf-db2 mapper]# ls
control oradata vote
[root@jzzf-db1 mapper]# fdisk /dev/mapper/oradata
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x181ae45d.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-133674, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-133674, default 133674):
Using default value 133674
Command (m for help): p
Disk /dev/mapper/oradata: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 524288 bytes
Disk identifier: 0x181ae45d
Device Boot Start End Blocks Id System
/dev/mapper/oradatap1 1 133674 1073736373+ 83 Linux
Partition 1 does not start on physical sector boundary.
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
創建完分區后,可能需要重啟才能識別出/dev/mapper/oradatap1文件
[root@jzzf-db1 mapper]# mkfs.ext4 /dev/mapper/oradatap1
mke2fs 1.41.12 (17-May-2010)
/dev/mapper/oradatap1 alignment is offset by 512 bytes.
This may result in very poor performance, (re)-partitioning suggested.
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=1 blocks, Stripe blocks
67108864 inodes, 268434093 blocks
13421704 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
8192 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:
Message from syslogd@jzzf-db1 at May 12 14:04:00 ...
kernel:BUG: soft lockup - CPU#6 stuck for 67s! [mkfs.ext4:11569]
done
This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@jzzf-db1 mapper]# mkdir /oradata
[root@jzzf-db1 mapper]# chown -R oracle:dba /oradata/
[root@jzzf-db1 mapper]# chmod -R 775 /oradata/
[root@jzzf-db1 mapper]# mount /dev/mapper/oradatap1 /oradata/
[root@jzzf-db1 mapper]# chown -R oracle:dba /oradata/
[root@jzzf-db1 mapper]# chmod -R 775 /oradata/
1、配置ORACLE環境變量,修改/home/oracle/.bash_profile增加以下內容
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin
2、執行 . .bash_profile 生效配置
3、切換到ORACLE用戶,su – oracle 然后進入到ORACLE10.2.01的安裝目錄,執行安裝
此處如出現如下提示,直接continue繼續即可,等安裝補丁的時候會解決。
4、執行完腳本安裝完畢后,使用ROOT用戶替換之前修改過的redhat-release文件
cp /tmp/redhat-release /etc/
再進入到10.2.0.5的安裝目錄,使用ORACLE用戶安裝補丁
5、都安裝完畢后,執行DBCA創建數據庫實例。
所有文件都要放到共享存儲/oradata目錄下。
[root@jzzf-db1 RoseHA-9.0.0-9009-RHEL6-x86_64]# ls
install resource.tar
[root@jzzf-db1 RoseHA-9.0.0-9009-RHEL6-x86_64]# ./install
RoseHA Installation
-----------------------------------
Version: 9.0.0 (buildno:9009)
1. Cluster Engine
2. Cluster Manager(hcc)
3. Cluster Command Line Interface(hcli)
4. Cluster User Interface for Text Window(hcuiw)
5. ALL
Q. Quit
Choose model(s,compart with space) you want to Install[1-4,5(def),Q]:5
you select 5:
5. ALL
Are you sure?[y,n(def)]:y
Please specify the path to install, [/opt/(def)]:
insatll...OK
Starting clusterd service: [ OK ]
Starting monitord service: [ OK ]
Starting hclid service: [ OK ]
[root@jzzf-db1 RoseHA-9.0.0-9009-RHEL6-x86_64]#
替換ORACLE里的TNSNAME文件及LISNTENER文件(紅色斜體字根據實際情況修改)
TNSNAME.ORA文件替換成如下內容:
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORA_BC =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.20.160.101)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ora_bc)
)
)
listener.ora文件替換成如下內容:
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.20.160.101)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
#static-set
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ora_bc)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(SID_NAME = ora_bc)
)
)
1、手動mount文件系統到/oradata目錄
Mount /dev/mapper/oradatap1 /oradata
2、手動加載子IP
ifconfig eth0:1 10.20.160.101 up
3、進入到ROSE HA目錄/opt/Rose/Cluster/bin/
執行./ora_start.sh <實例名> LISTENER <服務名>
查看是否可以正常啟動ORACLE實例及監聽,如成功通過檢查
4、進入到ROSE HA目錄/opt/Rose/Cluster/bin/
執行./ag_oracle.bin <實例名> <服務名> 0
查看返回結果是否成功,如成功通過檢查
5、進入到ROSE HA目錄/opt/Rose/Cluster/bin/
執行./ora_stop.sh <實例名> LISTENER <服務名>
查看是否可以停止ORACLE實例及監聽,如成功通過檢查
Ceate cluster
歡迎拍磚!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。