linux下一个Oracle11g RAC建立(五岁以下儿童)
linux下一个Oracle11g RAC建立(五岁以下儿童)
四、建立主机之间的信任关系(node1、node2)
建立节点之间oracle 、grid 用户之间的信任(通过ssh 建立公钥和私钥)
分别在node1和node2创建
=====Oracle用户=========================
在oracle用户下操作:
[root@node1 /]# su - oracle
[oracle@node1 ~]$ mkdir .ssh 创建一个.ssh的隐藏文件夹
[oracle@node1 ~]$ ls -al
total 44
-rw-r--r-- 1 oracle oinstall 33 Jul 12 17:05 .bash_logout
-rw-r--r-- 1 oracle oinstall 438 Jul 12 18:03 .bash_profile
drwxr-xr-x 4 oracle oinstall 4096 Jul 1217:05 .mozilla
drwx------ 2 oracle oinstall 4096 Jul 1218:05 .ssh
-rw------- 1 oracle oinstall 657 Jul 12 18:03 .viminfo
1)生成密钥对(rsa+dsa)(node1、node2)
node1生成密钥rsa类型
id_rsa为私钥。自己主动保存到.ssh下
id_rsa.pub为公钥。自己主动保存到.ssh下
[oracle@node1 ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key(/home/oracle/.ssh/id_rsa): enter
Enter passphrase (empty for nopassphrase): enter
Enter same passphrase again: enter
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:
64:a6:4a:77:db:33:a4:aa:6e:ca:8f:5f:2f:77:0f:40oracle@node1
node1生成密钥dsa类型
id_dsa为私钥。自己主动保存到.ssh下
id_dsa.pub为公钥,自己主动保存到.ssh下
[oracle@node1 ~]$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key(/home/oracle/.ssh/id_dsa): enter
Enter passphrase (empty for no passphrase):enter
Enter same passphrase again: enter
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:
7c:41:b5:0f:81:06:ad:30:07:4f:8b:1a:9b:94:68:14oracle@node1
node2生成密钥rsa类型
id_rsa为私钥。自己主动保存到.ssh下
id_rsa.pub为公钥,自己主动保存到.ssh下
[oracle@node2 asm]# su - oracle
[oracle@node2 ~]$ mkdir .ssh
[oracle@node2 ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key(/home/oracle/.ssh/id_rsa): enter
Enter passphrase (empty for nopassphrase): enter
Enter same passphrase again: enter
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:
64:a6:4a:77:db:33:a4:aa:6e:ca:8f:5f:2f:77:0f:40oracle@node1
node2生成密钥dsa类型
id_dsa为私钥。自己主动保存到.ssh下
id_dsa.pub为公钥,自己主动保存到.ssh下
[oracle@node2 ~]$ ssh-keygen -tdsa
Generatingpublic/private dsa key pair.
Enter file inwhich to save the key (/home/oracle/.ssh/id_dsa): enter
Enter passphrase(empty for no passphrase): enter
Enter samepassphrase again: enter
Youridentification has been saved in /home/oracle/.ssh/id_dsa.
Your public keyhas been saved in /home/oracle/.ssh/id_dsa.pub.
The keyfingerprint is:
7c:41:b5:0f:81:06:ad:30:07:4f:8b:1a:9b:94:68:14oracle@node1
2)配置信任关系(node1、node2)
为node1配置信任
[oracle@node1 ~]$ ls .ssh
id_dsa id_rsa id_dsa.pub id_rsa.pub
//rsa和dsa为私钥 .pub的为公钥
//ssh下文件authorized_keys是专门存储公钥信息的
//把rsa、dsa类型的公钥文件都放入到authorized_keys文件中
// “ssh node2”命令代表登陆到节点2下操作
//把两种类型的公钥信息都放到节点2的authorized_keys文件中
[oracle@node1 ~]$ cat.ssh/id_rsa.pub >>.ssh/authorized_keys
[oracle@node1 ~]$ cat.ssh/id_dsa.pub >>.ssh/authorized_keys
[oracle@node1 ~]$ ssh node2 cat .ssh/id_rsa.pub>>.ssh/authorized_keys
oracle@node2's password:
[oracle@node1 ~]$ ssh
node2 cat .ssh/id_dsa.pub>>.ssh/authorized_keys
oracle@node2's password: oracle的密码
为node2配置信任
能够把node1中的authorized_keys(密钥文件)拷贝到node2中
[oracle@node1 ~]$ scp.ssh/authorized_keys node2:~/.ssh
oracle@node2's password: oracle的密码
3)验证信任关系(node1、node2)
node1上验证信任
[oracle@node1 ~]$ ssh
node2date
[oracle@node1 ~]$ ssh
node2-privdate //私有ip地址验证
[oracle@node1 ~]$ ssh
node1date
[oracle@node1 ~]$ ssh
node1-privdate
具体操作例如以下:
[oracle@node1 ~]$ ssh node2date
Thu May 214:46:30 CST 2013
[oracle@node1 ~]$ sshnode2-priv date //不要求输入password代表信任成功
The authenticity of host 'node2-priv (10.10.10.2)'can't be established.
RSA key fingerprint is16:28:88:50:27:30:92:cb:49:be:55:61:f6:c2:a1:3f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node2-priv,10.10.10.2'(RSA) to the list of known hosts.
Thu May 214:47:03 CST 2013
[oracle@node1 ~]$ sshnode2-priv date
Thu May 214:47:05 CST 2013
[oracle@node1 ~]$ ssh node1date
Thu May 214:48:19 CST 2013
[oracle@node1 ~]$ sshnode1-priv date
The authenticity of host 'node1-priv (10.10.10.1)'can't be established.
RSA key fingerprint is39:04:88:3b:54:34:3c:34:d2:df:74:37:fe:5f:92:2d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node1-priv,10.10.10.1'(RSA) to the list of known hosts.
Thu May 214:48:35 CST 2013
[oracle@node1 ~]$ sshnode1-priv date
Thu May 214:48:36 CST 2013
node2上验证信任
[oracle@node2 ~]$ ssh
node1date
[oracle@node2~]$ ssh
node1-priv date
[oracle@node2 ~]$ ssh
node2date
[oracle@node2~]$ ssh
node2-priv date
=====Grid 用户==========================
步骤同oracle
一样,可參考oracle用户下设置
在grid用户下操作:
[root@node1 /]# su– grid
[grid@node1 ~]$mkdir .ssh 创建一个.ssh的隐藏文件夹
[grid@node1 ~]$ ls-al
1)生成密钥对(rsa+dsa)(node1、node2)
node1生成密钥rsa类型
id_rsa为私钥。自己主动保存到.ssh下
id_rsa.pub为公钥,自己主动保存到.ssh下
[grid@node1 ~]$ ssh-keygen-t rsa
Generating public/private rsa key pair.
Enter file in which to save the key(/home/oracle/.ssh/id_rsa):
enter
Enter passphrase (empty for no passphrase): enter
Enter same passphrase again: enter
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:
64:a6:4a:77:db:33:a4:aa:6e:ca:8f:5f:2f:77:0f:40oracle@node1
node1生成密钥dsa类型
id_dsa为私钥。自己主动保存到.ssh下
id_dsa.pub为公钥,自己主动保存到.ssh下
[grid@node1 ~]$ ssh-keygen-t dsa
Generating public/private dsa key pair.
Enter file in which to save the key(/home/oracle/.ssh/id_dsa): enter
Enter passphrase (empty for no passphrase): enter
Enter same passphrase again: enter
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:
7c:41:b5:0f:81:06:ad:30:07:4f:8b:1a:9b:94:68:14oracle@node1
node2生成密钥rsa类型
id_rsa为私钥。自己主动保存到.ssh下
id_rsa.pub为公钥,自己主动保存到.ssh下
[root@node2 ~]# su – grid
[grid@node2 ~]$ mkdir .ssh
[grid@node2 ~]$ ssh-keygen-t rsa
Generating public/private rsa key pair.
Enter file in which to save the key(/home/oracle/.ssh/id_rsa):
enter
Enter passphrase (empty for no passphrase): enter
Enter same passphrase again: enter
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:
64:a6:4a:77:db:33:a4:aa:6e:ca:8f:5f:2f:77:0f:40oracle@node1
node2生成密钥dsa类型
id_dsa为私钥,自己主动保存到.ssh下
id_dsa.pub为公钥。自己主动保存到.ssh下
[grid@node2 ~]$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key(/home/oracle/.ssh/id_dsa): enter
Enter passphrase (empty for no passphrase): enter
Enter same passphrase again: enter
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:
7c:41:b5:0f:81:06:ad:30:07:4f:8b:1a:9b:94:68:14oracle@node1
2)配置信任关系(node1、node2)
为node1配置信任
[grid@node1 ~]$ ls .ssh
id_dsa id_rsa id_dsa.pub id_rsa.pub known_hosts
rsa和dsa为私钥 .pub的为公钥
[grid@node1 ~]$ cat.ssh/id_rsa.pub >>.ssh/authorized_keys
[grid@node1 ~]$ cat.ssh/id_dsa.pub >>.ssh/authorized_keys
[grid@node1 ~]$ ssh node2 cat .ssh/id_rsa.pub>>.ssh/authorized_keys
grid@node2's password:
[grid@node1 ~]$ ssh
node2 cat .ssh/id_dsa.pub >>.ssh/authorized_keys
grid@node2's password: grid的密码
为node2配置信任
能够把node1中的authorized_keys(密钥文件)拷贝到node2中
[grid@node1 ~]$ scp.ssh/authorized_keys
node2:~/.ssh
grid@node2's password: grid的密码
authorized_keys 100% 1992 2.0KB/s 00:00
3)验证信任关系(node1、node2)
node1上验证信任
[grid@node1 ~]$ ssh
node2date
[grid@node1 ~]$ ssh
node2-privdate
[grid@node1 ~]$ ssh
node1date
[grid@node1 ~]$ ssh
node1-privdate
具体操作例如以下:
[grid@node1 ~]$ ssh node2date
Thu May 214:46:30 CST 2013
[grid@node1 ~]$ sshnode2-priv date //不要输入password为信任成功
The authenticity of host 'node2-priv (10.10.10.2)'can't be established.
RSA key fingerprint is 16:28:88:50:27:30:92:cb:49:be:55:61:f6:c2:a1:3f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node2-priv,10.10.10.2'(RSA) to the list of known hosts.
Thu May 214:47:03 CST 2013
[grid@node1 ~]$ sshnode2-priv date
Thu May 214:47:05 CST 2013
[grid@node1 ~]$ ssh node1date
Thu May 214:48:19 CST 2013
[grid@node1 ~]$ sshnode1-priv date
The authenticity of host 'node1-priv (10.10.10.1)'can't be established.
RSA key fingerprint is39:04:88:3b:54:34:3c:34:d2:df:74:37:fe:5f:92:2d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node1-priv,10.10.10.1'(RSA) to the list of known hosts.
Thu May 214:48:35 CST 2013
[grid@node1 ~]$ sshnode1-priv date
Thu May 214:48:36 CST 2013
node2上验证信任
[grid@node2 ~]$ ssh
node1date
[grid@node2~]$ ssh
node1-priv date
[grid@node2 ~]$ ssh
node2date
[grid@node2~]$ ssh
node2-priv date
声明:
原创作品。出自 “深蓝的blog” 博客。同意转载。转载时请务必注明出处(http://blog.csdn.net/huangyanlong)。
关于涉及版权事宜,作者有权追究法律责任。
************************** 未完待续 敬请关注 **************************************
版权声明:本文博主原创文章,博客,未经同意不得转载。
linux下一个Oracle11g RAC建立(五岁以下儿童)的更多相关文章
- linux下一个Oracle11g RAC建立(四)
linux下一个Oracle11g RAC建立(四) 三.配置共享存储 配置ASM管理准备 1)OCRDISK :存储CRS资源配置信息 2)VOTEDISK:仲裁盘.记录节点状态 3)DataDis ...
- linux下一个Oracle11g RAC建立(八)
linux下一个Oracle11g RAC建立(八) 七.安装oracle软件 直接在图形界面里安装oracle.在node1操作 在虚拟机界面中,直接切换到oracle用户下: [grid@no ...
- linux下一个oracle11G DG建立(一个):准备环境
linux下一个oracle11G DG建立(一个):准备环境 周围环境 名称 主库 备库 主机名 bjsrv shsrv 软件版本号 RedHat Enterprise5.5.Oracle 11g ...
- Linux下搭建Oracle11g RAC(2)----配置DNS服务器,确认SCAN IP可以被解析
从Oracle 11gR2开始,引入SCAN(Single Client Access Name) IP的概念,相当于在客户端和数据库之间增加一层虚拟的网络服务层,即是SCAN IP和SCAP IP ...
- Linux下搭建Oracle11g RAC(5)----配置ASM磁盘
将共享磁盘格式化.然后用asmlib将其配置为ASM磁盘,用于将来存放OCR.Voting Disk和数据库用. 注意:只需在其中1个节点上格式化就可以,接下来我们选择在node1节点上格式化. 这里 ...
- Linux下搭建Oracle11g RAC(3)----创建用户及配置相关文件
配置11gR2 RAC需要安装Oracle Grid Infrastructure软件.Oracle数据库软件,其中Grid软件等同于Oracle 10g的Clusterware集群件.Oracle建 ...
- Linux下搭建Oracle11g RAC(9)----创建RAC数据库
接下来,使用DBCA来创建RAC数据库. ① 以oracle用户登录图形界面,执行dbca,进入DBCA的图形界面,选择第1项,创建RAC数据库: ② 选择创建数据库选项,Next: ③ 选择创建通用 ...
- Linux下搭建Oracle11g RAC(8)----创建ASM磁盘组
以grid用户创建ASM磁盘组,创建的ASM磁盘组为下一步创建数据库提供存储. ① grid用户登录图形界面,执行asmca命令来创建磁盘组: ② 进入ASMCA配置界面后,单击Create,创建新的 ...
- Linux下搭建Oracle11g RAC(7)----安装Oracle 软件
从此步骤开始,我们正式安装oracle软件: ① 以oracle用户登录图形界面,执行/home/oracle/database/runInstaller,进入OUI的图形安装界面: ② 进入OUI安 ...
随机推荐
- python+ueditor+七牛云存储整合
开发环境:python pyramid. 參考网址:http://developer.qiniu.com/docs/v6/sdk/python-sdk.html,http://my.oschina.n ...
- python实现人人网用户数据爬取及简单分析
这是之前做的一个小项目.这几天刚好整理了一些相关资料,顺便就在这里做一个梳理啦~ 简单来说这个项目实现了,登录人人网并爬取用户数据.并对用户数据进行分析挖掘,终于效果例如以下:1.存储人人网用户数据( ...
- HDU 3699 A hard Aoshu Problem (暴力搜索)
题意:题意:给你3个字符串s1,s2,s3;要求对三个字符串中的字符赋值(同样的字符串进行同样的数字替换), 替换后的三个数进行四则运算要满足左边等于右边.求有几种解法. Sample Input 2 ...
- android-包签名
android-包签名 应用能在Android 系统上安装必须是经过有私有key的证书数据签名.Android系统通过证书确定应用的作者,和与应用建立信任关系.证书不会用于控制应用的安装.证书不需要权 ...
- cookie是指web浏览器存储的少量数据,该数据会在每次请求一个相关的URL时自动传到服务器中(转)
基本概念:cookie是指web浏览器存储的少量数据,该数据会在每次请求一个相关的URL时自动传到服务器中. 以博客园为例,我们看看cookie有哪些属性: 1.Name:cookie的名称: 2.V ...
- leetcode 之 Permutation Sequence
Permutation Sequence The set [1,2,3,-,n] contains a total of n! unique permutations. By listing and ...
- 基于.net开发chrome核心浏览器【二】
原文:基于.net开发chrome核心浏览器[二] 一: 上一篇的链接: 基于.net开发chrome核心浏览器[一] 二: 相关资源介绍: chrome Frame: 让IE有一颗chrome的心, ...
- POJ 1205 Water Treatment Plants(递推)
题意 建设一条河岸的污水处理系统 河岸有n个城市 每一个城市都能够自己处理污水 V 也能够把污水传到相邻的城市处理 >或< 除了你传给我我也传给你这样的情况 其他都是 ...
- 二叉树的建立与遍历(山东理工OJ)
题目描写叙述 已知一个按先序序列输入的字符序列,如abc,,de,g,,f,,,(当中逗号表示空节点).请建立二叉树并按中序和后序方式遍历二叉树,最后求出叶子节点个数和二叉树深度. 输入 输入一个长度 ...
- android选择和裁剪图像拍摄的图像
转载请注明出处:http://blog.csdn.net/allen315410/article/details/39994913 近期从曾经的项目中扒下来一个经常使用的模块.在这里有必要记录一下的. ...