windows下安裝並啟動hadoop2 7 2

2021-08-04 09:00:49 字數 3259 閱讀 1126

3、去d:\hadoop-2.7.2\etc\hadoop找到下面4個檔案並按如下最小配置貼上上去:

core-site.xml

<

configuration

>

<

property

>

<

name

>fs.defaultfs

name

>

<

value

>hdfs://localhost:9000

value

>

property

>

configuration

>

hdfs-site.xml

<

configuration

>

<

property

>

<

name

>dfs.replication

name

>

<

value

>1

value

>

property

>

<

property

>

<

name

>dfs.namenode.name.dir

name

>

<

value

>file:/hadoop/data/dfs/namenode

value

>

property

>

<

property

>

<

name

>dfs.datanode.data.dir

name

>

<

value

>file:/hadoop/data/dfs/datanode

value

>

property

>

configuration

>

mapred-site.xml

<

configuration

>

<

property

>

<

name

>mapreduce.framework.name

name

>

<

value

>yarn

value

>

property

>

configuration

>

yarn-site.xml

<

configuration

>

<

property

>

<

name

>yarn.nodemanager.aux-services

name

>

<

value

>mapreduce_shuffle

value

>

property

>

<

property

>

<

name

>yarn.nodemanager.aux-services.mapreduce.shuffle.class

name

>

<

value

>org.apache.hadoop.mapred.shufflehandler

value

>

property

>

configuration

>

4、啟動windows命令列視窗,進入hadoop-2.7.2\bin目錄,執行下面2條命令,先格式化namenode再啟動hadoop

d:\hadoop-2.7.2\bin>hadoop namenode -format

.

.

.

d:\hadoop-2.7.2\bin>cd ..\sbin

d:\hadoop-2.7.2\sbin>start-all.cmd

this script is deprecated. instead use start-dfs.cmd and start-yarn.cmd

starting yarn daemons

d:\hadoop-2.7.2\sbin>jps

4944 datanode

5860 nodemanager

3532 jps

7852 namenode

7932 resourcemanager

d:\hadoop-2.7.2\sbin>

通過jps命令可以看到4個程序都拉起來了,到這裡hadoop的安裝啟動已經完事了。接著我們可以用瀏覽器到localhost:8088看mapreduce任務,到localhost:50070->utilites->browse the file system看hdfs檔案。如果重啟hadoop無需再格式化namenode,只要stop-all.cmd再start-all.cmd就可以了。

上面拉起4個程序時會彈出4個視窗,我們可以看看這4個程序啟動時都幹了啥

1.建立輸入目錄

d:\hadoop\hadoop\bin>hadoop fs -mkdir hdfs://localhost:9000/user/

d:\hadoop\hadoop\bin>hadoop fs -mkdir hdfs://localhost:9000/user/wcinput

2.上傳資料到目錄

d:\hadoop\hadoop\bin>hadoop fs -put d:\file1.txt hdfs://localhost:9000/user/wcinput

d:\hadoop\hadoop\bin>hadoop fs -put d:\file2.txt hdfs://localhost:9000/user/wcinput

3.檢視檔案 

d:\hadoop\hadoop\bin

>hadoop fs -ls

hdfs://localhost:9000/user/wcinput

windows下安裝並啟動redis服務

安裝服務 redis server service install redis.windows.conf loglevel verbose 解除安裝服務 redis server service uninstall 啟動服務 redis server.exe service start 停止服務 r...

windows下安裝並啟動hadoop2 7 2

3 去d hadoop 2.7.2 etc hadoop找到下面4個檔案並按如下最小配置貼上上去 core site.xml fs.defaultfsname hdfs localhost 9000value property configuration hdfs site.xml dfs.repl...

windows下安裝啟動memcached服務失敗

輸入 memcached h 正常顯示如下 但是memecached d start 失敗 服務列表中沒有memcached服務 2.在cmd下輸入 c memcached memcached.exe d install 安裝。注意 這一步很多初學者都安裝不了,執行上面命令後控制台會提示如下錯 fa...