0025-CENTOS6.5安装CDH5.12.1(二)

温馨提示:要看高清无码套图,请使用手机打开并单击图片放大查看。

5.快速组件服务验证

5.1HDFS验证(mkdir+put+cat+get)

mkdir操作:

[[email protected]~]# hadoop fs -mkdir -p /fayson/test

[[email protected] ~]# hadoop fs -ls /

Found 3 items

drwxr-xr-x - root supergroup 0 2017-09-0506:16 /fayson

drwxrwxrwt - hdfs supergroup 0 2017-09-0504:24 /tmp

drwxr-xr-x - hdfs supergroup 0 2017-09-0504:24 /user

[[email protected] ~]#

put操作:

[[email protected]~]# vim a.txt

1,test

2,fayson

3.zhangsan

[[email protected] ~]#hadoop fs -put a.txt /fayson/test

[[email protected] ~]# hadoop fs -ls /fayson/test

Found 1 items

-rw-r--r-- 3 root supergroup 27 2017-09-05 06:20 /fayson/test/a.txt

[[email protected] ~]#

cat操作:

[[email protected] ~]# hadoop fs -cat /fayson/test/a.txt

1,test

2,fayson

3.zhangsan

[[email protected] ~]#

get操作:

[[email protected]~]# rm -rf a.txt

[[email protected] ~]# hadoop fs -get /fayson/test/a.txt

[[email protected] ~]# cat a.txt

1,test

2,fayson

3.zhangsan

[[email protected] ~]#

5.2Hive验证

使用hive命令行操作

[[email protected]~]# hive

...

hive> create external table test_table(

> s1 string,

> s2 string

> ) row formatdelimited fields terminated by ‘,‘

> stored as textfile location ‘/fayson/test‘;

OK

Time taken: 1.933 seconds

hive> select * from test_table;

OK

1 test

2 fayson

3 zhangsan

Time taken: 0.44 seconds, Fetched: 3row(s)

hive> insert into test_table values("4","lisi");

...

OK

Time taken: 18.815 seconds

hive> select * from test_table;

OK

4 lisi

1 test

2 fayson

3 zhangsan

Time taken: 0.079 seconds, Fetched: 4row(s)

hive>

Hive MapReduce操作

hive> select count(*) from test_table;

Query ID = root_20170905064545_100f033c-49b9-488b-9920-648a2e1c7285

...

OK

4

Time taken: 26.428 seconds, Fetched: 1 row(s)

hive>

5.3MapReduce验证

[[email protected] hadoop-mapreduce]# pwd

/opt/cloudera/parcels/CDH/lib/hadoop-mapreduce

[[email protected] hadoop-mapreduce]#hadoop jar hadoop-mapreduce-examples.jar pi 5 5

Number of Maps = 5

Samples per Map = 5

Wrote input for Map #0

Wrote input for Map #1

Wrote input for Map #2

Wrote input for Map #3

Wrote input for Map #4

Starting Job

17/09/05 06:48:53 INFO client.RMProxy: Connecting to ResourceManager atip-172-31-6-148.fayson.com/172.31.6.148:8032

17/09/05 06:48:53 INFO input.FileInputFormat: Total input paths to process : 5

17/09/05 06:48:53 INFO mapreduce.JobSubmitter: number of splits:5

17/09/05 06:48:54 INFO mapreduce.JobSubmitter: Submitting tokens for job:job_1504585342848_0003

17/09/05 06:48:54 INFO impl.YarnClientImpl: Submitted applicationapplication_1504585342848_0003

17/09/05 06:48:54 INFO mapreduce.Job: The url to track the job:http://ip-172-31-6-148.fayson.com:8088/proxy/application\_1504585342848\_0003/

17/09/05 06:48:54 INFO mapreduce.Job: Running job: job_1504585342848_0003

17/09/05 06:49:01 INFO mapreduce.Job: Job job_1504585342848_0003 running in ubermode : false

17/09/05 06:49:01 INFO mapreduce.Job: map0% reduce 0%

17/09/05 06:49:07 INFO mapreduce.Job: map20% reduce 0%

17/09/05 06:49:08 INFO mapreduce.Job: map60% reduce 0%

17/09/05 06:49:09 INFO mapreduce.Job: map100% reduce 0%

17/09/05 06:49:15 INFO mapreduce.Job: map100% reduce 100%

17/09/05 06:49:16 INFO mapreduce.Job: Job job_1504585342848_0003 completedsuccessfully

