Previous:
Hadoop3 cluster construction - virtual machine installation
Hadoop3 cluster building - install hadoop, configure the environment
The installed virtual machines are found to be inconsistent in time, and the difference is relatively large. For hadoop clusters, time synchronization is required.
At this time, you need an ntp service.
1. Install ntp on each node
yum install ntp
2. Set the time zone to Asia Shanghai on each node
timedatectl set-timezone Asia/Shanghai
3. Start the ntp service on each node and execute the following commands in sequence
systemctl start ntpd
systemctl enable ntpd
4. Set the current time on the master
timedatectl set-ntp no
timedatectl set-time HH:MM:SS
timedatectl set-ntp yes
5. Configure the ntp service on the master
[hadoop@venn05 ~]$ vim /etc/ntp.conf [hadoop@venn05 ~]$ more /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). operation file / var / lib / ntp / operation # Permit time synchronization with our time source, but do not # permit the source to query or modify the service on this system. restrict default 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 # ntp server points to itself restrict :: 1 restrict 192.168 . 0.0 mask 255.255 . 0.0 # accept 192.168 segment clients
6. Restart the ntp service on the master
systemctl restart ntpd
7. Synchronize the master's time on other nodes
[root@venn08 hadoop]# ntpdate venn05
25 Apr 23:23:48 ntpdate[1430]: step time server 192.168.1.5 offset -1.082561 sec
8. Start the ntp service on other nodes
systemctl start ntpd
systemctl enable ntpd
9. Synchronize all node times
timedatectl set-ntp yes
get it
Previous:
Hadoop3 cluster construction - virtual machine installation
Hadoop3 cluster building - install hadoop, configure the environment