您的位置:首页 > 其它

双节点rhel5_x64_11gr2_grid_asm 安装文档

2012-06-01 10:22 316 查看

一、 安装环境

主机操作系统:win7

虚拟机软件:vmware workstation8

Rac 节点操作系统:Redhat server 5 x86_64

DNS 服务器操作系统:windows server 2003

Oracle Database software : Oracle11gr2

Cluster software : Oracle grid infrastructure 11gr2

共享存储 : ASM+raw

二、 拓扑图



11gr2 新监听方式



GNS architecture



三、 存储规划



四、 网络规划

使用 gns 方式



五、 安装前准备

1、 硬件需求

A minimum of 2 GB RAM is required for the complete Grid Infrastructure

and RAC software installation.

(1)至少 2g 的内存(for database & grid infrastrature)

本环境:每个 2g 内存

A minimum of 1 GB free space is required in the /tmp directory.

(2)至少 1g 的临时目录空间,这个尽可能要大一点,因为如果使用 amm,会用到 tmp 空

间,它的大小应该=swap+phycal memory/2。

本环境:每个 5g

By default, tmpfs is allocated from virtual memory. Thus it can include both physical RAM and swap

space, and it is sized to half of physical memory without swap space. However, unlike huge pages, which

you will learn more about later in this chapter, tmpfs memory allocation is dynamic. Therefore, if tmpfs

is not used, it does not take any allocation of memory, and it does not require a change in settings if

AMM is not used. When AMM is used, Oracle allocates a number of memory mapped files in tmpfs.

These files are allocated with at a file, or granule, size ranging from 4MB to MEMORY_MAX_TARGET of 1GB

and 16ater than 1GB. The allocated files can be identified by the shmid of the

corresponding single page shared memory segment. The following example shows single page shared

memory segments for both an ASM instance and a database instance:

A minimum of 10 GB free space for the entire Clusterware/Grid and RAC

software homes is required.

(3)至少 10gb 的空闲空间(for database & grid infrastrature)

本环境/u01/ 每个 20g

Ensure that you have prepared shared storage in which to place Clusterware

critical components: Oracle Cluster Registry (OCR) and Voting Disk.

(4)确定拥有共享存储用来存放 ocr&vote disk 。

本环境:查看第三章存储规划

Also ensure that you have adequate shared storage disks for Automatic

Storage Management, if you consider using ASM to host the datafiles.

(5)确保充足的空间供 asm 使用来存放数据库文件。

本环境:查看第三章存储规划

Configure the server swap size to be 1.5 time if the RAM on the server

is <=2 GB.

(6)swap 空间至少为内存的 1.5 倍,至少为 2gb

本环境:4g

Each server must have a minimum of two network adapters

or network interface cards (NIC) configured to be able to support the public

时间就像海绵里的水,挤一挤,还是有的

and private networks.

(7)至少拥有两块网卡,用来提供 public network 和 private network

本环境:虚拟机提供的两块 hostonly 网卡(因为经常单机工作,如果有网络环境可以考虑

briged+hostonly)

2、 网络需求

如果使用 gns 方式,一共需要

public ip *2,vip *2 , scan_ip *3 , gns_vip *1 , dns&dhcp_ip *1 , private_ip *2

=2+2+3+1+1+2=11

需要 11 个 ip…

操作:

因为使用 gns 方式,vip 和 scan_vip 都放在了 dhcp 中自动获取,所以,这里 hosts 文件中只

需要加入节点 public ip 信息和节点的 private ip 即可。

vi /etc/hosts

127.0.0.1 localhost

192.168.100.210 rhel1 rhel1.dex.com

192.168.10.210 rhel1-priv rhel1-priv.dex.com

192.168.100.211 rhel2 rhel2.dex.com

192.168.10.211 rhel2-priv rhel2-priv.dex.com

配置 dns 和 dhcp 服务器,这里使用了 windowsserver2003 作为 dhcp 以及 dns 服务器。

详细的配置截图请看下面链接的文档。

3、 内核参数

kernel.shmall = 2097152

kernel.shmmax = 536870912

kernel.shmmni = 4096

kernel.sem = 250 32000 100 142

fs.aio-max-size =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 = 4194304

kernel.shmmax=536870912/1024/1024/1024=0.5g=512m(sga_max_size 最好不超过 512m)

kernel.shmall = 2097152 > kernel.shmmax/system pagesize=536870912/4096=131072

getconf PAGESIZE 查看 system pagesize

tune2fs -l /dev/sda1 |grep 'Block size' 查看系统块大小

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 4194304

