Learning the basics of HDFS

Open a terminal. Enter the command sudo service ssh restart to restart the ssh service

Enter start-dfs.sh start HDFS, and then enter jps View java process

Open the Web page, enter the URL http: // localhost: 50070 you can view the situation of HDFS.

 

Enter hadoop fs -ls / view the files in the root directory of HDFS

Enter the command to create a test file hadoop fs -mkdir / test

Then enter the command hadoop fs -touchz /test/a.txt creates a file in the test file a.txt

Command hadoop fs -ls / test / view files created

Use the command hadoop fs -rm -r /test/a.txt can delete the created file a.txt

Use the command touch b.txt can create a file in the local b.txt.

Enter vi b.txt into the file. After entering the key i Press content editing mode , for any input. Press Esc to exit edit mode, press: key, enter: wq to save and exit. 

输入hadoop fs -put b.txt /test/可以将编辑好的文件上传到HDFS

输入hadoop fs -cat /test/b.txt可以查看b.txt的内容

Guess you like

Origin blog.csdn.net/weixin_44961794/article/details/91126112