Advertisement
pongfactory

prepare_data_bigtools

Sep 30th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. wget https://www.dropbox.com/s/lwj2ksz5jwh875l/data.zip?dl=0 -O data.zip
  2. wget https://www.dropbox.com/s/gby06nhftx7jify/mapreduce.zip?dl=0 -O mapreduce.zip
  3.  
  4. unzip data.zip
  5. unzip mapreduce.zip
  6.  
  7. hdfs dfs -rm -r /user/admin/*
  8. rm ~/cdr_from_hdfs.csv
  9.  
  10. sudo -u hdfs hdfs dfs -mkdir /user/admin
  11. sudo -u hdfs hdfs dfs -chown admin:admin /user/admin
  12.  
  13. hdfs dfs -mkdir -p /user/admin/output
  14.  
  15. hdfs dfs -put ~/data /user/admin
  16. hdfs dfs -ls data
  17. hdfs dfs -ls /user/admin/data
  18.  
  19. sudo -u hdfs hdfs fsck /
  20.  
  21. sudo -u hdfs hdfs dfs -chmod -R 777 /user/admin
  22.  
  23. cd ~
  24. chmod +x ~/mapreduce/ex0/mapper.py
  25. chmod +x ~/mapreduce/ex0/reducer.py
  26. chmod +x ~/mapreduce/ex1/mapper.py
  27. chmod +x ~/mapreduce/ex1/reducer.py
  28. chmod +x ~/mapreduce/ex2/mapper.py
  29. chmod +x ~/mapreduce/ex2/reducer.py
  30. chmod +x ~/mapreduce/ex3/mapper.py
  31. chmod +x ~/mapreduce/ex3/reducer.py
  32. chmod +x ~/mapreduce/ex4_student/mapper_student.py
  33. chmod +x ~/mapreduce/ex4_student/reducer_student.py
  34. chmod +x ~/mapreduce/word_count/mapper.py
  35. chmod +x ~/mapreduce/word_count/reducer.py
  36.  
  37. hdfs dfs -rm -r -f /user/admin/output*
  38.  
  39. hdfs dfs -get /user/admin/data/cdr.csv ~/cdr_from_hdfs.csv
  40. ls ~
  41. head ~/cdr_from_hdfs.csv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement