linux下一个Oracle11g RAC建立(五岁以下儿童)

四、建立主机之间的信任关系(node1、node2)

建立节点之间oracle 、grid 用户之间的信任(通过ssh 建立公钥和私钥)

分别在node1和node2创建

=====Oracle用户=========================

在oracle用户下操作:

[[email protected] /]# su - oracle

[[email protected] ~]$ mkdir .ssh       创建一个.ssh的隐藏文件夹

[[email protected] ~]$ 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下

[[email protected] ~]$ 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:[email protected]

node1生成密钥dsa类型

id_dsa为私钥。自己主动保存到.ssh下

id_dsa.pub为公钥,自己主动保存到.ssh下

[[email protected] ~]$ 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:[email protected]

node2生成密钥rsa类型

id_rsa为私钥。自己主动保存到.ssh下

id_rsa.pub为公钥,自己主动保存到.ssh下

[[email protected] asm]# su - oracle

[[email protected] ~]$ mkdir .ssh

[[email protected] ~]$ 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:[email protected]

node2生成密钥dsa类型

id_dsa为私钥。自己主动保存到.ssh下

id_dsa.pub为公钥,自己主动保存到.ssh下

[[email protected] ~]$ 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:[email protected]

2)配置信任关系(node1、node2)

为node1配置信任

[[email protected] ~]$ 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文件中

[[email protected] ~]$ cat.ssh/id_rsa.pub >>.ssh/authorized_keys

[[email protected] ~]$ cat.ssh/id_dsa.pub >>.ssh/authorized_keys

[[email protected] ~]$ ssh node2  cat .ssh/id_rsa.pub>>.ssh/authorized_keys

[email protected]‘s password:

[[email protected] ~]$ ssh
node2  cat .ssh/id_dsa.pub>>.ssh/authorized_keys

[email protected]‘s password:  oracle的密码

为node2配置信任

能够把node1中的authorized_keys(密钥文件)拷贝到node2中

[[email protected] ~]$ scp.ssh/authorized_keys   node2:~/.ssh

[email protected]‘s password: oracle的密码

3)验证信任关系(node1、node2)

node1上验证信任

[[email protected] ~]$ ssh
node2date

[[email protected] ~]$ ssh
node2-privdate    
//私有ip地址验证

[[email protected] ~]$ ssh
node1date

[[email protected] ~]$ ssh
node1-privdate    

具体操作例如以下:

[[email protected] ~]$ ssh node2date

Thu May  214:46:30 CST 2013

[[email protected] ~]$ 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

[[email protected] ~]$ sshnode2-priv date

Thu May  214:47:05 CST 2013

[[email protected] ~]$ ssh node1date

Thu May  214:48:19 CST 2013

[[email protected] ~]$ 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

[[email protected] ~]$ sshnode1-priv date

Thu May  214:48:36 CST 2013

node2上验证信任

[[email protected] ~]$ ssh
node1date

[[email protected]~]$ ssh
node1-priv date    

[[email protected] ~]$ ssh
node2date

[[email protected]~]$ ssh
node2-priv date    

=====Grid 用户==========================

步骤同oracle
一样,可參考oracle用户下设置

在grid用户下操作:

[[email protected] /]# su– grid

[[email protected] ~]$mkdir .ssh       创建一个.ssh的隐藏文件夹

[[email protected] ~]$ ls-al

1)生成密钥对(rsa+dsa)(node1、node2)

node1生成密钥rsa类型

id_rsa为私钥。自己主动保存到.ssh下

id_rsa.pub为公钥,自己主动保存到.ssh下

[[email protected] ~]$ 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:[email protected]

node1生成密钥dsa类型

id_dsa为私钥。自己主动保存到.ssh下

id_dsa.pub为公钥,自己主动保存到.ssh下

[[email protected] ~]$ 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:[email protected]

node2生成密钥rsa类型

id_rsa为私钥。自己主动保存到.ssh下

id_rsa.pub为公钥,自己主动保存到.ssh下

[[email protected] ~]# su – grid

[[email protected] ~]$ mkdir .ssh

