NTP 配置
两个节点检查是否安装ntp
rpm -q ntp
///如果没安装就yum -y install ntp 进行安装///
systemctl enable ntpd systemctl enable ntpd.service 设置开机启动ntp
systemctl start ntpd 启动ntp
systemctl status ntpd 查看ntp状态
-----racdb1 作为NTP服务端和客户端配置---------
vi /etc/ntp.conf
# 外部时间服务器不可用时,以本地时间作为时间服务
server 127.127.1.0
fudge 127.127.1.0 stratum 10
#允许内网其他机器同步时间,如果不添加该约束默认允许所有IP访问本机同步服务
restrict 192.168.61.0 mask 255.255.255.0 nomodify notrap
# 配置和上游标准时间同步
server 101.201.72.121 # 中国国家授时中心
server 133.100.11.8 #日本[福冈大学]
server 3.cn.pool.ntp.org
server 1.asia.pool.ntp.org
server 3.asia.pool.ntp.org
# 允许上层时间服务器主动修改本机时间
restrict 101.201.72.121 nomodify notrap noquery
restrict 133.100.11.8 nomodify notrap noquery
restrict 3.cn.pool.ntp.org nomodify notrap noquery
restrict 1.asia.pool.ntp.org nomodify notrap noquery
restrict 3.asia.pool.ntp.org nomodify notrap noquery
vi /etc/sysconfig/ntpd
#此选项用于自动校准系统时钟与硬件时钟
SYNC_HWCLOCK=yes
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"
完后重启 systemctl restart ntpd
ntpq -p查看网络中的NTP服务器
ntpstat 同步有个过程,几分钟后在执行,出现下图才算同步成功
------racdb2 作为NTP客户端配置------
vi /etc/ntp.conf
添加:
#允许racdb1 ntp 服务器主动修改本机的时间
restrict 192.168.61.219 nomodify notrap noquery
#设置 racdb1作为ntp服务器
server 192.168.61.219
vi /etc/sysconfig/ntpd
#此选项用于自动校准系统时钟与硬件时钟
SYNC_HWCLOCK=yes
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"
systemctl restart ntpd 重启ntp服务
ntpq –p 查看网络中的NTP服务器为racdb1
systemctl enable ntpd
systemctl enable ntpd.service 设置开机启动ntp
设置 SSH 信任关系,保证两个节点的互通性
在grid Infrastructure安装过程中,oracle universal installer(oui)必须能够以grid的身份自动将然间复制到所有rac节点,这里我们各个节点配置ssh信任关系,让oracle、grid用户可以有访问各个节点不输入密码的能力。
---配置 oracle用户ssh信任关系
-------racdb1配置oracle用户 ssh信任关系------
su - oracle
mkdir ~/.ssh
chmod 755 ~/.ssh
/usr/bin/ssh-keygen -t rsa
/usr/bin/ssh-keygen -t dsa
配置key文件同步,racdb1把认证文件id_rsa.pub、id_dsa.pub文件汇总成一个总的认证文件authorized_keys,authorized_keys远程复制到racdb2
cd ~/.ssh
cat ~/.ssh/id_rsa.pub >> authorized_keys
cat ~/.ssh/id_dsa.pub >> authorized_keys
先去 oracledb2切换到oracle用户创建目录,racdb1再进行复制
[root@racdb2 rules.d]# su – oracle
[oracle@racdb2 ~]$ mkdir ~/.ssh
[oracle@racdb2 ~]$ chmod 755 ~/.ssh
racdb1复制文件到racdb2
scp authorized_keys racdb2:~/.ssh/
-------racdb2配置oracle用户 ssh信任关系-------
查看到 racdb1复制过来的authorized_keys
/usr/bin/ssh-keygen -t rsa
/usr/bin/ssh-keygen -t dsa
配置key文件同步,racdb2把认证文件id_rsa.pub、id_dsa.pub文件汇总成一个总的认证文件authorized_keys,authorized_keys,远程复制到racdb1
cd ~/.ssh
cat ~/.ssh/id_rsa.pub >> authorized_keys
cat ~/.ssh/id_dsa.pub >> authorized_keys
scp authorized_keys racdb1:~/.ssh/
racdb1上测试,不用输入密码即为成功
ssh racdb1 date
ssh racdb2 date
ssh racdb1-priv date
ssh racdb2-priv date
racdb2上测试,不用输入密码即为成功
ssh racdb1 date
ssh racdb2 date
ssh racdb1-priv date
ssh racdb2-priv date
---配置 grid用户ssh信任关系---
-------racdb1配置grid用户 ssh信任关系-------
su – grid
mkdir ~/.ssh
chmod 755 ~/.ssh
/usr/bin/ssh-keygen -t rsa
/usr/bin/ssh-keygen -t dsa
配置key文件同步,racdb1把认证文件id_rsa.pub、id_dsa.pub文件汇总成一个总的认证文件authorized_keys,authorized_keys,远程复制到racdb2
cd ~/.ssh
cat ~/.ssh/id_rsa.pub >> authorized_keys
cat ~/.ssh/id_dsa.pub >> authorized_keys
racdb1复制文件到racdb2
scp authorized_keys racdb2:~/.ssh/
--------racdb2配置grid用户 ssh信任关系---------
查看到 racdb1复制过来的authorized_keys
/usr/bin/ssh-keygen -t rsa
/usr/bin/ssh-keygen -t dsa
配置key文件同步,racdb2把认证文件id_rsa.pub、id_dsa.pub文件汇总成一个总的认证文件authorized_keys,authorized_keys,远程复制到racdb1
cd ~/.ssh/
cat ~/.ssh/id_rsa.pub >> authorized_keys
cat ~/.ssh/id_dsa.pub >> authorized_keys
scp authorized_keys racdb1:~/.ssh/
racdb1上测试,不用输入密码即为成功
ssh racdb1 date
ssh racdb2 date
ssh racdb1-priv date
ssh racdb2-priv date
racdb2上测试,不用输入密码即为成功
ssh racdb1 date
ssh racdb2 date
ssh racdb1-priv date
ssh racdb2-priv date
后续会更新
学习交流QQ群76552012,本文原创,如需转载,请联系QQ群
本文的CSDN博客https://blog.csdn.net/ai74le/article/details/89437178