CentOS 7下安装配置MapReduce Eclipse开发环境

  • Post author:
  • Post category:其他


1.首先在浏览器下载eclipse,网址如下

http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/neon/1a/eclipse-jee-neon-1a-linux-gtk-x86_64.tar.gz

2.解压eclipse安装包

首先将eclipse安装包复制到/opt下:

cp /home/hadoop/Downloads/eclipse-jee-neon-1a-linux-gtk-x86_64.tar.gz /opt/

接着解压:

tar -zxvf eclipse-jee-neon-1a-linux-gtk-x86_64.tar.gz

3.使用符号连接目录

ln -s /opt/eclipse/eclipse /usr/bin/eclipse

4.创建一个桌面启动器

vim /usr/share/applications/eclipse.desktop

添加如下代码:

[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse
Exec=/usr/bin/eclipse
Icon=/opt/eclipse/icon.xpm
Categories=Application;Development;Java;IDE
Version=1.0
Type=Application
Terminal=0

5.下载Hadoop-Eclipse插件,要注意hadoop版本的对应,我的hadoop版本是2.7.3

下载网址为:http://download.csdn.net/detail/tondayong1981/9668289

6.将插件放在解压后的eclipse的plugins目录下(在此处我的完整目录为/opt/eclipse/plugins)

7.重启eclipse,然后打开

Windows-Preferences

,在窗口左侧的Hadoop Map/Reduce选项设置hadoop的安装路径(我的hadoop安装路径为/home/hadoop/hadoop-2.7.3)

8.Eclipse上,打开

Windows-Perspective-Open Perspective-Other

,选择MapReduce,点击OK,然后在General处配置MapReduce的Location name(此处我填的是myhadoop)、Map/Reduce Master(此处我填的是Host:master,Port:9001)以及DFS Master(此处我填的是Port:9000)。

只要保证Map/Reduce Master和DFS Mastrer,Host和Port配置成与core-site.xml的设置一致即可。

9.上述配置完毕后会在eclipse左侧Project Explorer处有DFS Locations显示,可以看到我的hdfs的存储目录及其中的文件,如下图所示:

参考文献:

1.https://segmentfault.com/a/1190000002651775

2.hadoop-eclipse-plugin-2.7.3.jar:http://download.csdn.net/detail/tondayong1981/9668289?locationNum=3&fps=1

3.http://www.cnblogs.com/kinglau/p/3802705.html


转载于:https://my.oschina.net/xhhuang/blog/807616