우선, HortonWorks Sandbox를 Hadoop dist로 사용하고 있습니다. 사용자 정의 구성이 전혀 없습니다.hdfs에서 디렉토리를 나열하는 데 사용할 호스트와 포트
은 일단 샌드 박스에 연결, 나는 일을 HDFS 디렉토리의 파일을 나열 할 수 있어요 :
[[email protected] ~]# hadoop fs -ls hdfs:///user/guest
을하지만 호스트와 포트를 지정하려고하면 나는 오류 만 얻을 :
을[[email protected] ~]# hadoop fs -ls hdfs://localhost:8020/user/guest ls: Call From sandbox.hortonworks.com/10.0.2.15 to localhost:8020 failed on connection exception: java.net.ConnectException: Connexion refusée; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
[[email protected] ~]# hadoop fs -ls hdfs://localhost:9000/user/guest ls: Call From sandbox.hortonworks.com/10.0.2.15 to localhost:9000 failed on connection exception: java.net.ConnectException: Connexion refusée; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
나는 올바른 호스트 및 포트를 알게되면 사용, 내 자바 전화에서 사용할 수 있습니다 :
Path pt = new Path("hdfs://host:port/user/guest/test-text-file.txt");
감사합니다. 튜토리얼에서 포트 9000 또는 "localhost : 8020"에 대한 이야기가 나쁘다 (http://hortonworks.com/hadoop-tutorial/using-commandline-manage-files-hdfs/). – Tristan