I followed your advice to add the port number as follows: % hadoop FileSystem.Cat hdfs://localhost:9000/user/hadoop-user/input/mapred-site.xml
and it runs correctly :-) Thank you very much! 2011/5/23, Ayon Sinha <ayonsi...@yahoo.com>: > Are you able to run the hdfs filesystem shell commands? Can you try adding > the port number of the namenode in the > URI hdfs://localhost/user/hadoop-user/input/mapred-site.xml ? > > -Ayon > See My Photos on Flickr > Also check out my Blog for answers to commonly asked questions. > > > > ________________________________ > From: Yang Xiaoliang <yangxiaoliang2...@gmail.com> > To: hdfs-user@hadoop.apache.org; Ayon Sinha <ayonsi...@yahoo.com> > Sent: Sunday, May 22, 2011 9:51 AM > Subject: Re: FileSystemCat ipc.Client: Retrying connect to server: > > yes , I sure of that. > > 2011/5/23, Ayon Sinha <ayonsi...@yahoo.com>: >> Is yours hdfs running? >> >> -Ayon >> See My Photos on Flickr >> Also check out my Blog for answers to commonly asked questions. >> >> >> >> ________________________________ >> From: Yang Xiaoliang <yangxiaoliang2...@gmail.com> >> To: hdfs-user@hadoop.apache.org >> Sent: Sunday, May 22, 2011 7:23 AM >> Subject: FileSystemCat ipc.Client: Retrying connect to server: >> >> Hi All, >> >> I am just reading the book *Hadoop: The Definitive Guide *by Tom White, >> there is an example for the *FileSystem* class in chapter 3, >> example3-2: >> ------------------------------------------------------------------------------------------ >> public class FileSystemCat { >> >> import java.io.InputStream; >> import java.net.URI; >> >> import org.apache.hadoop.conf.Configuration; >> import org.apache.hadoop.fs.FileSystem; >> import org.apache.hadoop.fs.Path; >> import org.apache.hadoop.io.IOUtils; >> >> public static void main(String[] args) throws Exception { >> String uri = args[0]; >> Configuration conf = new Configuration(); >> FileSystem fs = FileSystem.get(URI.create(uri), conf); >> InputStream in = null; >> try { >> in = fs.open(new Path(uri)); >> IOUtils.copyBytes(in, System.out, 4096, false); >> } finally { >> IOUtils.closeStream(in); >> } >> } >> } >> --------------------------------------------------------------------------------------------- >> I run the program as follows: >> % export HADOOP_CLASSPATH=. >> % hadoop FileSystem.Cat >> hdfs://localhost/user/hadoop-user/input/mapred-site.xml >> >> and then, what i got was as fllows: >> >> ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already >> tried 0 time(s). >> 11/05/22 20:45:53 INFO ipc.Client: Retrying connect to server: localhost/ >> 127.0.0.1:8020. Already tried 1 time(s). >> 11/05/22 20:45:53 INFO ipc.Client: Retrying connect to server: localhost/ >> 127.0.0.1:8020. Already tried 1 time(s). >> 11/05/22 20:45:54 INFO ipc.Client: Retrying connect to server: localhost/ >> 127.0.0.1:8020. Already tried 2 time(s). >> .................................... >> >> can anyone help?