这四个参数在使用 kernel 版本为 2.6 以后的 linux 系统时,不再需要设置这四个参数(所以

在 system 文件中这四个参数没有被设置) ,因为这四个参数会被自动调整。

但是对于 Oracle 来说,需要这样设置

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 4194304

命令:

vi /etc/sysctl.conf

修改或新增如下配置

kernel.shmall = 2097152

kernel.shmmax = 536870912

kernel.shmmni = 4096

kernel.sem = 250 32000 100 142

fs.aio-max-size =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 = 4194304

sysctl –p

可能会报错

error: "fs.aio-max-size" is an unknown key

原因:

That kernel parameter doesn't exist in the 2.6.x kernels.

时间就像海绵里的水,挤一挤,还是有的

According to some documents I've found on the net this

feature is now "automatic" in the 2.6.x kernel, based on the

physical capabilities of the disk device driver.

去掉这个参数即可

4、 依赖包

验证

rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" \

binutils \

compat-libstdc++-33 \

elfutils-libelf \

elfutils-libelf-devel \

gcc \

gcc-c++ \

glibc \

glibc-common \

glibc-devel \

glibc-headers \

ksh \

libaio \

libaio-devel \

libgcc \

libstdc++ \

libstdc++-devel \

make \

sysstat \

numactl \

unixODBC \

unixODBC-devel \

| grep "not installed"

查看未安装的软包,到安装光盘中找,我的只有两个没有安装

package compat-libstdc++ is not installed

package sysstat is not installed

cd /media/RHEL_5.6\ x86_64\ DVD/Server/

ls | grep sysstat

rpm -ivh sysstat-7.0.2-3.el5_5.1.x86_64.rpm

时间就像海绵里的水,挤一挤,还是有的

ls | grep compat-libstdc++

rpm -ivh compat-libstdc++-33-3.2.3-61.x86_64.rpm

如果有网络环境就更加简单了,可以使用 yum 安装所需的包:

Linux 5

# cd /etc/yum.repos.d

# wget http://public-yum.oracle.com/public-yum-el5.repo
yum install oracle-validated

5、 时间同步 ntpserver

使用 windows2003 作为 ntp Server

1 通过开始菜单,输入 regedit 命令后打开注册表设定画面,此时请一定备份注册表文件。

2 修改以下选项的键值

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServe

r 内的「Enabled」设定为 1,打开 NTP 服务器功能

3 修改以下键值

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\AnnounceFlags

设定为 5

该设定强制主机将它自身宣布为可靠的时间源

4 在 dos 命令行执行以下命令,确保以上修改起作用

〉 net stop w32time

〉 net start w32time

推荐计划;如果该服务器和 internet 连接,那么为了避免服务器和 internet 上的 ntp 同步,

最好追加以下配置

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient

的「enable」设定为 0 以防止作为客户端自动同步外界的时间服务

可以在 linux 下使用[ntpdate 本机 ip] 测试服务器是否搭建成功

最后记得将 windows time 服务设置为自动启动。

原帖地址:
http://www.cnblogs.com/jintianfree/archive/2011/03/02/1968799.html
先试验一下 ntpdate 192.168.100.200

成功后

时间就像海绵里的水,挤一挤,还是有的

crontab –e

* * * * * /usr/sbin/ntpdate 192.168.100.200

2>>/tmp/cron_dat.log

虚拟机环境到这一步的时候,就可以复制粘贴配置另外一个节点了。

6、 配置用户和组

groupadd -g 500 oinstall

groupadd -g 501 dba

groupadd -g 502 oper

groupadd -g 503 asmadmin

useradd -u 1000 -g oinstall -G dba,oper,asmadmin oracle

passwd oracle

vi /etc/security/limits.conf

oracle soft nofile 131072

oracle hard nofile 131072

oracle soft nproc 131072

oracle hard nproc 131072

oracle soft core unlimited

oracle hard core unlimited

oracle soft memlock 50000000

oracle hard memlock 50000000

验证一下

ulimit –a

vi /etc/pam.d/login

session required pam_limits.so

mkdir -p /u01/app/11.2.0/grid/

mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1/

chown -R oracle:oinstall /u01/

su – oracle

vi ./.bash_profile

if [ $USER = "oracle" ]; then

时间就像海绵里的水,挤一挤,还是有的