17/09/05 06:49:16 INFO mapreduce.Job: Counters: 49

File System Counters

FILE: Numberof bytes read=64

FILE: Numberof bytes written=875624

FILE: Numberof read operations=0

FILE: Numberof large read operations=0

FILE: Number of writeoperations=0

HDFS: Numberof bytes read=1400

HDFS: Numberof bytes written=215

HDFS: Numberof read operations=23

HDFS: Numberof large read operations=0

HDFS: Number of writeoperations=3

Job Counters

Launched map tasks=5

Launched reduce tasks=1

Data-local map tasks=5

Total time spent by all maps in occupiedslots (ms)=27513

            _Total_ **time** spentby all reduces **in** occupied slots (ms)=_3803_
            _Total_ **time** spentby all map tasks (ms)=_27513_
            _Total_ **time** spentby all reduce tasks (ms)=_3803_
            _Total_ vcore-milliseconds taken by all map tasks=27513

Total vcore-millisecondstaken by all reduce tasks=3803

Total megabyte-millisecondstaken by all map tasks=28173312

Total megabyte-millisecondstaken by all reduce tasks=3894272

Map-Reduce Framework

Map inputrecords=5

Map outputrecords=10

Map outputbytes=90

Map outputmaterialized bytes=167

Input splitbytes=810

Combine input records=0

Combine output records=0

Reduce input groups=2

Reduce shuffle bytes=167

Reduce input records=10

Reduce output records=0

Spilled Records=20

Shuffled Maps =5

Failed Shuffles=0

Merged Map outputs=5

GC timeelapsed (ms)=273

            _CPU_ **time** spent(ms)=_4870_
            _Physical_ memory (bytes) snapshot=2424078336

Virtual memory (bytes) snapshot=9435451392

Total committedheap usage (bytes)=2822766592

    _Shuffle_ Errors
            BAD\_ID=0

CONNECTION=0

IO_ERROR=0

WRONG_LENGTH=0

WRONG_MAP=0

WRONG_REDUCE=0

File Input FormatCounters

Bytes Read=590

File Output FormatCounters

Bytes Written=97

Job Finished in 23.453 seconds

Estimated value of Pi is 3.68000000000000000000

[[email protected] hadoop-mapreduce]#

5.4Spark验证

[[email protected]~]# spark-shell

Setting default log level to "WARN".

To adjust logging level use sc.setLogLevel(newLevel).

Welcome to

  _\_\_\_\__              \_\_

/ __/__ ___ _____/ /__

