免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
在Ubuntu上裝Hadoop - fuliang - JavaEye技術(shù)網(wǎng)站

在裝Hadoop之前首先需要:

1.java1.6.x 最好是sun的,1.5.x也可以

2.ssh

安裝ssh

 

$ sudo apt-get install ssh
$ sudo apt-getinstall rsync

 

 

下載Hadoop

http://hadoop.apache.org/core/releases.html 下載最近發(fā)布的版本

 

最好為hadoop創(chuàng)建一個(gè)用戶:

比如創(chuàng)建一個(gè)group為hadoop user為hadoop的用戶以及組

 

$ sudo addgroup hadoop
$ sudo adduser--ingroup hadoop hadoop

 

解壓下載的hadoop文件,放到/home/hadoop目錄下 名字為hadoop 

配置JAVA_HOME:

 

gedit ~/hadoop/conf/hadoop-env.sh

 

 

Java代碼
  1. # The java implementation to use.  Required.  
  2. # export JAVA_HOME=/usr/lib/j2sdk1.5-sun  

 

 修改成java的安裝目錄:(我的是:/usr/lib/jvm/java-6-sun-1.6.0.15)

 

# The java implementation to use. Required.
export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.15
 

 

現(xiàn)在可以使用單節(jié)點(diǎn)的方式運(yùn)行:

 

$ cd hadoop
$ mkdir input
$ cp conf/*.xmlinput
$ bin/hadoop jar hadoop-*-examples.jar grep input output'dfs[a-z.]+'
$ cat output/*

 

Pseudo-distributed方式跑:

 

配置ssh

 

$ su - hadoop
$ ssh-keygen -t rsa -P ""
Generating public/private rsa key pair.
Enter file in which to savethe key (/home/hadoop/.ssh/id_rsa):
Created directory'/home/hadoop/.ssh'.
Your identification has been saved in/home/hadoop/.ssh/id_rsa.
Your public key has been saved in/home/hadoop/.ssh/id_rsa.pub.
The key fingerprint is:
9d:47:ab:d7:22:54:f0:f9:b9:3b:64:93:12:75:81:27 hadoop@ubuntu

 

 讓其不輸入密碼就能登錄:

 

hadoop@ubuntu:~$ cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys

 

  使用:

 

$ ssh localhost

 

 看看是不是直接ok了。

 

 

hadoop配置文件:

conf/core-site.xml

 

Java代碼
  1. <?xml version="1.0"?>  
  2. <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>  
  3.   
  4. <!-- Put site-specific property overrides in this file. -->  
  5.   
  6. <configuration>  
  7.    <property>  
  8.     <name>hadoop.tmp.dir</name>  
  9.         <value>/home/hadoop/hadoop-datastore/hadoop-${user.name}</value>  
  10.    </property>  
  11.    <property>  
  12.     <name>fs.default.name</name>  
  13.     <value>hdfs://localhost:9000</value>  
  14.    </property>  
  15. </configuration>  

 

 hadoop.tmp.dir配置為你想要的路徑,${user.name}會(huì)自動(dòng)擴(kuò)展為運(yùn)行hadoop的用戶名

 

conf/hdfs-site.xml

 

Xml代碼
  1. <configuration>  
  2.   <property>  
  3.     <name>dfs.replication</name>  
  4.     <value>1</value>  
  5.   </property>  
  6. </configuration>  

 

 dfs.replication為默認(rèn)block復(fù)制數(shù)量

conf/mapred-site.xml

 

Xml代碼
  1. <configuration>  
  2.   <property>  
  3.     <name>mapred.job.tracker</name>  
  4.     <value>localhost:9001</value>  
  5.   </property>  
  6. </configuration>  

 

 執(zhí)行

 

格式化分布式文件系統(tǒng):

 

$ bin/hadoop namenode -format

 

 啟動(dòng)hadoop:

 

Java代碼
  1. $ bin/start-all.sh  

 

 可以從

 

NameNode - http://localhost:50070/
JobTracker - http://localhost:50030/

 

 查看NameNode和JobTracker

 

運(yùn)行例子:

 

 

$ bin/hadoop fs -put conf input
$ bin/hadoop jar hadoop-*-examples.jar grep inputoutput 'dfs[a-z.]+'

 

look at the run result:

$ bin/hadoop fs -get output output
$ catoutput/*
 

 

參考:1、http://hadoop.apache.org/common/docs/current/quickstart.html
2、http://www.michael-noll.com/wiki/Running_Hadoop_On_Ubuntu_Linux_%28Single-Node_Cluster%29
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
超詳細(xì)單機(jī)版搭建hadoop環(huán)境圖文解析
hadoop核心配置文件
搭建hadoop1.2集群
CentOS 6.5 配置hadoop 2.6.0偽分布式
Hadoop偽分布涉及的一些linux操作和配置
hadoop安裝教程
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服