本文使用的Hadoop为2.7.7,版本如果不同要下载相应版本的文件

  1. 配置本地的Hadoop库(不需完整安装,但是要有环境支持)

下载文件

https://github.com/speedAngel/hadoop2.7.7

  1. 解压到任意路径,没有中文字符和空格

  1. 把解压包的bin替换到解压路径

  2. 把bin中的Hadoop.dll复制到C:\Windows\System32

  3. 配置环境变量

HADOOP_HOME  D:\Environment\hadoop-2.7.7
HADOOP_CONF_DIR D:\Environment\hadoop-2.7.7\etc\hadoop
YARN_CONF_DIR %HADOOP_CONF_DIR%
PATH %HADOOP_HOME%\bin
  1. IDEA设置本地Hadoop路径

  1. 导入依赖(注意版本一致)

    <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>

</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.7.7</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<version>2.7.7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-mapreduce-client-core -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
<version>2.7.7</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-jobclient</artifactId>
<version>2.7.7</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>2.7.7</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.19</version>
</dependency>
<!--工具类,可以复制对象-->
<!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
</dependency>
</dependencies>
  1. 把集群的core-site.xml和hdfs-site.xml文件放到项目resource路径下。修改对应IP地址

  • core-site.xml

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://192.168.98.129:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/usr/hop/hadoop-2.7.7/data/hopdata</value>
</property>
</configuration>
      
  • hdfs-site.xml

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>
<property>
<name>dfs.namenode.secondary.http-address</name>
<value>192.168.98.130:50090</value>
</property>
<property>
<name>dfs.replication</name>
<value>2</value>
</property>
</configuration>
  • 运行的Main方法里首行添加

        System.setProperty("HADOOP_USER_NAME","root");
System.setProperty("HADOOP_USER_PASSWORD","PASSWORD");

Hadoop(十):本地IDEA链接远程Hadoop的更多相关文章

  1. 码云git本地仓库链接远程仓库

    原文链接: 点我 git提交时,仓库是空的,本地有源码   应该打开cmd   归到项目路径 然后输入git push -u origin master -f 是把本地的项目强制推送到空的仓库 git ...

  2. Hadoop将本地文件复制到Hadoop文件系统

    代码: package com.hadoop; import java.io.BufferedInputStream; import java.io.FileInputStream; import j ...

  3. eclipse 远程链接访问hadoop 集群日志信息没有输出的问题l

    Eclipse插件Run on Hadoop没有用到hadoop集群节点的问题参考来源 http://f.dataguru.cn/thread-250980-1-1.html http://f.dat ...

  4. 本地idea开发mapreduce程序提交到远程hadoop集群执行

    https://www.codetd.com/article/664330 https://blog.csdn.net/dream_an/article/details/84342770 通过idea ...

  5. cdh5 hadoop redhat 本地仓库配置

    cdh5 hadoop redhat 本地仓库配置 cdh5 在网站上的站点位置: http://archive-primary.cloudera.com/cdh5/redhat/6/x86_64/c ...

  6. 【征文】Hadoop十周年特别策划——我与Hadoop不得不说的故事

    2016年是Hadoop的十周年生日,在今年,CSDN将以技术和实战为主题与大家共同为Hadoop庆生.其主要内容包含Hadoop专业词典.系列视频技术解析.Hadoop行业实践.线上问答.线下沙龙. ...

  7. Hadoop十年解读与发展预测

    编者按:Hadoop于2006年1月28日诞生,至今已有10年,它改变了企业对数据的存储.处理和分析的过程,加速了大数据的发展,形成了自己的极其火爆的技术生态圈,并受到非常广泛的应用.在2016年Ha ...

  8. 五十九.大数据、Hadoop 、 Hadoop安装与配置 、 HDFS

    1.安装Hadoop 单机模式安装Hadoop 安装JAVA环境 设置环境变量,启动运行   1.1 环境准备   1)配置主机名为nn01,ip为192.168.1.21,配置yum源(系统源) 备 ...

  9. eclipse连接远程hadoop集群开发时权限不足问题解决方案

    转自:http://blog.csdn.net/shan9liang/article/details/9734693 eclipse连接远程hadoop集群开发时报错   Exception in t ...

随机推荐

  1. Redis02——Redis内存数据如何保存到磁盘

    在前一篇文章中,已经介绍了Redis的基础数据结构,这篇文章将继续介绍Redis的持久化原理. 简介 众所周知Redis的所有数据都存在于内存之中,这就会存在因内存问题而导致的数据丢失,为了避免这一问 ...

  2. search(2)- elasticsearch scala终端:elastic4s

    上篇谈到:elasticsearch本身是一个完整的后台系统,对其的操作使用是通过终端api进行的.elasticsearch本身提供了多种编程语言的api,包括java的esjava.而elasti ...

  3. 基于Ubuntu的ORB-SLAM2项目环境搭建过程

    目录 关于ORB-SLAM2 环境搭建 已有环境 创建环境 新建项目目录 安装Pangolin 安装OpenCV 3.2 安装Eigen DBoW2 and g2o (Included in Thir ...

  4. tomcat源码分析01-启动过程概览

    导读:tomcat是一个开源的web服务器,它实现了我们常用的Servlet,JSP,EL等相关规范,因为其性能稳定,开源等因素得到越来越多开发者的青睐,出于学习的目的,我决定研读其源码,并将阶段性成 ...

  5. 非常详细的 Linux C/C++ 学习路线总结!已拿腾讯offer

    创作不易,点赞关注支持一下吧,我的更多原创技术分享,关注公众号「后端技术学堂」第一时间看! 最近在知乎经常被邀请回答类似如何学习C++和C++后台开发应该具体储备哪些基础技能的问题. 本身我从事的的C ...

  6. JDBC开源框架:DBUtils自定义业务类型相关转换器

    dbutils提供的handler转换不能满足实际业务开发的需求.比如枚举转int,时间类型LocalDateTime,实体对象的属性名与字段未能相对应. mysql表member结构字段: id.m ...

  7. python 产生随机数,随机字符串

    import randomimport string#随机整数:print random.randint(1,50)#随机选取0到100间的偶数:print random.randrange(0, 1 ...

  8. python之目录

    一.python基础 ​ python之字符串str操作方法 ​ python之int (整型) ​ python之bool (布尔值) ​ python之str (字符型) ​ python之ran ...

  9. TensorFlow 安装官方教程:Ubuntu 安装,Mac OS X 安装,Windows 安装

    从我的使用体验来看  Ubuntu 是最好的, Mac 没有显卡,后期跑大项目比较鸡肋,Windows 安装各种依赖各种坑.Ubuntu 安装 TensorFlow 方便,后面安装  TensorFl ...

  10. 计算智能(CI)之粒子群优化算法(PSO)(一)

    欢迎大家关注我们的网站和系列教程:http://www.tensorflownews.com/,学习更多的机器学习.深度学习的知识! 计算智能(Computational Intelligence , ...