8.在Tachyon运行MapReduce
阿里云国内75折 回扣 微信号:monov8 |
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6 |
1.1 使用HDFS做UFS
首先要让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 MapReduce的WordCount程序计算
(1)Eclipse下开发WordCountDriver程序
(2)运行WordCountDriver
输入路径和输出路径直接访问tachyon分布式内容文件系统。
提交任务:
hadoop jar wordcount.jar cn.WordCountDrivertachyon://192.168.2.20:19998/test.txt tachyon://192.168.2.20:19998/outwc
阿里云国内75折 回扣 微信号:monov8 |
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6 |