网络时间协议 NTP(Network Time Protocol),可以用来同步网络中各个计算机的时间。CentOS7自带了ntp服务,这个服务不仅可以设置让本机和其他计算机做时间同步,还可以让本机扮演一个time server的角色,让局域网其他计算机和本机同步时间。修改配置文件/etc/ntp.conf可以把一台计算机设置为时间服务器,或与其他服务器同步时间。
mysql> grant all on *.* to oozie identified by '!Qaz123456'; ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) mysql> update mysql.user set Grant_priv='Y',Super_priv='Y'where user = 'root' and host = 'localhost'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges; mysql> quit Bye You have new mail in /var/spool/mail/root [root@node02 ~]# systemctl restart mysqld.service [root@node02 ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.7.27 MySQL Community Server (GPL)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> grant all on *.* to hive identified by '!Qaz123456'; Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> grant all on *.* to oozie identified by '!Qaz123456'; Query OK, 0 rows affected, 1 warning (0.00 sec)
#切换hdfs用户对hdfs文件系统进行测试是否能够进行正常读写 [root@node01 ~]# su hdfs [hdfs@node01 ~]# hadoop dfs -ls / DEPRECATED: Use of this script to execute hdfs command is deprecated. Instead use the hdfs command for it.
Found 1 items d-wx------ - hdfs supergroup 0 2019-10-11 08:21 /tmp [hdfs@node01 ~]# touch test [hdfs@node01 ~]# vi test hello world
[hdfs@node01 ~]$ hadoop dfs -put words /test [hdfs@node01 ~]$ hadoop dfs -ls / DEPRECATED: Use of this script to execute hdfs command is deprecated. Instead use the hdfs command for it.
Found 2 items drwxr-xr-x - hdfs supergroup 0 2019-10-11 09:09 /test d-wx------ - hdfs supergroup 0 2019-10-11 08:21 /tmp [hdfs@node01 ~]$ hadoop dfs -ls /test DEPRECATED: Use of this script to execute hdfs command is deprecated. Instead use the hdfs command for it.
Found 1 items -rw-r--r-- 3 hdfs supergroup 12 2019-10-11 09:09 /test/words [hdfs@node01 ~]$ hadoop dfs -text /test/words DEPRECATED: Use of this script to execute hdfs command is deprecated. Instead use the hdfs command for it.
[hdfs@node01 ~]$ hadoop jar /opt/cloudera/parcels/CDH-5.14.2-1.cdh5.14.2.p0.3/jars/hadoop-mapreduce-examples-2.6.0-cdh5.14.2.jar wordcount /test/words /test/output 19/10/11 22:47:59 INFO client.RMProxy: Connecting to ResourceManager at node03.kaikeba.com/192.168.52.120:8032 19/10/11 22:47:59 INFO mapreduce.JobSubmissionFiles: Permissions on staging directory /user/hdfs/.staging are incorrect: rwx---rwx. Fixing permissions to correct value rwx------ 19/10/11 22:48:00 INFO input.FileInputFormat: Total input paths to process : 1 19/10/11 22:48:00 INFO mapreduce.JobSubmitter: number of splits:1 19/10/11 22:48:00 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1570847238197_0001 19/10/11 22:48:01 INFO impl.YarnClientImpl: Submitted application application_1570847238197_0001 19/10/11 22:48:01 INFO mapreduce.Job: The url to track the job: http://node03.kaikeba.com:8088/proxy/application_1570847238197_0001/ 19/10/11 22:48:01 INFO mapreduce.Job: Running job: job_1570847238197_0001 19/10/11 22:48:28 INFO mapreduce.Job: Job job_1570847238197_0001 running in uber mode : false 19/10/11 22:48:28 INFO mapreduce.Job: map 0% reduce 0% 19/10/11 22:50:10 INFO mapreduce.Job: map 100% reduce 0% 19/10/11 22:50:17 INFO mapreduce.Job: map 100% reduce 17% 19/10/11 22:50:19 INFO mapreduce.Job: map 100% reduce 33% 19/10/11 22:50:21 INFO mapreduce.Job: map 100% reduce 50% 19/10/11 22:50:24 INFO mapreduce.Job: map 100% reduce 67% 19/10/11 22:50:25 INFO mapreduce.Job: map 100% reduce 83% 19/10/11 22:50:29 INFO mapreduce.Job: map 100% reduce 100% 19/10/11 22:50:29 INFO mapreduce.Job: Job job_1570847238197_0001 completed successfully 19/10/11 22:50:30 INFO mapreduce.Job: Counters: 49 File System Counters FILE: Number of bytes read=144 FILE: Number of bytes written=1044048 FILE: Number of read operations=0 FILE: Number of large read operations=0 FILE: Number of write operations=0 HDFS: Number of bytes read=118 HDFS: Number of bytes written=16 HDFS: Number of read operations=21 HDFS: Number of large read operations=0 HDFS: Number of write operations=12 Job Counters Launched map tasks=1 Launched reduce tasks=6 Data-local map tasks=1 Total time spent by all maps in occupied slots (ms)=100007 Total time spent by all reduces in occupied slots (ms)=24269 Total time spent by all map tasks (ms)=100007 Total time spent by all reduce tasks (ms)=24269 Total vcore-milliseconds taken by all map tasks=100007 Total vcore-milliseconds taken by all reduce tasks=24269 Total megabyte-milliseconds taken by all map tasks=102407168 Total megabyte-milliseconds taken by all reduce tasks=24851456 Map-Reduce Framework Map input records=1 Map output records=2 Map output bytes=20 Map output materialized bytes=120 Input split bytes=106 Combine input records=2 Combine output records=2 Reduce input groups=2 Reduce shuffle bytes=120 Reduce input records=2 Reduce output records=2 Spilled Records=4 Shuffled Maps =6 Failed Shuffles=0 Merged Map outputs=6 GC time elapsed (ms)=581 CPU time spent (ms)=11830 Physical memory (bytes) snapshot=1466945536 Virtual memory (bytes) snapshot=19622957056 Total committed heap usage (bytes)=1150287872 Shuffle Errors BAD_ID=0 CONNECTION=0 IO_ERROR=0 WRONG_LENGTH=0 WRONG_MAP=0 WRONG_REDUCE=0 File Input Format Counters Bytes Read=12 File Output Format Counters Bytes Written=16 You have new mail in /var/spool/mail/root [hdfs@node01 ~]$ hdfs dfs -ls /test/output Found 7 items -rw-r--r-- 3 hdfs supergroup 0 2019-10-11 22:50 /test/output/_SUCCESS -rw-r--r-- 3 hdfs supergroup 0 2019-10-11 22:50 /test/output/part-r-00000 -rw-r--r-- 3 hdfs supergroup 8 2019-10-11 22:50 /test/output/part-r-00001 -rw-r--r-- 3 hdfs supergroup 0 2019-10-11 22:50 /test/output/part-r-00002 -rw-r--r-- 3 hdfs supergroup 0 2019-10-11 22:50 /test/output/part-r-00003 -rw-r--r-- 3 hdfs supergroup 0 2019-10-11 22:50 /test/output/part-r-00004 -rw-r--r-- 3 hdfs supergroup 8 2019-10-11 22:50 /test/output/part-r-00005 [hdfs@node01 ~]$ hdfs dfs -text /test/output/part-r-00001 world 1 [hdfs@node01 ~]$ hdfs dfs -text /test/output/part-r-00005 hello 1 You have new mail in /var/spool/mail/root [hdfs@node01 ~]$