一、启动HDFS 命令
start-dfs.sh
二、启动HBase 命令
start-hbase.sh
三、HBase命令
1)进入HBase
hbase shell
2)浏览表
scan '表名'
3)当删除表时
首先用 disabled '表名'
然后 drop '表名'
4)退出 exit
四、运行程序前需要把数据文件先放到hdfs目录下
命令
hadoop fs -put file.txt /hw/
否则出现错误 java.io.FileNotFoundException: File does not exist:
五、在linux编译时中文注释乱码 编译出现错误
把文件另存为UTF-8格式 然后在java编译器的命令输入
javac -encoding UTF-8 Hw.java
java -Dfile.encoding="UTF-8" Hw
六、java获取命令行参数
public static void main(String[] args)
其中args数组保存了命令行参数
通过arg[0],arg[1]....获取参数