1.1 配置主机名
分别在四个节点(linux001 linux002 linux003 linux004)上编辑/etc/hosts文件【每个节点内容一致】
1: [root@linux001 ~]# vi /etc/hosts
2: # Do not remove the following line, or various programs
3: # that require network functionality will fail.
4: 127.0.0.1 linux001 localhost.localdomain localhost
5: ::1 localhost6.localdomain6 localhost6i 172.23.176.103 linux001
6: 172.23.176.101 linux002
7: 172.23.176.104 linux003
8: 172.23.176.102 linux004
其中172.23.176.103 linux001;127.23.176.101 linux002;127.23.176.104 linux003;127.23.176.102 linux004.为所添加的内容,在每天服务器上执行同样的操作。编辑完以后安装Esc键后按shift +:建后输入wq!保存退出。
1.2配置ssh互信
以linux001和linux002为例。首先配置linux002免密码登录linux001.在linux001上执行:
1: [root@linux001]$ >ssh-keygen -t dsa
2: Generating public/private dsa key pair.
3: Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
4: Created directory ‘/home/oracle/.ssh’.
5: Enter passphrase (empty for no passphrase):
6: Enter same passphrase again:
7: Your identification has been saved in /home/oracle/.ssh/id_dsa.
8: Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
9: [root@linux001]>cd /root/.ssh
10: [root@linux001]>mv id_dsa.pub linux001.pub
11: [root@linux001]>scp linux001.pub root@linux002:/root/.ssh
12: 在linux002上执行
13: [root@linux002]> cd /root/.ssh
14: [root@linux002]cat linux001.pub >> authorized_keys
15: [root@linux002]chmod 600 authorized_keys
16: [root@linux002]cd …
17: [root@linux002] chmod 700 .ssh
配置linux001免密码登录linux002,在linux002上执行:
1: [root@linux002]$ >ssh-keygen -t dsa
2: Generating public/private dsa key pair.
3: Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
4: Created directory ‘/home/oracle/.ssh’.
5: Enter passphrase (empty for no passphrase):
6: Enter same passphrase again:
7: Your identification has been saved in /home/oracle/.ssh/id_dsa.
8: Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
9: [root@linux002]>cd /root/.ssh
10: [root@linux002]>mv id_dsa.pub linux001.pub
11: [root@linux002]>scp linux001.pub root@linux001:/root/.ssh
在linux001上执行
1: [root@linux001]> cd /root/.ssh
2: [root@linux001]cat linux001.pub >> authorized_keys
3: [root@linux001]chmod 600 authorized_keys
4: [root@linux002]cd …
5: [root@linux001] chmod 700 .ssh
其它机器linux001和linux003相互之间,linux001和linux004相互之间,linux002和linux004相互之间,linux002和linux003相互之间,linux003和linux004相互之间配置方法以此类似(一共需要配置12次)。
2 多路径配置
2.1 相关软件包
所需相关软件包
device-mapper-1.02.13-6.9.i586.rpm
该软件运行在底层,主要进行设备虚拟化和映射。
multipath-tools-0.4.7-34.18.i586.rpm,这个软件包可以在
多路径的管理和监控工具,主要进行路径状态的检测,管理工作
查看软件是否安装,如果没有则安装。(所有4台机器上操作)
[root@linux001] rpm -qa | grep device-mapper(查看device-mapper是否安装,如果没有任何提示,则通过zypper install 软件名安装)
[root@linux001] rpm -qa | grep multipath-tool(查看device-mapper是否安装,如果没有任何提示,则通过zypper install 软件名安装)
安装命令:
[root@linux001] zypper install device-mapper
[root@linux001] zypper install multipath