对HDFS的HA进行测试
2018-02-26 本文已影响140人
明明德撩码
查看目录
bin/hadfs dfs -ls /
-
报错:
报错
- 错误原因:是因为client在访问代理的时候出错了。找不到ns1。
-
解决办法:修改hdfs-site.xml中的proxy的name标签mycluster修改为ns1
修改后的结果
-
修改后测试结果
ls结果
创建目录
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
读取结果
手动切换namenode的active切换测试
把nn1置为:standby 。bin/hdfs haadmin -transitionToStandby nn1
把nn2置为:Active。bin/hdfs haadmin -transitionToActive nn2
