成功在pseudo-distributed mode下运行wordcount 程序
来源:互联网 发布:win10的windows键 编辑:程序博客网 时间:2024/05/23 11:45
搭建pseudo-distributed 环境:
配置文件如下:
::::::::::::::
core-site.xml
::::::::::::::
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
<description>The name of the default file system. A URI whose scheme and authority determine the FileSystem implementation </descripti
on>
</property>
</configuration>
::::::::::::::
hdfs-site.xml
::::::::::::::
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
<description>The actual number of replications can be speci? ed when the is created.</description>
</property>
</configuration>
::::::::::::::
mapred-site.xml
::::::::::::::
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9001</value>
<description>The host and port that the MapReduce job tracker runs at.</description>
</property>
</configuration>
::::::::::::::
masters
::::::::::::::
localhost
::::::::::::::
slaves
::::::::::::::
localhost
单独运行:
bin/stop-all.sh
bin/hadoop namenode - format
bin/start-all.sh
运行jps 检查
首先 重新编译wordcount程序:
生成.calss文件
javac -classpath hadoop-core-0.20.203.0.jar -d playground/classes playground/src/WordCount.java
生成 .jar 文件
jar -cvf playground/wordcount.jar -C playground/classes/ .
将需要的输入文件放入hdfs系统:
hadoop fs -mkdir /user/mjiang/input
hadoop fs -put input/test hdfs://localhost:9000/user/mjiang/input
最后运行程序:
bin/hadoop jar playground/wordcount.jar org.apache.hadoop.examples.WordCount input output
error1:编译版本比运行版本高
Unsupported major.minor version 51.0
resolve: 运行 java -version 是1.7版本 下载1.6版本的tar.gz
error2:bin/hadoop jar playground/wordcount.jar org.apache.hadoop.examples.WordCount input output
不知道是什么意思,写多了也不行少了也不行。
mjiang@venus ~/program/program/hadoop/install/hadoop-0.20.203.0 $bin/hadoop jar playground/wordcount.jar apache.hadoop.examples.WordCount input output
Exception in thread "main" java.lang.ClassNotFoundException: apache.hadoop.examples.WordCount
mjiang@venus ~/program/program/hadoop/install/hadoop-0.20.203.0 $ bin/hadoop jar playground/wordcount.jar playground.classes.org.apache.hadoop.examples.WordCount input output
Exception in thread "main" java.lang.NoClassDefFoundError: playground/classes/org/apache/hadoop/examples/WordCount (wrong name: org/apache/hadoop/examples/WordCount)
- 成功在pseudo-distributed mode下运行wordcount 程序
- Ubuntu下Hadoop伪分布式配置(Pseudo-Distributed Mode)
- Hadoop 伪分布式搭建 Pseudo-Distributed Mode
- 在windows7下Eclipse中运行Hadoop的WordCount程序
- Hadoop 0.20.2 在mac os 10.9 环境下 pseudo distributed 配置
- ubuntu下hadoop运行wordcount程序
- Spark在Yarn上运行Wordcount程序
- 在Windows下的Eclipse中如何将WordCount程序提交到集群运行
- 在伪分布下执行wordcount程序
- [hadoop]How To Install Apache Hadoop Pseudo Distributed Mode on a Single Node
- Installation of Hadoop-1.2.1 Pseudo-distributed mode on Centos 7
- hadoop运行WordCount程序
- Hadoop 运行 Wordcount程序
- 运行WordCount程序
- 运行wordCount程序
- Run SPLAHS2 under SE mode on gem5在gem5的SE模式下,运行SPLASH2程序
- hadoop1.2.1在linux中配置安装独立运行Standalone Operation,伪分布Pseudo-Distributed Operation,集群配置三种配置和测试
- linux下eclipse上运行hadoop自带wordcount程序
- Eclipse 或 MyEclipse 不能自动编译 class文件及不能识别项目
- oracle三个网络配置文件(listener.ora、tnsname.ora、sqlnet.ora)的作用
- Mac睡眠、注销、重启、关机的快捷键
- 算法与数据结构-数学基本公式大全(更新中……)
- Android能否引领移动互联网革命
- 成功在pseudo-distributed mode下运行wordcount 程序
- ORA-14402: 更新分区关键字列将导致分区的更改。
- 珍惜所拥有的
- C语言缺陷与陷阱(笔记)
- Mybatis + MySQL 得到刚刚插入的主键
- RTX管理器中的服务都看不到
- Java 的枚举使用
- wap学习笔记1
- PE信息获取工具