if [ $SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

umask 022

fi

export ORACLE_BASE=/u01/app

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

export GRID_HOME=/u01/app/11.2.0/grid

export ORACLE_SID=prod1

export PATH=$PATH:$ORACLE_HOME/bin:$GRID_HOME/bin

LD_LIBRARY_PATH=$ORACLE_HOME/lib

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib

export LD_LIBRARY_PATH

J***A_HOME=$ORACLE_HOME/jdk; export J***A_HOME

JRE_HOME=$J***A_HOME/jre/bin; export JRE_HOME

. ~/.bash_profile

查看一下是否有错误。

修改 ip

修改环境变量

修改 hostname

重启

7、 配置 ssh 互信

[oracle@rhel1 ~]$ ssh-keygen -t dsa

[oracle@rhel1 ~]$ ssh-keygen -t rsa

[oracle@rhel1 ~]$ ssh rhel2.dex.com ssh-keygen -t dsa

[oracle@rhel1 ~]$ ssh rhel2.dex.com ssh-keygen -t rsa

[oracle@rhel1 ~]$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

[oracle@rhel1 ~]$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

[oracle@rhel1 ~]$ ssh rhel2.dex.com cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

[oracle@rhel1 ~]$ ssh rhel2.dex.com cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

时间就像海绵里的水,挤一挤,还是有的

scp ~/.ssh/authorized_keys rhel2.dex.com:~/.ssh/

ssh rhel2-priv date

ssh rhel2 date

ssh rhel1-priv date

ssh rhel2 date

ssh rhel2-priv .dex.com date

ssh rhel2.dex.com date

ssh rhel1-priv .dex.com date

ssh rhel2.dex.com date

8、 配置 asm 磁盘

这里可以使用I/O Multipathing with Device-Mapper

格式化

fdisk –l

全部只要一个分区

fdisk /dev/sdb n p 1 w

生效(两个节点都需要使用这个命令,否则另外一个节点可能没有分区信息)

partprobe

配置 raw

vi /etc/udev/rules.d/60-raw.rules

ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"

ACTION=="add", KERNEL=="sdc1", RUN+="/bin/raw /dev/raw/raw2 %N"

ACTION=="add", KERNEL=="sde1", RUN+="/bin/raw /dev/raw/raw3 %N"

ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw4 %N"

ACTION=="add", KERNEL=="sdf1", RUN+="/bin/raw /dev/raw/raw5 %N"

ACTION=="add", KERNEL=="sdg1", RUN+="/bin/raw /dev/raw/raw6 %N"

ACTION=="add", KERNEL=="raw[1-6]",OWNER="oracle", GROUP="oinstall",MODE=640

重启服务

[root@centos ~]# start_udev

Starting udev: [ OK ]

时间就像海绵里的水,挤一挤,还是有的

确认

[root@rhel1 ~]# raw -qa

/dev/raw/raw1: bound to major 8, minor 17

/dev/raw/raw2: bound to major 8, minor 33

/dev/raw/raw3: bound to major 8, minor 65

/dev/raw/raw4: bound to major 8, minor 49

/dev/raw/raw5: bound to major 8, minor 81

/dev/raw/raw6: bound to major 8, minor 97

[root@rhel1 ~]# ls -l /dev/raw

total 0

crw------- 1 oracle oinstall 162, 1 May 6 04:36 raw1

crw------- 1 oracle oinstall 162, 2 May 6 04:36 raw2

crw------- 1 oracle oinstall 162, 3 May 6 04:36 raw3

crw------- 1 oracle oinstall 162, 4 May 6 04:36 raw4

crw------- 1 oracle oinstall 162, 5 May 6 04:36 raw5

crw------- 1 oracle oinstall 162, 6 May 6 04:36 raw6

下面就是安装grid和oracle database软件了,因为大多是截图,所以放在了文档里面,如果有兴趣可以到下面的链接地址上下载。

小问题记录一下,如果没有使用gns服务。而是使用hosts文件解析scan ip ,可能会出现客户端无法连接,或者连接超时的情况。

这是因为客户端无法解析名称导致的

需要看一下

local_listener 这个参数

NAME TYPE VALUE

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

listener_networks string

local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD

DRESS=(PROTOCOL=TCP)(HOST=sol1-vip)(PORT=1521))))

remote_listener string sol-scan:1521

有两种方法,一种是使客户端能够解析sol1-vip这个名称

第一种方法:

linux : vi /etc/hosts

windows : C:\Windows\System32\drivers\etc\hosts

加入这个sol1-vip对应的条目即可

第二种方法:

修改local_listener 为ip的方式(两个节点分别设置)

详细安装截图请看下面的连接:

http://download.csdn.net/detail/renfengjun/4488463

关于GNS服务的详细说明的文档请看下面的链接:

http://download.csdn.net/detail/renfengjun/4488454
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: