經過 微軟 pai-fs 上傳數據到HDFS (Microsoft OpenPAI)

 準備環境

(我的使用記錄,方便下次使用查閱~~)python

首先保證PAI是登錄狀態:git

 

進入GitHub項目所在地址:github

https://github.com/Microsoft/pai/app

而後切換分支到 spa

具體 使用文檔再這裏:code

https://github.com/Microsoft/pai/tree/pai-0.5.y/pai-fsblog

 

將代碼clone下來後執行:ci

`python pai-fs.py --config host=xxx.xxx.234.79 port=50070 user=root`(配置Server)rem

上傳數據到HDFS

進到pai-fs.py目錄下(也能夠直接絕對路徑),而後經過 :文檔

python pai-fs.py + 參數 +路徑

進行數據上傳

 

具體使用方法:

(Github README.md)

example use:
  pai-fs --config host=10.0.3.9 port=50070 user=root         -- store hdfs config
  pai-fs -ls hdfs://                                         -- list the contents of a root HDFS directory 
  pai-fs -ls hdfs:// --host 10.0.3.9                         -- list the contents of a root HDFS directory with host specified
  pai-fs -ls hdfs:// --host 10.0.3.9 --port 50070 --user root    -- list the contents of a root HDFS directory with host, port and user specified
  pai-fs -ls -r hdfs://                                      -- list the contents of a root HDFS directory, recursively 
  pai-fs -mkdir hdfs://mydir/mysubdir/mysubdir2              -- makes mysubdir2 and all directories along the way 
  pai-fs -rm hdfs://mydir/mysubdir/myfile                    -- removes myfile from mysubdir 
  pai-fs -rm hdfs://mydir/mysubdir                           -- removes mysubdir and all files and directories in it 
  pai-fs -cp c:\mylocalfile hdfs://mydir/myremotedir         -- copy mylocalfile into myremotedir 
  pai-fs -cp -r c:\mylocaldir hdfs://mydir/myremotedir       -- copy mylocaldir into myremotedir, recursively 
  pai-fs -cp -r c:\mylocaldir\* hdfs://mydir/myremotedir     -- copy mylocaldir's contents into myremotedir, recursively 
  pai-fs -cp c:\mylocaldir\\a hdfs://mydir/myremotedir/b     -- copy file a from mylocaldir to myremotedir and rename to b 
  pai-fs -cp -r hdfs://mydir/myremotedir c:\mylocaldir       -- copy myremotedir into mylocaldir, recursively 
  pai-fs -cp -r hdfs://mydir/myremotedir/* c:\mylocaldir     -- copy myremotedir's contents into mylocaldir, recursively 
exit code:
  0   -- Success 
  1   -- An exception happened during the operation including bad connection 
  2   -- PAI_VC environment variable not set to valid VC or insufficient/invalid command line argument(s) 
  3   -- Path not found 
  4   -- Unauthorized access 
  5   -- Path not empty 
  6   -- Check failed after operation 
  100 -- Failed to copy too many times 
  101 -- Failed to concat chunks into file 

使用演示

執行命令後,開始上傳

相關文章
相關標籤/搜索