查看目錄
bin/hadfs dfs -ls /
-
報(bào)錯(cuò):報(bào)錯(cuò)
- 錯(cuò)誤原因:是因?yàn)閏lient在訪問(wèn)代理的時(shí)候出錯(cuò)了。找不到ns1。
-
解決辦法:修改hdfs-site.xml中的proxy的name標(biāo)簽mycluster修改為ns1
修改后的結(jié)果 -
修改后測(cè)試結(jié)果
ls結(jié)果
創(chuàng)建目錄
bin/hdfs dfs -mkdir -p /user/beifeng/mapreduce/temp
上傳文件
命令:bin/hdfs dfs -put etc/hadoop/core-site.xml /user/beifeng/mapreduce/temp
讀取
bin/hdfs dfs -text /mapreduce/temp/core-site.xml/mapreduce/temp/core-site.xml
讀取結(jié)果
手動(dòng)切換namenode的active切換測(cè)試
把nn1置為:standby 。bin/hdfs haadmin -transitionToStandby nn1
把nn2置為:Active。bin/hdfs haadmin -transitionToActive nn2

active