[[email protected] ~]$ 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:[email protected]

node2生成密钥dsa类型

id_dsa为私钥,自己主动保存到.ssh下

id_dsa.pub为公钥。自己主动保存到.ssh下

[[email protected] ~]$ 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:[email protected]

2)配置信任关系(node1、node2)

为node1配置信任

[[email protected] ~]$ ls .ssh

id_dsa       id_rsa             id_dsa.pub   id_rsa.pub      known_hosts

rsa和dsa为私钥                .pub的为公钥

[[email protected] ~]$ cat.ssh/id_rsa.pub >>.ssh/authorized_keys

[[email protected] ~]$ cat.ssh/id_dsa.pub >>.ssh/authorized_keys

[[email protected] ~]$ ssh node2  cat .ssh/id_rsa.pub>>.ssh/authorized_keys

[email protected]‘s password:

[[email protected] ~]$ ssh
node2  cat .ssh/id_dsa.pub >>.ssh/authorized_keys

[email protected]‘s password: grid的密码

为node2配置信任

能够把node1中的authorized_keys(密钥文件)拷贝到node2中

[[email protected] ~]$ scp.ssh/authorized_keys  
node2:~/.ssh

[email protected]‘s password: grid的密码

authorized_keys                             100% 1992     2.0KB/s  00:00

3)验证信任关系(node1、node2)

node1上验证信任

[[email protected] ~]$ ssh
node2date

[[email protected] ~]$ ssh
node2-privdate    

[[email protected] ~]$ ssh
node1date

[[email protected] ~]$ ssh
node1-privdate    

具体操作例如以下:

[[email protected] ~]$ ssh node2date

Thu May  214:46:30 CST 2013

[[email protected] ~]$ 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

[[email protected] ~]$ sshnode2-priv date

Thu May  214:47:05 CST 2013

[[email protected] ~]$ ssh node1date

Thu May  214:48:19 CST 2013

[[email protected] ~]$ 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

[[email protected] ~]$ sshnode1-priv date

Thu May  214:48:36 CST 2013

node2上验证信任

[[email protected] ~]$ ssh
node1date

[[email protected]~]$ ssh
node1-priv date    

[[email protected] ~]$ ssh
node2date

[[email protected]~]$ ssh
node2-priv date    

声明:

原创作品。出自 “深蓝的blog” 博客。同意转载。转载时请务必注明出处(http://blog.csdn.net/huangyanlong)。

关于涉及版权事宜,作者有权追究法律责任。

************************** 未完待续 敬请关注 **************************************

版权声明:本文博主原创文章,博客,未经同意不得转载。

时间: 2024-10-23 17:08:25

linux下一个Oracle11g RAC建立(五岁以下儿童)的相关文章

Linux下搭建Oracle11g RAC(3)----创建用户及配置相关文件

配置11gR2 RAC需要安装Oracle Grid Infrastructure软件.Oracle数据库软件,其中Grid软件等同于Oracle 10g的Clusterware集群件.Oracle建议以不同的用户分别安装Grid Infrastructure软件.Oracle数据库软件,我们这里以grid用户安装Grid Infrastructure,oracle用户安装Oracle数据库软件.并且grid.oracle用户需要属于不同的用户组.在配置RAC时,还要求这两个用户在RAC的不同节

Linux下搭建Oracle11g RAC(5)----配置ASM磁盘

将共享磁盘格式化.然后用asmlib将其配置为ASM磁盘,用于将来存放OCR.Voting Disk和数据库用. 注意:只需在其中1个节点上格式化就可以,接下来我们选择在node1节点上格式化. 这里我们以asmlib软件来创建ASM磁盘,而不使用raw disk,而且从11gR2开始,OUI的图形界面已经不再支持raw disk. 格式化共享磁盘 ① 以root用户分别在两个节点上执行fdisk命令,查看现有硬盘分区信息: node1: [[email protected] ~]# fdisk

Linux下搭建Oracle11g RAC(1)----IP分配与配置IP

首先需要说明的,我的RAC搭建不是在虚拟机上完成的,而是在实际部署中,二者之间有些许差异,本人水平有限,请见谅. 其中,每台机器至少需要配置3个IP地址,在安装操作系统的过程中,我们需要配置公网IP和私有IP即可,虚拟IP在安装集群件时分配. Public IP.Virtual IP.SCAN IP必须配置在同一网段. private IP与他们不能在同一网段内. SCAN IP是Oracle 11g新推出的,在配置11g RAC时需要指定. Hostname Short Hostname Ty

Linux下搭建Oracle11g RAC(6)----安装Grid Infrastructure

从此步骤开始,我们正式安装Grid软件: ① 以grid用户登录图形界面,执行/home/grid/grid/runInstaller,进入OUI的图形安装界面: ② 进入OUI安装界面后,选择第3项,跳过软件更新,Next: ③ 选择集群的Grid Infrastructure,Next: ④ 选择 advanced Installation,Next: ⑤ 语言选择默认,English,Next: ⑥ 去掉Configure GNS选项,按照之前表格输入Cluster Name:scan-c

Linux下搭建Oracle11g RAC(4)----配置oracle,grid用户SSH对等性

虽然在安装软件的过程中,oracle会自动配置SSH对等性,建议在安装软件之前手工配置. 配置oracle用户对等性: node1: [[email protected] ~]# su - oracle node1-> env | grep ORA ORACLE_UNQNAME=devdb ORACLE_SID=devdb1 ORACLE_BASE=/u01/app/oracle ORACLE_HOSTNAME=node1.localdomain ORACLE_TERM=xterm ORACLE

Linux下安装Oracle11G R2过程中遇到的问题

Linux下安装Oracle11G R2过程中遇到了几个问题,希望对大家有所帮助. 如何在linux图形化安装oracle?? 解决方法和思路: 1)可以通过安装VNC服务. 2)如果你在服务器离你很近,你直接在桌面下安装即可.(前提是linux安装了图形化桌面程序) 3)通过Xmanager Enterprise直接远程调用桌面来安装. 我采用第三种 2.   Oracle界面乱码,出现各种方格子?? 原因及解决方法:系统语言环境及字体问题. 可以安装中易宋体18030,可以解决乱码问题:或者

Linux下一个简单的日志系统的设计及其C代码实现

1.概述 在大型软件系统中,为了监测软件运行状况及排查软件故障,一般都会要求软件程序在运行的过程中产生日志文件.在日志文件中存放程序流程中的一些重要信息, 包括:变量名称及其值.消息结构定义.函数返回值及其执行情况.脚本执行及调用情况等.通过阅读日志文件,我们能够较快地跟踪程序流程,并发现程序问题. 因此,熟练掌握日志系统的编写方法并快速地阅读日志文件,是对一个软件开发工程师的基本要求. 本文详细地介绍了Linux下一个简单的日志系统的设计方法,并给出了其C代码实现.本文为相关开发项目Linux

(轉載)Linux下安装Oracle11g服务器

轉載:http://www.cnblogs.com/zhangyongli2011/archive/2012/04/04/2431953.html 安装环境 Linux服务器:SuSe10 sp2 64位 Oracle服务器:Oracle11gR2 64位 系统要求 Linux安装Oracle系统要求 系统要求 说明 内存 必须高于1G的物理内存 交换空间 一般为内存的2倍,例如:1G的内存可以设置swap 分区为3G大小 硬盘 5G以上 2.修改操作系统核心参数 在Root用户下执行以下步骤:

Linux下安装Oracle11g服务器【转】

Linux下安装Oracle11g服务器[转] 出处:http://www.cnblogs.com/zhangyongli2011/ 安装环境 Linux服务器:SuSe10 sp2 64位 Oracle服务器:Oracle11gR2 64位 系统要求 Linux安装Oracle系统要求 系统要求 说明 内存 必须高于1G的物理内存 交换空间 一般为内存的2倍,例如:1G的内存可以设置swap 分区为3G大小 硬盘 5G以上 2.修改操作系统核心参数 在Root用户下执行以下步骤: 1)修改用户