8.在Tachyon运行MapReduce

来源:互联网 发布:js数组长度函数 编辑:程序博客网 时间:2024/04/29 07:57

1.1  使用HDFSUFS

首先要让hadoop正常识别tachyon文件系统,需要做如下工作:

1)编辑conf/core-site.xml文件,添加如下内容

<property>

<name>fs.tachyon.impl</name>

<value>tachyon.hadoop.TFS</value>

</property>

 

2)向lib目录放入对应的依赖包(在tachyon-0.5.0/client/target目录下找),名称为tachyon-client-0.5.0-jar-with-dependencies.jar,放入hadoop lib包目录(hadoop-1.0.4/lib  或者编辑conf/hadoop-env.sh,添加如下内容:

export HADOOP_CLASSPATH=/usr/local/tachyon/client/target/tachyon-client-0.5.0-jar-with-dependencies.jar

 

3)重启hadoop

 

1.2  Tachyon命令行访问HDFS数据

HDFS上的数据加载到Tachyon中:

tachyon loadufstachyon://192.168.2.20:19998/ hdfs://192.168.2.20:9001/  (参数三可选,需要排除的目录)

 

加载完成后,通过tachyontfs命令查看

[root@mycluster bin]# tachyon tfs cat/hdfs_data

 

hello  world

hello  China

hello  tom

 

1.3  MapReduceWordCount程序计算

1Eclipse下开发WordCountDriver程序

 

2)运行WordCountDriver

输入路径和输出路径直接访问tachyon分布式内容文件系统。

 

提交任务:

hadoop jar wordcount.jar cn.WordCountDrivertachyon://192.168.2.20:19998/test.txt tachyon://192.168.2.20:19998/outwc

0 0
原创粉丝点击