0

The pscp tell me, it is successful.

pscp -P 22 part-00003 username@172.31.143.131:/home/username/lab2_hdfs

username@172.31.143.131's password:
part-00000                | 758 kB | 758.9 kB/s | ETA: 00:00:00 | 100%

But I didn't see it in my hadoop when I use hdfs dfs -ls, why?

2 Answers2

0

HDFS is not the same as your local filesystem. You can't upload files to HDFS using SCP

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
0

According your command you have just transfered your local file to a remote host and into a remote directory (/home/username/lab2_hdfs). At that stage HDFS wasn't involved at all and therefore do not know about the new file.

You may have a look into articles like Hadoop: copy a local file to HDFS and use commands like

hadoop fs -put part-00003 /hdfs/path
U880D
  • 8,601
  • 6
  • 24
  • 40