hadoop常用命令


linux常用命令
pwd
查看当前工作目录的绝对路径

cat input.txt
查看input.txt文件的内容

ls
显示当前目录下所有的文件及子目录

rm recommender-dm-1.0-SNAPSHOT-lib.jar
删除当前目录下recommender-dm-1.0-SNAPSHOT-lib.jar文件

cp /home/deploy/pctr/recommender-dm_fat.jar ./
把/home/deploy/pctr/目录下的recommender-dm_fat.jar复制到当前目录下



hadoop hdfs常用命令
hadoop fs -ls /user/deploy/recsys/workspace/ouyangyewei
查看ouyangyewei目录文件

hadoop fs -mkdir /user/deploy/recsys/workspace/ouyangyewei/input
在ouyangyewei目录下创建input文件夹

hadoop fs -rm /user/deploy/recsys/workspace/ouyangyewei/input/input.txt
删除input.txt文件

hadoop fs -rmr /user/deploy/recsys/workspace/ouyangyewei/input
删除input目录以及目录下的所有文件

hadoop fs -put ./input.txt /home/deploy/recsys/workspace/ouyangyewei/input
把当前目录下的input.txt文件复制到input目录下

hadoop jar recommender-dm-1.0-SNAPSHOT-lib.jar com.yhd.ml.statistics.click.WordCount /home/deploy/recsys/workspace/ouyangyewei/input /home/deploy/recsys/workspace/ouyangyewei/output
运行Job,指定的jar包是recommender-dm-1.0-SNAPSHOT-lib.jar,主类是com.yhd.ml.statistics.click.WordCount,输入目录是input,输出目录是output



hbase常用命令
/usr/local/cloud/hbase/bin/hbase shell
用shell来连接hbase

scan 'full_user_profile', {LIMIT=>1}
输出数据表full_user_profile中的1个RowKey

list
列出所有数据表

describe 'full_user_profile'
列出full_user_profile数据表的结构




hive常用命令
show tables;
列出hive里面所有数据表名

desc userProfile;
显示数据表userProfile的基本表字段及字段type

/usr/local/cloud/hive/bin/hive
进入hive数据库

select attribute_name from pms_attribute where attribute_id=21000 and attribute_value_id=105991;
hive的select操作

select user_id, category_id, catgory_pref, attribute_id, attribute_pref, attribute_value_id, attribute_value_pref from userProfile limit 10;
hive的select操作,只显示10行

相关内容

    暂无相关文章