tachyon编译
目前官网下载的tachyon tar包只支持hadoop-2.2,如果自己的hadoop集群不是这个版本,会出现如下错误
2015-11-01 21:29:09,446 INFO (ClientBase.java:connect) - Tachyon client (version ${project.version}) is trying to connect with FileSystemMaster master @ localhost/127.0.0.1:19998
2015-11-01 21:29:09,447 INFO (ClientBase.java:connect) - Client registered with FileSystemMaster master @ localhost/127.0.0.1:19998
2015-11-01 21:29:09,448 ERROR (FileSystemMasterClient.java:getFileInfo) -
org.apache.thrift.transport.TTransportException
at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:132)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
at org.apache.thrift.transport.TFramedTransport.readFrame(TFramedTransport.java:129)
at org.apache.thrift.transport.TFramedTransport.read(TFramedTransport.java:101)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:429)
at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:318)
所以需要自己手工编译
参考http://tachyon-project.org/documentation/Building-Tachyon-Master-Branch.html
git clone git://github.com/amplab/tachyon.git
mvn -X install -Dhadoop.version=2.5.0-cdh5.3.3 -Dmaven.test.skip=true
tachyon部署
部署参考
http://tachyon-project.org/documentation/Configuring-Tachyon-with-HDFS.html
注意点
1、需要打通master结点到worker结点的自动ssh
2、ssh端口如果不是默认的22端口,需要修改tachyon的相关脚本bin/tachyon bin/tachyon-workers.sh 查找"ssh",指定-p你的端口
3、修改conf/workers
4、配置文件修改
cp tachyon-env.sh.template tachyon-env.sh
修改tachyon-env.sh
export JAVA_HOME=/usr/java/default
export TACHYON_UNDERFS_ADDRESS=hdfs://ip:端口
export TACHYON_WORKER_MEMORY_SIZE=${TACHYON_WORKER_MEMORY_SIZE:-10GB}
//指定worker内存大小
cp ./common/src/main/resources/tachyon-default.properties conf/tachyon-site.properties
修改tachyon-site.properties
tachyon.master.web.port=10099
格式,启动,关闭
./bin/tachyon format
./bin/tachyon-start.sh all Mount
./bin/tachyon-stop.sh
UI界面:http://master:10099
Spark编译
spark 编译 参考http://spark.apache.org/docs/latest/building-spark.html#building-with-buildmvn
上官网下载源码包
修改core/pom.xml里的tachyon版本 make-distribution.sh里的tachyon版本为0.8.1
export MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512m"
./make-distribution.sh --name custom-spark --tgz -Phadoop-2.4 -Pyarn
得到tgz包,解压即可用
Spark结合测试
最后使用Spark测试,参考:http://tachyon-project.org/documentation/Running-Spark-on-Tachyon.html
val s1 = sc.textFile("tachyon://master:19998/datatest/000000_0")
val double1 = s.map(line => line + line)
double1.saveAsTextFile("tachyon://master:19998/outtest")