eclipse上搭建hadoop开发环境
发表于:2024-09-26 作者:千家信息网编辑
千家信息网最后更新 2024年09月26日,一、概述1.实验使用的Hadoop集群为伪分布式模式,eclipse相关配置已完成;2.软件版本为hadoop-2.7.3.tar.gz、apache-maven-3.5.0.rar。二、使用ecli
千家信息网最后更新 2024年09月26日eclipse上搭建hadoop开发环境
一、概述
1.实验使用的Hadoop集群为伪分布式模式,eclipse相关配置已完成;
2.软件版本为hadoop-2.7.3.tar.gz、apache-maven-3.5.0.rar。
二、使用eclipse连接hadoop集群进行开发
1.在开发主机上配置hadoop
①将hadoop-2.7.3.tar.gz解压到本地主机上
②使用windows版本的hadoop中的bin替换目标中的bin文件夹
③配置windows上的hadoop环境变量
2.在eclipse上配置hadoop集群信息
①在eclipse中添加hadoop路径
②配置hadoop集群访问信息
3.在hadoop集群中取消权限验证
hdfs-site.xmldfs.permissions false
4.创建一个文件测试连接权限
5.安装maven
①将maven解压到开发主机上
②在eclipse上添加maven路径
5.新建maven工程
6.修改maven配置文件(maven/pom.xml)
org.apache.hadoop hadoop-client 2.7.3 junit junit 3.8.1 test
7.新建一个类用于测试(WordCount)
import java.io.IOException;import java.util.StringTokenizer; import org.apache.hadoop.conf.Configuration;import org.apache.hadoop.fs.Path;import org.apache.hadoop.io.IntWritable;import org.apache.hadoop.io.Text;import org.apache.hadoop.mapreduce.Job;import org.apache.hadoop.mapreduce.Mapper;import org.apache.hadoop.mapreduce.Reducer;import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;import org.apache.hadoop.util.GenericOptionsParser; public class WordCount { public static class TokenizerMapper extends Mapper
8.配置WordCount
①将log4j.properties移动到WordCount类下
②设置WordCount的运行自变量
8.运行测试
三、jar包的导出与提交执行
1.导出WordCount
2.将导出的jar包上传到hadoop集群
[hadoop@hadoop ~]$ lswc.jar
3.运行
[hadoop@hadoop ~]$ hadoop jar wc.jar WordCount /user/hadoop/input/* /user/hadoop/output/out17/09/06 22:36:56 INFO client.RMProxy: Connecting to ResourceManager at hadoop/192.168.100.141:803217/09/06 22:36:57 INFO input.FileInputFormat: Total input paths to process : 117/09/06 22:36:58 INFO mapreduce.JobSubmitter: number of splits:117/09/06 22:36:58 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1504744740212_000117/09/06 22:36:59 INFO impl.YarnClientImpl: Submitted application application_1504744740212_000117/09/06 22:36:59 INFO mapreduce.Job: The url to track the job: http://hadoop:8088/proxy/application_1504744740212_0001/17/09/06 22:36:59 INFO mapreduce.Job: Running job: job_1504744740212_000117/09/06 22:37:36 INFO mapreduce.Job: Job job_1504744740212_0001 running in uber mode : false17/09/06 22:37:36 INFO mapreduce.Job: map 0% reduce 0/09/06 22:38:26 INFO mapreduce.Job: map 100% reduce 0/09/06 22:38:42 INFO mapreduce.Job: map 100% reduce 100/09/06 22:38:46 INFO mapreduce.Job: Job job_1504744740212_0001 completed successfully
4.查看运行结果
[hadoop@hadoop ~]$ hdfs dfs -cat /user/hadoop/output/out/part-r-00000"AS 1"GCC 1"License"); 1& 1'Aalto 1'Apache 4'ArrayDeque', 1'Bouncy 1'Caliper', 1'Compress-LZF', 1……
配置
集群
运行
开发
文件
测试
主机
信息
权限
版本
路径
环境
分布式
变量
工程
文件夹
模式
目标
结果
自变量
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
开发手机系统的股票软件开发
微职位全栈网络安全课件下载
电子科技互联网访谈
铜陵市教体局网络安全
软件开发的优势与劣势
pc软件开发net
农业银行软件开发中心改名
软件开发人员可以考的证书
面向对象数据库系统的基本特征
如何将2010数据库拆分
联想服务器进入管理口地址
软件开发工作职位类别
魔兽世界台服3.35数据库
延庆区数据网络技术咨询
西安市利通网络技术有限公司
中广核软件开发
郑爽在诛仙哪个服务器
节奏大师服务器关闭
软件开发用啥分辨率
软件开发企业 疫情
万方数据库文章上限
服务器更换ip
数据库设备表
服务器批量导入本地用户
网络安全防御措施
数据库人工管理数据应用背景
煤炭行业网络安全案例
青岛tms管理平台软件开发
武冈网络安全教育活动
惠普刀片服务器架构