ITPub博客

首页 > 数据库 > Oracle > VMWARE+linux+oracle 10g RAC 之一

VMWARE+linux+oracle 10g RAC 之一

原创 Oracle 作者:wmlm 时间:2008-01-28 17:42:41 0 删除 编辑

参考文档:

linux-10g-rac.doc

oracle-on-linux vmware 简明手册.doc

在 Linux 和 FireWire 上构建您自己的 Oracle RAC 10g 第 2 版集群.mht

[@more@]

第一部分 安装linux

一 安装VMWARE

下载vmware server,并进行安装,这个资料比较多,此处略去.

二 安装一个节点上的操作系统

节点名称: linux1

操作系统: linux as3 update5

添加两块网卡: 接口类型Bridged

IP地址规划如下所示:

rac1的IP地址:

---------eht0-----------------

linux1 10.0.10.82

linux1-vip 10.0.10.92

----------eth1----------------

linux1-san 10.10.10.2

rac2的IP地址:

---------eht0-----------------

linux1 10.0.10.83

linux1-vip 10.0.10.93

----------eth1----------------

linux1-san 10.10.10.2

IP的设置方法参考资料:

ifconfig eth0:0 192.168.230.2 netmask 255.255.255.0 up

ifconfig eth0:1 192.168.230.20 netmask 255.255.255.0 up

将ip配置保存到文件中:

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

这样重起后就不会丢了

对linux的网络配置文件:/etc/sysconfig/network-scripts/..

对SCO-Unix的网络配置文件:/etc/tcp文件

注意:对于RAC的配置,只需要使用图形界面,进行配置即可.VIP IP在安装CRS软件时自动配置.

三 复制节点1,生成节点2 ,并做一些修改

四 检查内核版本

[root@linux1 root]# uname -rm

2.4.21-32.EL i686

第二部分 配置linux for ORACLE

一 增加ORACLE用户和组

/usr/sbin/groupadd oinstall

/usr/sbin/groupadd dba

/usr/sbin/useradd -m -g oinstall -G dba oracle

id oracle

passwd oracle

二 增加挂载点

mkdir -p /u01/app/oracle

chown -R oracle:oinstall /u01/app/oracle

chmod -R 775 /u01/app/oracle

三 配置内核参数

cat >> /etc/sysctl.conf << EOF

kernel.shmall = 2097152

kernel.shmmax = 536870912

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 658576

net.ipv4.ip_local_port_range = 1024 65000

net.core.rmem_default = 262144

net.core.wmem_default = 262144

net.core.rmem_max = 1048536

net.core.wmem_max = 1048536

EOF

/sbin/sysctl -p

四 配置oracle用户的SHELL限制

cat >> /etc/security/limits.conf << EOF

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

EOF

cat >> /etc/pam.d/login << EOF

session required /lib/security/pam_limits.so

EOF

五 配置心跳模块

modprobe hangcheck-timer hangcheck_tick=30 hangcheck_margin=180

cat >> /etc/rc.d/rc.local << EOF

modprobe hangcheck-timer hangcheck_tick=30 hangcheck_margin=180

EOF

在此处注意 /etc/rc.local实际上是rc.d/rc.local的链接

六 配置/etc/hosts

[root@linux1 root]# more /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1 localhost.localdomain localhost

10.0.10.82 linux1

10.0.10.83 linux2

10.10.10.2 linux1-priv

10.10.10.3 linux2-priv

10.0.10.92 linux1-vip

10.0.10.93 linux2-vip

七 配置SSH,使用户相互信任

From each node, logged in as oracle:

mkdir ~/.ssh

chmod 755 ~/.ssh

/usr/bin/ssh-keygen -t rsa

Cut and paste the following line separately:

/usr/bin/ssh-keygen -t dsa

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

From the first node ONLY, logged in as oracle (copy the local account's keys so that ssh to the local node will work):

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

Now copy the keys to the other node so that we can ssh to the remote node without being prompted for a password.

ssh oracle@ds2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

ssh oracle@ds2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

chmod 644 ~/.ssh/authorized_keys

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

Now do the same for the second node.

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

ssh oracle@ds1 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

ssh oracle@ds1 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

chmod 644 ~/.ssh/authorized_keys

八 建立用户等价(用户信任)

ssh配置完成后,建立用户信任.仍然是在ORACLE用户下.

As oracle on the node where the Oracle 10g Release 2 software will be installed (ds1):

exec /usr/bin/ssh-agent $SHELL

/usr/bin/ssh-add

(Note that user equivalence is established for the current session only. If you switch to a different session or log out and back in, you will have to run ssh-agent and ssh-add again to re-establish user equivalence.)

九 测试连接

[oracle@linux1 oracle]$ ssh linux2 date

只有这些还不够,还要安装rsh服务,由于这个原因,导致在INSTALL CRS软件时,一直过不去.

----------CRS安装失败,查网上资料,属于ssh 与 rsh设置后,没有相互验证.,除了SSH之外,把RSH也给配置上

----------另外,为了方便起见,在/etc/hosts文件中不要别名,这样就解决了节点不能clusterable的问题,除了配置root用户的相互信任外,还添加了oracle用户之间的相互信任

----------------------------------参考资料 设置rlogin、rsh----------------------------------------------

由于在第一个节点上安装oracle软件时,oracle会自动将第一个节点上安装完毕的文件拷贝到第二个节点上,因此需要配置rlogin和rsh以及rcp等。

(1)确定是否安装了rsh-server软件。

[root@linux1 root]# rpm ?qa | grep rsh

(2)如果没有安装,则从AS3安装介质上找到该rpm包,并进行安装。

(3)安装好以后,需要启动rsh、rlogin、rexec服务。输入以下命令,并从弹出的框中选中rsh、rlogin、rexec后确认。

[root@linux1 root]# ntsysv

(4)激活rsh、rlongin服务

[root@linux1 root]# service xinetd restart

(5)修改/etc/securetty

[root@linux1 root]# echo "rexec" >> /etc/securetty;echo "rlogin" >> /etc/securetty;echo "rsh" >> /etc/securetty

(6)设置允许root进行rsh、rlogin

[root @linux1 /root]# vi /etc/pam.d/rlogin

将authrequiredpam_securetty.so这一行开头添加#,从而注释该行。

(7)在/etc目录下建立hosts.equiv文件,表示两台linux节点互相信任。

[root @linux1 /root]# vi /etc/hosts.equiv

在该文件里添加如下内容:

linux1

linux2

linux1-prv

linux2-prv

(8)在root的$HOME目录下,建立.rhosts文件。

[root @linux1 /root]# vi .rhosts

在该文件里添加如下内容。这样,root用户就可以直接rlogin、rsh而不用输入密码。

linux1 root

linux2 root

linux1-prv root

linux2-prv root

(9)配置完以后,我们可以测试一下是否成功。

[root @linux1 /root]# rlogin linux2 [root @linux1 /root]# rsh ?l root linux2 cat /etc/hosts [root @linux1 /root]# rcp /tmp/testlinux2:/tmp

另外,在文档<<在Linux和FireWire上构建您自己的Oracle RAC 10g第2版集群(3).mht>>中,有rsh专门的介绍.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/271063/viewspace-998650/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 统计之“局”
请登录后发表评论 登录
全部评论

注册时间:2008-04-08

  • 博文量
    398
  • 访问量
    3716803