Big Data technologies to learn and share: Hadoop Cluster Synchronization

  Today we bring technology to share are synchronized --Hadoop cluster.

  A synchronous manner

  Select a machine, as a time server (here choose hadoop01), all the machines are synchronized with the timing of this cluster time, for example, every ten minutes, a time synchronization.

  Second, the tools needed

  Time synchronization server has two: ntpd and ntpdatp. Although both use to achieve the purpose of time synchronization, but have to figure out a problem before use, ntpd ntpdate and what is the difference when updating time. ntpd not only time synchronization server, it may be time synchronization with standard time client and the server, and the synchronization is smooth, not ntpdate immediate synchronization ntpdate caution in a production environment, so both are also not run.

  Third, the specific steps

  Time server configuration

  (1) Check the ntp is installed. [Root @ hadoop01 Desktop] # rpm -qa |. Grep ntp If the display ntp-4.2.6p5-1.el6.centos.x86_64 fontpackages-filesystem-1.41-1.1.el6.noarch

  ntp ntpdate-4.2.6p5-1.el6.centos.x86_64 the proof is already installed, or install ntp service first. [Root @ hadoop01 Desktop] # yum install -y ntp.

  (2) modify ntp configuration file [root @ hadoop01 Desktop] # vi /etc/ntp.conf. Configure authorized clients, that is, to specify the machines (clients) to set access NTP Server, which is configured by restrict term implementation. The release #restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap. Instead restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap. If the cluster is in a closed LAN, you can block out the default server.

  将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 to shield

  #server 0.centos.pool.ntp.org iburst. # server 1.centos.pool.ntp.org iburst. # server 2.centos.pool.ntp.org iburst. # 3.centos.pool.ntp.org server iburst. the local clock time of the machine as a supply source, so that, even if it loses the network connection, it may continue to increase to a network service server 127.127.1.0 fudge 127.127.1.0 stratum. modify / etc / sysconfig / ntpd file

  [Root @ hadoop01 Desktop] # vim / etc / sysconfig / ntpd increase SYNC_HWCLOCK = yes After the restart ntpd, [root @ hadoop01 Desktop] # service ntpd restart, set the default boot ntpd start [root @ hadoop01 Desktop] # chkconfig mtpd on. After you are done, use the date command to view the system time corresponds to the current time, if not correspond, should be the time zone. Change the time zone [root @ hadoop01 Desktop] # tzselect. Follow the prompts to select the correct time zone, then cp / usr / share / zoneinfo / Asia / Shanghai to set a link to / etc / localtime of

  [root@hadoop01 Desktop]# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

  Four other machine configuration

  Every ten minutes to configure synchronization with the time server once

  Required in a cluster of other machines have time to write synchronization scripts, here to hadoop02 for example, [root @ hadoop02 Desktop] # crontab -e. * / 10 * * * * / usr / sbin / ntpdate hadoop01

  Restart crond service. [Root @ hadoop02 Desktop] # service crond restart. If desired, also have to modify the time zone, the operation above.

  This, share the end, we welcome the study to explore!

Guess you like

Origin www.cnblogs.com/coffees/p/12336346.html