Cloudera Manager安裝之時間服務器和時間客戶端(二)


 

 

福利 => 每天都推送 

歡迎大家,關注微信掃碼並加入我的4個微信公眾號:   大數據躺過的坑      Java從入門到架構師      人工智能躺過的坑         Java全棧大聯盟
 
     每天都有大量的學習視頻資料和精彩技術文章推送... 人生不易,唯有努力。
 
     百家號 :九月哥快訊               快手號:  jiuyuege
 
 
 
 
 

 

前期博客

Cloudera Manager安裝之Cloudera Manager安裝前准備(CentOS6.5)(一)

 

 

 

 

 

帶大家手把手讀cloudera官網

 https://www.cloudera.com/documentation/enterprise/5-3-x.html

 

   說明:這些是可以點擊進入,就直接可以下載得到電子檔了。我這里不多贅述。

 

 

 

 

 

 

 

 

  (1) 找一台機器作為時間服務器

  我這里,放到clouderaManager01這台機器!

  注意,之前是已經做了集群時間同步了。

[hadoop@clouderaManager01 ~]$ sudo rpm -qa|grep ntp
fontpackages-filesystem-1.41-1.1.el6.noarch
ntp-4.2.6p5-10.el6.centos.2.x86_64
ntpdate-4.2.6p5-10.el6.centos.2.x86_64
[hadoop@clouderaManager01 ~]$ sudo vim /etc/ntp.conf 

 

 

  默認是如下

# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

driftfile /var/lib/ntp/drift

# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict -6 ::1

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst

#broadcast 192.168.1.255 autokey        # broadcast server
#broadcastclient                        # broadcast client
#broadcast 224.0.1.1 autokey            # multicast server
#multicastclient 224.0.1.1              # multicast client
#manycastserver 239.255.254.254         # manycast server
#manycastclient 239.255.254.254 autokey # manycast client


# Enable public key cryptography.
#crypto

includefile /etc/ntp/crypto/pw

# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys

# Specify the key identifiers which are trusted.
#trustedkey 4 8 42

# Specify the key identifier to use with the ntpdc utility.
#requestkey 8

# Specify the key identifier to use with the ntpq utility.
#controlkey 8

# Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats

 

 

 

 

   注意,這里有2處地方需要我們進行修改,如下

   因為,

 

   所以,修改地方1:

restrict 192.168.80.0 mask 255.255.255.0 nomodify notrap

 

 

   所以,修改地方2:

#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst

 

 

   有些人的機器上,如果有,需要如下去掉注釋。(我的這里是沒有的)

server 127.127.1.0    #local  clock
fudge   127.127.1.0   stratum  10

 

 

 

 

   (2)找一台機器與,保持boss與時間同步

  我這里,放到clouderaManager01這台機器!

 

[hadoop@clouderaManager01 ~]$ sudo vi /etc/sysconfig/ntpd

 

 

   默認是

# Drop root to id 'ntp:ntp' by default.
OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -g"

 

   

   我們,需要進行修改

# Drop root to id 'ntp:ntp' by default.
SYNC_HWCLOCK=yes
OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -g"

   只需,增加如上的一行即可。

 

 

 

  然后,我們需設置clouderaManager01這台機器的時間服務器,為開機就啟動,方便唄!

[hadoop@clouderaManager01 ~]$ sudo service ntpd status
ntpd is stopped
[hadoop@clouderaManager01 ~]$ sudo service ntpd start
Starting ntpd:                                             [  OK  ]
[hadoop@clouderaManager01 ~]$ sudo chkconfig ntpd on
[hadoop@clouderaManager01 ~]$ sudo chkconfig --list|grep ntpd
ntpd               0:off    1:off    2:on    3:on    4:on    5:on    6:off
ntpdate            0:off    1:off    2:off    3:off    4:off    5:off    6:off
[hadoop@clouderaManager01 ~]$ 

 

 

 

 

  (2) 找三台機器作為時間客戶端

  我這里,放到clouderaManager02和clouderaManager03這三台機器!

  注意,這里使用的是Linux的定時任務,即Linux  Crontab,必須得root用戶來操作啊!我這里是每10分鍾同步一次!

[root@clouderaManager02 hadoop]# pwd
/home/hadoop
[root@clouderaManager02 hadoop]# crontab -l
no crontab for root
[root@clouderaManager02 hadoop]# crontab -e

 

 

 

 

 

 

## sync cluster time
0-59/10 * * * * /usr/sbin/ntpdate clouderamanager01

  其實啊,這里的寫法很多種,我這里不多贅述,我喜歡用這種。

  第一個*是分

  第二個*是時

  第三個*是天

  第四個*是月

  clouderamanager01指的是,時間同步服務器是在哪台機器上。

  10是每10分鍾一次,比如,你也設置為5,即每5分鍾一次。

   

  clouderamanager03這台機器也是一樣!這里不多贅述了。

 

 

 

 

 

 

 

 ***************************************************************

擴展:

   若是在工作中以后,需要手動來時間同步,則分別在時間客戶端(louderaManager02、clouderaManager03和clouderaManager04)上,執行

  sudo /usr/sbin/ntpdate clouderaManager01

   即可,我這里不多說。

 ***************************************************************

 

 

 

 

接下來,我們進入,CM的安裝!

Cloudera Manager安裝之Cloudera Manager 5.3.X安裝(三)(tar方式、rpm方式和yum方式)

 

 

 

 

 

 

 

 

歡迎大家,加入我的4個微信公眾號:    大數據躺過的坑     Java從入門到架構師    人工智能躺過的坑     Java全棧大聯盟    
 
 
 

同時,大家可以關注我的個人博客

   http://www.cnblogs.com/zlslch/   和     http://www.cnblogs.com/lchzls/      http://www.cnblogs.com/sunnyDream/   

   詳情請見:http://www.cnblogs.com/zlslch/p/7473861.html

 

  人生苦短,我願分享。本公眾號將秉持活到老學到老學習無休止的交流分享開源精神,匯聚於互聯網和個人學習工作的精華干貨知識,一切來於互聯網,反饋回互聯網。
  目前研究領域:大數據、機器學習、深度學習、人工智能、數據挖掘、數據分析。 語言涉及:Java、Scala、Python、Shell、Linux等 。同時還涉及平常所使用的手機、電腦和互聯網上的使用技巧、問題和實用軟件。 只要你一直關注和呆在群里,每天必須有收獲

 

      對應本平台的討論和答疑QQ群:大數據和人工智能躺過的坑(總群)(161156071) 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

     打開百度App,掃碼,精彩文章每天更新!歡迎關注我的百家號: 九月哥快訊

 

 

 

 

 

 

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM