Есть амбари кластер на котором установлен hdfs. Амбари кластер установлен через VirtualBox.
Пробую подключиться к hdfs так, но выдает ошибку подключения.
Configuration configuration = new Configuration();
Path p=new Path("hdfs://127.0.0.1:8080/file.txt");
FileSystem fs = FileSystem.get(new URI("hdfs://127.0.0.1:8080"), configuration);
System.out.println(p.getName() + " exists: " + fs.exists(p));
[2021-02-16 13:55:19,044] INFO Retrying connect to server: localhost/127.0.0.1:8080. Already tried 0 time(s). (org.apache.hadoop.ipc.Client:666)
[2021-02-16 13:55:20,053] INFO Retrying connect to server: localhost/127.0.0.1:8080. Already tried 1 time(s). (org.apache.hadoop.ipc.Client:666)
[2021-02-16 13:55:21,054] INFO Retrying connect to server: localhost/127.0.0.1:8080. Already tried 2 time(s). (org.apache.hadoop.ipc.Client:666)
[2021-02-16 13:55:22,055] INFO Retrying connect to server: localhost/127.0.0.1:8080. Already tried 3 time(s). (org.apache.hadoop.ipc.Client:666)
[2021-02-16 13:55:23,057] INFO Retrying connect to server: localhost/127.0.0.1:8080. Already tried 4 time(s). (org.apache.hadoop.ipc.Client:666)
[2021-02-16 13:55:24,059] INFO Retrying connect to server: localhost/127.0.0.1:8080. Already tried 5 time(s). (org.apache.hadoop.ipc.Client:666)
[2021-02-16 13:55:25,061] INFO Retrying connect to server: localhost/127.0.0.1:8080. Already tried 6 time(s). (org.apache.hadoop.ipc.Client:666)
[2021-02-16 13:55:26,063] INFO Retrying connect to server: localhost/127.0.0.1:8080. Already tried 7 time(s). (org.apache.hadoop.ipc.Client:666)
[2021-02-16 13:55:27,065] INFO Retrying connect to server: localhost/127.0.0.1:8080. Already tried 8 time(s). (org.apache.hadoop.ipc.Client:666)
[2021-02-16 13:55:28,068] INFO Retrying connect to server: localhost/127.0.0.1:8080. Already tried 9 time(s). (org.apache.hadoop.ipc.Client:666)
Exception in thread "main" java.net.ConnectException: Call to localhost/127.0.0.1:8080 failed on connection exception: java.net.ConnectException: В соединении отказано
Как считать файл из hdfs в java на локальной машине?