2. Dbabc.net Email : dba@dbabc.net
-----------------------------------------------------------------------------------------------------------------
一、安装前的准备工作
1.1 安装 Linux
安装过程略,首先确定所安装 Linux 的版本。
本案例的 Linux Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
1.2 配置/etc/hosts
注:此操作需要在每个个节点都要操作
[root@node1 ~]# vi /etc/hosts
注:每个节点都需要一个唯一的公共和专用网际协议 (Internet Protocol, IP)
地址,以及一个附加公共 IP 地址,该附加公共 IP 地址作为客户端连接和连接
故障转移的虚拟 IP 地址。虚拟 IP 地址必须与公共 IP 属于同一个子网。
Hostname 最好用小写 (多个 PUBLIC NIC 的时候最好只用一个, hosts 这里我们
暂时保留)
1.3Disable SELinux
注:此操作需要在每个个节点都要操作
永久性 Disable SELinux:
[root@node1 ~]# vi /etc/grub.conf
第 2 页,共 51 页
3. Dbabc.net Email : dba@dbabc.net
-----------------------------------------------------------------------------------------------------------------
此处需要注意:在 grub.conf 中
title Red Hat Enterprise Linux AS (2.6.9-42.ELsmp)
root (hd0,0)
kernel /vmlinuz-2.6.9-42.ELsmp ro root=LABEL=/ rhgb quiet
selinux=0
initrd /initrd-2.6.9-42.ELsmp.img
title Red Hat Enterprise Linux AS-up (2.6.9-42.EL)
root (hd0,0)
kernel /vmlinuz-2.6.9-42.EL ro root=LABEL=/ rhgb quiet
selinux=0
initrd /initrd-2.6.9-42.EL.imgLinux
其中 Linux 的版本 2.6.9-42.ELsmp 中的 ELsmp 表示 Red Hat Linux kernel that
supports symmetric multiprocessing (multiple processor machines) <---- 对
称多处理器机器。2.6.9-42.EL 中的 EL 表示 Red Hat Linux kernel for
uniprocessor machines <---- 支持单处理器机器。 为了安全起见最好将这两个
都添加上 selinux=0。
重启机子使得 selinux 生效。
1.4 分区
在分区之前需要安装 Powerpath 软件。
插入 Powe rpath 软件光盘
进入光盘的目录 cd /media/cdrom/LINUX/2.6/pp5.0.x/rhel
找到 EMCpower.LINUX-5.0.0-157.rhel.x86_64.rpm 使用以下命令进行安装
rpm -ivh EMCpower.LINUX-5.0.0-157.rhel.x86_64.rpm
emcpreg -install 输入 *24 位序列号
安装完毕之后重启机子,重启之后通过 powermt display dev=all 检查是否安装
第 3 页,共 51 页
8. Dbabc.net Email : dba@dbabc.net
-----------------------------------------------------------------------------------------------------------------
添加
Session required pam_limits.so
1.7 ssh 配置
1.7.1所有节点创建.ssh目录
Node1
node1</home/oracle>$pwd
/home/oracle
node1</home/oracle>$mkdir .ssh
node1</home/oracle>$chmod 700 .ssh
node1</home/oracle>$
Node2
node2</home/oracle>$pwd
/home/oracle
node2</home/oracle>$mkdir .ssh
node2</home/oracle>$chmod 700 .ssh
node2</home/oracle>$
1.7.2 生成密钥对
Node1
node1</home/oracle>$ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
d8:9c:2d:2f:01:45:e7:43:5b:8f:9c:de:26:39:bf:e0 oracle@node1
node1</home/oracle>$
node1</home/oracle>$ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_dsa.
Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
17:70:f5:02:ab:ce:e5:d9:79:b6:1e:d4:ff:65:33:8b oracle@node1
Node2
第 8 页,共 51 页
9. Dbabc.net Email : dba@dbabc.net
-----------------------------------------------------------------------------------------------------------------
node2</home/oracle>$ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
b7:6b:33:7c:04:ea:d5:43:bc:6c:1d:b1:3c:b3:a5:59 oracle@node2
node2</home/oracle>$
node2</home/oracle>$ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_dsa.
Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
ae:0a:a7:a7:4c:d3:50:3f:7e:e8:11:8e:53:ea:97:47 oracle@node2
1.7.3所有节点查看相关信息
Node1
node1</home/oracle/.ssh>$pwd
/home/oracle/.ssh
node1</home/oracle/.ssh>$ls –alh
total 24K
drwx------ 2 oracle dba 4.0K Nov 3 10:34 .
drwx------ 23 oracle dba 4.0K Nov 3 10:30 ..
-rw------- 1 oracle dba 668 Nov 3 10:34 id_dsa
-rw-r--r-- 1 oracle dba 602 Nov 3 10:34 id_dsa.pub
-rw------- 1 oracle dba 887 Nov 3 10:33 id_rsa
-rw-r--r-- 1 oracle dba 222 Nov 3 10:33 id_rsa.pub
Node2
node2</home/oracle/.ssh>$pwd
/home/oracle/.ssh
node2</home/oracle/.ssh>$ls –alh
total 24K
drwx------ 2 oracle dba 4.0K Nov 3 10:45 .
drwx------ 20 oracle dba 4.0K Nov 3 10:31 ..
-rw------- 1 oracle dba 672 Nov 3 10:45 id_dsa
第 9 页,共 51 页
10. Dbabc.net Email : dba@dbabc.net
-----------------------------------------------------------------------------------------------------------------
-rw-r--r-- 1 oracle dba 602 Nov 3 10:45 id_dsa.pub
-rw------- 1 oracle dba 887 Nov 3 10:45 id_rsa
-rw-r--r-- 1 oracle dba 222 Nov 3 10:45 id_rsa.pub
1.7.4密钥分发
Node1
node1</home/oracle/.ssh>$ssh node1 cat
/home/oracle/.ssh/id_rsa.pub >>authorized_keys
The authenticity of host 'node1 (192.168.0.25)' can't be established.
RSA key fingerprint is f8:93:51:cd:af:ee:81:a0:f6:eb:b5:14:58:f2:a5:0a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node1,192.168.0.25' (RSA) to the list of known
hosts.
oracle@node1's password:
node1</home/oracle/.ssh>$ssh node1 cat
/home/oracle/.ssh/id_dsa.pub >>authorized_keys
node1</home/oracle/.ssh>$ssh node2 cat
/home/oracle/.ssh/id_rsa.pub >>authorized_keys
The authenticity of host 'node2 (192.168.0.26)' can't be established.
RSA key fingerprint is 30:84:8c:43:58:a3:0a:8d:07:49:d3:4c:51:37:18:91.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node2,192.168.0.26' (RSA) to the list of known
hosts.
oracle@node2's password:
node1</home/oracle/.ssh>$ssh node2 cat
/home/oracle/.ssh/id_dsa.pub >>authorized_keys
oracle@node2's password:
node1</home/oracle/.ssh>$
node1</home/oracle/.ssh>$scp authorized_keys node2:/home/oracle/.ssh
oracle@node2's password:
authorized_keys 100% 1648 1.6KB/s 00:00
Node2
node2</home/oracle/.ssh>$ls –alh
total 28K
drwx------ 2 oracle dba 4.0K Nov 3 11:08 .
drwx------ 20 oracle dba 4.0K Nov 3 10:31 ..
-rw-r--r-- 1 oracle dba 1.7K Nov 3 11:08 authorized_keys
-rw------- 1 oracle dba 672 Nov 3 10:45 id_dsa
第 10 页,共 51 页