赞
踩
参考网站:
大数据期末考试一篇通 ---10万条音乐专辑的数据分析 - 6风筝9 - 博客园 (cnblogs.com)
/usr/local/hadoop/sbin/start-dfs.sh
cd /usr/local/eclipse/
./eclipse
hdfs dfs -put ~/train1.csv /input
hdfs dfs -cat /output/part-r-00000
hdfs dfs -rm -r /output
创建目录
hdfs dfs -mkdir /个人学号/exam
hdfs dfs -put/albums.csv /个人学号/exam
查看行数
前20行数据: bin/hdfs dfs -cat /个人学号/exam/albums.csv | head -20
后20行数据: bin/hdfs dfs -cat /个人学号/exam/albums.csv | tail -20
启动HDFS 和HBase
启动HDFS:
cd /usr/local/
start-dfs.sh
启动HBase:
cd /usr/local
start-hbase.sh
hbase shell
创建表
create 'part','program','Name','performers'
查看
list
describe 'part'
get 'student','00001'
插入信息
put 'part','00001','program','2019-歌曲'
put 'part','00001','name','夜空中最星'
put 'part','00001','performers','于毅、扎西平措、傲日其愣'
查看当前表格
scan 'part'
修改
put 'part','00001','name','夜空中最亮的星'
删除
disable 'student'
drop 'student'
删除行
delete 'part','00001','performers'
或者创建另类表
create 'teacher',{NAME=>'username',VERSIONS=>5}
list
增加
put 'teacher','91001','username','A1'
put 'teacher','91001','username','A2'
put 'teacher','91001','username','A3'
put 'teacher','91001','username','A4'
put 'teacher','91001','username','A5'
查看后三行
scan 'teacher','91001',{COLUMN=>'username',VERSIONS=>3}
最后
exit
stop-hbase.sh
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。