Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2839972
  • 博文数量: 599
  • 博客积分: 16398
  • 博客等级: 上将
  • 技术积分: 6875
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-30 12:04
个人简介

WINDOWS下的程序员出身,偶尔也写一些linux平台下小程序, 后转行数据库行业,专注于ORACLE和DB2的运维和优化。 同时也是ios移动开发者。欢迎志同道合的朋友一起研究技术。 数据库技术交流群:58308065,23618606

文章分类

全部博文(599)

文章存档

2014年(12)

2013年(56)

2012年(199)

2011年(105)

2010年(128)

2009年(99)

分类: Oracle

2009-12-07 22:03:53

4. 创建并配置第二个虚拟机

要创建第二个虚拟机,只需关闭第一个虚拟机,将 d:\vm\rac\rac1 中的所有文件复制到 d:\vm\rac\rac2,然后更改几个配置即可。

修改网络配置。
  1. 在 rac1 上,以 root 用户身份执行
    # shutdown –h now
  2. 在主机系统上,将 rac1 文件夹中的所有文件复制到 rac2。
    D:\>copy d:\vm\rac\rac1 d:\vm\rac\rac2
  3. 在 VMware Server 控制台上,按 CTRL-O 打开第二个虚拟机 d:\rac\rac2\Red Hat Enterprise Linux 4.vmx。
  4. VMware Server 控制台:
    • 将虚拟机名称从 rac1 重命名为 rac2。右键单击您刚才打开的新 rac1 选项卡,然后选择 Settings
      • 选择 Options 选项卡。
        1. 虚拟机名称:输入“rac2”。

图 5

  • 单击 Start this virtual machine 启动 rac2,保留 rac1 为电源关闭状态。
  • rac2 — 虚拟机:选择 Create a new identifier
  1. 以 root 用户身份登录并执行 system-config-network,以修改网络配置。

    IP 地址:双击每个以太网设备,并使用下面的表进行必要的更改。

    设备 IP 地址 子网掩码 默认网关地址
    eth0 192.168.2.132 255.255.255.0 192.168.2.1
    eth1 10.10.10.32 255.255.255.0 <保留空白>

    MAC 地址:导航到 Hardware Device 选项卡,并探测每个以太网设备的新 MAC 地址。

    主机名和 DNS:使用下面的表对 DNS 选项卡中的项进行必要的更改,然后按 CTRL-S 保存。

    主机名 首选 DNS 备用 DNS DNS 搜索路径
    rac2.mycorpdomain.com 输入 DNS IP 地址或保留空白。 输入 DNS IP 地址或保留空白。 接受默认设置或保留空白。

    最后,激活每个以太网设备。

修改 /etc/hosts。将以下项添加到 /etc/hosts 中。

127.0.0.1 localhost

稍后,在 Oracle 集群件软件安装期间,VIPCA 将尝试使用回送地址。

修改 /export/home/oracle/.profile。用 devdb2 替换 ORACLE_SID 的值。

使用 SSH 建立用户等效性。在集群就绪服务 (CRS) 和 RAC 安装过程中,Oracle Universal Installer (OUI) 必须能够以 oracle 的身份将软件复制到所有 RAC 节点,而不提示输入口令。在 Oracle 10g 中,可以使用 ssh 代替 rsh 完成此操作。

要建立用户等效性,请在两个节点上以 oracle 用户身份生成用户的公钥和私钥。打开 rac1 的电源,在这两个节点上执行以下任务。
在 rac1 上执行

rac1-> mkdir ~/.ssh
rac1-> chmod 700 ~/.ssh
rac1-> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/oracle/.ssh/id_rsa.
Your public key has been saved in /export/home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
87:54:4f:92:ba:ed:7b:51:5d:1d:59:5b:f9:44:da:b6 oracle@rac1.mycorpdomain.com
rac1-> ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/oracle/.ssh/id_dsa.
Your public key has been saved in /export/home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
31:76:96:e6:fc:b7:25:04:fd:70:42:04:1f:fc:9a:26 oracle@rac1.mycorpdomain.com	

在 rac2 上执行

rac2-> mkdir ~/.ssh
rac2-> chmod 700 ~/.ssh
rac2-> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/oracle/.ssh/id_rsa.
Your public key has been saved in /export/home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
29:5a:35:ac:0a:03:2c:38:22:3c:95:5d:68:aa:56:66 oracle@rac2.mycorpdomain.com
rac2-> ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/oracle/.ssh/id_dsa.
Your public key has been saved in /export/home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
4c:b2:5a:8d:56:0f:dc:7b:bc:e0:cd:3b:8e:b9:5c:7c oracle@rac2.mycorpdomain.com
在 rac1 上执行
rac1-> cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
rac1-> cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
rac1-> ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
The authenticity of host 'rac2 (192.168.2.132)' can't be established.
RSA key fingerprint is 63:d3:52:d4:4d:e2:cb:ac:8d:4a:66:9f:f1:ab:28:1f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac2,192.168.2.132' (RSA) to the list of known hosts.
oracle@rac2's password:
rac1-> ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
oracle@rac2's password:
rac1-> scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys
oracle@rac2's password:
authorized_keys                           100% 1716     1.7KB/s   00:00
在每个节点上测试连接。验证当您再次运行以下命令时,系统是否不提示您输入口令。
ssh rac1 date
ssh rac2 date
ssh rac1-priv date
ssh rac2-priv date
ssh rac1.mycorpdomain.com date
ssh rac2.mycorpdomain.com date
ssh rac1-priv.mycorpdomain.com date
ssh rac2-priv.mycorpdomain.com date
阅读(1652) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~