Google Cloud Storage を永続データのバックエンドとして使用して、Google Cloud Platform で Hadoop クラスタを実行しています。リモート マシンからマスター ノードに SSH で接続し、hadoop fs コマンドを実行できます。とにかく、次のコードを実行しようとすると、タイムアウト エラーが発生します。
コード
FileSystem hdfs =FileSystem.get(new URI("hdfs://mymasternodeip:8020"),new Configuration());
Path homeDir=hdfs.getHomeDirectory();
//Print the home directory
System.out.println("Home folder: " +homeDir);
// Create a directory
Path workingDir=hdfs.getWorkingDirectory();
Path newFolderPath= new Path("/DemoFolder");
newFolderPath=Path.mergePaths(workingDir, newFolderPath);
if(hdfs.exists(newFolderPath))
{
hdfs.delete(newFolderPath, true); //Delete existing Directory
}
//Create new Directory
hdfs.mkdirs(newFolderPath);
hdfs.exists() コマンドを実行すると、タイムアウト エラーが発生します。
エラー
org.apache.hadoop.net.ConnectTimeoutException: gl051-win7/192.xxx.1.xxx から 111.222.333.444.bc.googleusercontent.com:8020 への呼び出しがソケット タイムアウト例外で失敗しました: org.apache.hadoop.net.ConnectTimeoutException : チャネルの接続準備が整うまでの待機中に 20000 ミリ秒のタイムアウトが発生しました。ch : java.nio.channels.SocketChannel[connection-pending remote=111.222.333.444.bc.googleusercontent.com/111.222.333.444:8020]
Google Cloud Platform 上の Hadoop に対して Java Hadoop API を使用する際の制限を認識していますか?
ありがとう!