\_\ \/ \_ \/ \_ _`_/\_\_/  ‘\_/

/___/ .__/_,_/_//_/_\ version 1.6.0

/_/

...

Spark context available as sc (master = yarn-client, app id = application_1504585342848_0004).

17/09/05 06:51:59 WARN metastore.ObjectStore: Version information not found in metastore.hive.metastore.schema.verification is not enabled so recording the schemaversion 1.1.0-cdh5.12.1

17/09/05 06:51:59 WARN metastore.ObjectStore: Failed to get database default,returning NoSuchObjectException

SQL context available as sqlContext.

scala> val textFile=sc.textFile("hdfs://ip-172-31-6-148.fayson.com:8020/fayson/test/a.txt")

textFile: org.apache.spark.rdd.RDDString =hdfs://ip-172-31-6-148.fayson.com:8020/fayson/test/a.txt MapPartitionsRDD1 at textFileat <console>:27

scala> textFile.count()

res0: Long = 3

scala>

醉酒鞭名马,少年多浮夸! 岭南浣溪沙,呕吐酒肆下!挚友不肯放,数据玩的花!
温馨提示:要看高清无码套图,请使用手机打开并单击图片放大查看。

欢迎关注Hadoop实操,第一时间,分享更多Hadoop干货,喜欢请关注分享。


原创文章,欢迎转载,转载请注明:转载自微信公众号Hadoop实操

原文地址:http://blog.51cto.com/14049791/2319220

时间: 2024-10-11 09:36:40

0025-CENTOS6.5安装CDH5.12.1(二)的相关文章

CentOS6.5 安装codeblocks-13.12

安装环境CentOS6.5 启动命令行 1.先安装gcc和gcc++,这个可以直接安装 # yum install gcc # yum install gcc-c++ 2.再安装gtk2,也是直接安装 # yum install gtk2* 3.再安装wxGTK,一样的方法 # yum install wxGTK 4.本来要安装xterm的,最后我用的时候发现,显示中文有些显示的是方框,开始以为是codeblocks的事情,最后找到原因了,是这个xterm的问题,输出改成gnome的终端就行了,

1.安装CDH5.12.x

安装方式安装前准备安装步骤安装过程修改/etc/hosts设置ssh 互信修改linux 系统设置安装JDK1.8安装python2.7安装mysql/postgreysql数据库安装ntp设置本地yum源下载CDH parcels包安装CM使用yum安装CM安装agent进入CDH添加节点使用CM添加节点手动安装agent远程yum源安装节点服务安装中出现的问题 安装方式 CDH有三种安装方式 parcels 二进制程序包,包含了CDH组件中的依赖\版本等信息,可以方便的切换CDH版本,CM调

Centos-6.5安装CDH-5.9.0教程

Centos-6.5安 本文是为了帮助想以Cloudera搭建自己大数据管理和运行平台的朋友,由于Cloudera有多种安装方式,经过多次的尝试和研究,本文介绍的是其中一种更容易安装成功的方式,供大家参考. Cloudera的介绍可参考官方文档 cloudera介绍 包含cloudera的各个工程项目,这里就不再细说,直接进入正题. 一.准备工作 1.下载CDH相关文件 Cloudera Manager :http://archive.cloudera.com/cm5/cm/5/cloudera

centos6.7安装oracle 12c r1 (二)

接上一篇 3 配置oracle的环境变量 ORACLE_BASE=/u01/app/oracle TMP=/tmp TMPDIR=/tmp ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1 ORACLE_SID=orcl export ORACLE_SID  ORACLE_BASE ORACLE_HOME  TMP TMPDIR PATH=$PATH:.:$ORACLE_HOME/bin export PATH 四.解压oracle软件包准备安装

腾讯云服务器 Centos6.5 安装 nginx1.12.0

今天买了腾讯云,不要问我为什么没有买阿里云... 入正题: 首先需要安装一些基本环境供nginx使用,就像java环境那样,一个道理,分别安装如下4个脚本来安装 yum install gcc-c++ yum install pcre pcre-devel yum install zlib zlib-devel yum install openssl openssl--devel 拷贝红框中的链接进行下载安装 wget http://nginx.org/download/nginx-1.12.0

centos6.5安装cacti监控(二)

上一篇已经做好了cacti的前期工作,这里来具体设置cacti监控,以Windows7为例 安装snmp a.开始--控制面板--程序和功能--打开或关闭windows功能,会弹出"windows功能"对话框,如图,勾选 "简单网络管理协议(snmp)"直到安装完成 b.开始--运行(快捷键Win+r),输入 "services.msc",按下图步骤操作 4.浏览器进入cacti的配置界面,按如下步骤操作 5.至此,配置完成,看监控的数据吧 6.

CDH5.12.0 中扩容增加计算节点

CDH5.12.0 中扩容增加计算节点 标签(空格分隔): 大数据平台构建 一: 环境准备 二: 增加节点环境系统初始化 三: 增加节点关于CDH5.12.0环境配置 四: 在CM 上面节点增加 一:环境的概述与准备 概述: 很多时候,企业的大数据环境(CDH5.12.0),根据使用的时间越来越长,空间会有不足的情况,集群的计算 能力也因此下降, 此时需要对将大数据的 集群环境进行扩容 增加计算节点. 1.1 系统逻辑部署图 1.2 安装文件详细信息列表: CM: cloudera-manage

Ubuntu14.04用apt安装CDH5.1.2[Apache Hadoop 2.3.0]

--------------------------------------- 博文作者:迦壹 博客名称:Ubuntu14.04用apt安装CDH5.1.2[Apache Hadoop 2.3.0] 博客地址:http://idoall.org/home.php?mod=space&uid=1&do=blog&id=558 转载声明:可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明,谢谢合作! -----------------------------------

ubuntu 12.04 安装 codeblock 12.11

一: Ubuntu  14.04版已经发布了,但本人还是12.04版的,主要是笔记本是双系统,担心升级之后造成不必要的麻烦.所以还在用12.04.在Linux环境下的 C/C++ 开发IDE中,Codeblocks是一个很不错的工具.  现在最新版的是Codeblocks 13.12了.  但我在安装Codeblocks 14.12出错了.(两种安装方法:1. 下载Codeblocks 13.12 包,然后 在命令行安装   2.直接在Ubuntu软件中心安装.都失败了.参考http://qtl