10GRACRAW+ASMrhel-server-5.5-x86_64(二)

2015-01-27 18:09:01 · 作者: · 浏览: 113
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: d8:88:23:9b:6f:cd:74:81:8f:f9:13:16:98:5f:8a:8f oracle@rh1 节点2执行相同操作 [oracle@rh2 ~]$ ssh-keygen -t rsa [oracle@rh2 ~]$ ssh-keygen -t dsa

?

节点1

[oracle@rh1 ~]$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys

[oracle@rh1 ~]$ cat .ssh/id_dsa.pub >> .ssh/authorized_keys

[oracle@rh1 ~]$ ssh rh2 cat .ssh/id_rsa.pub >> .ssh/authorized_keys 这一步是将节点2的id_rsa.pub追加写入到节点1的authorized_keys文件里

oracle@rh2's password:

[oracle@rh1 ~]$ ssh rh2 cat .ssh/id_dsa.pub >> .ssh/authorized_keys

oracle@rh2's password:

[oracle@rh1 ~]$ scp .ssh/authorized_keys rh2:~/.ssh 将写有节点1和节点2密码文件的authorized_keys拷贝到节点2,两边就都拥有密钥了

oracle@rh2's password:

authorized_keys 100% 1988 1.9KB/s 00:00


验证信任关系

ssh rh1 date

ssh rh1-priv date

ssh rh2 date

ssh rh2-priv date

两个节点都要验证


五.修改系统参数

[root@rh1:/root]# vi /etc/sysctl.conf 在最后添加下面的参数

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmall = 2097152

kernel.shmmax = 536870912

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048586

[root@rh1:/root]# sysctl -p 立即生效



[root@rh1:/root]# vi /etc/security/limits.conf 限制用户访问的CPU和内存资源

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

oracle soft stack 10240

?

?

[root@rh1:/root]# vi /etc/pam.d/login linux操作系统的登陆配置文件

添加

session required /lib/security/pam_limits.so 当用户登陆以后自动启用上面的限制

?

[root@rh1:/root]# vi /etc/profile

添加

?

if [ $USER = "oracle" ]; then

if [ $SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

fi


六.时间同步

用ntp

vi /etc/ntp.conf

节点1做服务端

broadcastclient

driftfile /var/lib/ntp/drift

server 127.127.1.0

节点2为客户端

driftfile /var/lib/ntp/drift

server 192.168.6.103 节点1的IP

?

使NTP服务可以在系统引导的时候自动启动,执行:

# chkconfig ntpd on

启动/关闭/重启NTP的命令:

# /etc/init.d/ntpd start

# /etc/init.d/ntpd stop

# /etc/init.d/ntpd restart

#service ntpd restart

将同步好的时间写到CMOS里

vi /etc/sysconfig/ntpd

SYNC_HWCLOCK=yes

?

每次修改了配置文件后都需要重新启动服务来使配置生效。

可以使用下面的命令来检查NTP服务是否启动,你应该可以得到一个进程ID号:

# pgrep ntpd

使用下面的命令检查时间服务器同步的状态:

# ntpq -p

用ntpstat 也可以查看一些同步状态,用netstat -ntlup查看端口使用情况!

?

安装完毕客户端需过5-10分钟才能从服务器端更新时间!

?

一些补充和拾遗(挺重要)

?

1. 配置文件中的driftfile是什么?

我们每一个system clock的频率都有小小的误差,这个就是为什么机器运行一段时间后会不精确. NTP会自动来监测我们时钟的误差值并予以调整.但问题是这是一个冗长的过程,所以它会把记录下来的误差先写入driftfile.这样即使你重新开机以后之前的计算结果也就不会丢失了

?

2. 如何同步硬件时钟?

NTP一般只会同步system clock. 但是如果我们也要同步RTC(hwclock)的话那么只需要把下面的选项打开就可以了

代码:

# vi /etc/sysconfig/ntpd

SYNC_HWCLOCK=yes


七.格式化分区

?

ocr 我们要划分成2个100M,分别来存放ocr配置文件,votingdisk我们要分成3个100M的。 Asm4data 要分成两个,10G 存放数据文件,5G 用在flashback上。 Backup 我们分成一个区。

在一个结点执行格式化就可以了,因为他们是共享的。

[root@rh1 soft]# fdisk /dev/sdc

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel. Changes will remain in memory only,

until you decide to write them. After that, of course, the previous

content won't be recoverable