CDH集群安裝配置(三)- 集群時間同步(主節點)和 免密碼登錄
阿新 • • 發佈:2019-02-18
6.2 提示 5.0 ssh spool 添加 ask 使用 rontab
集群時間同步(主節點)
1. 查看是否安裝ntp服務,如果沒有安裝
rpm -qa |grep ntpd查看命令
yum install ntp安裝命令
2. 修改配置
vi /etc/ntp.conf 去掉這個註釋,將地址改成網段地址 restrict 10.228.86.252 mask 255.255.255.0 nomodify notrap 註釋掉這幾個 #server 0.centos.pool.ntp.org iburst #server 1.centos.pool.ntp.org iburst #server 2.centos.pool.ntp.org iburst #server3.centos.pool.ntp.org iburst
添加一下內容
server 127.127.1.0
fudge 127.127.1.0 startum 10
3. 配置boot時間和系統時間同步
SYNC_HWCLOCK=yes
4. 啟動ntpd服務器
systemctl start ntpd
systemctl status ntpd
chkconfig ntpd on
chkconfig --list |grep ntpd
5. 客戶機配置(cdh2,chd3)
使用 root用戶操作 輸入 crontab -e 命令進入編輯狀態,然後輸入一下內容(該任務保存在目錄/var/spool/cron 下,必須用root用戶才能看到 ) * * * * * /usr/sbin/ntpdate chd1
免密碼登錄
******配置主機之間的免密ssh登陸 假如 A 要登陸 B 在A上操作: %%首先生成密鑰對 ssh-keygen (提示時,直接回車即可) %%再將A自己的公鑰拷貝並追加到B的授權列表文件authorized_keys中 ssh-copy-id B 如果出現 ssh-copy-id: command not found 需要執行該命令(yum -y install openssh-clients)
CDH集群安裝配置(三)- 集群時間同步(主節點)和 免密碼登錄