大數(shù)據(jù)旅程第一步
1吃粒、啟動(dòng)centso后第一件事就是要關(guān)閉防火墻(開發(fā)模式下)虑省,否則將有無(wú)窮無(wú)盡的驚喜!?肝椤! ? ??
(1)查看防火墻狀態(tài):sudo service iptables status
(2)關(guān)閉防火墻:sudo service iptables stop
(3)永久關(guān)閉防火墻:sudo chkconfig iptables off
(4)打開防火墻:sudo service iptables start
2词裤、清空/tmp中的數(shù)據(jù):
$cd /tmp ? ?
$sudo rm -rf *
3刺洒、清空日志中的數(shù)據(jù):
$cd downloads/hadoop-2.7.2/logs/ ? ? ? ? ? ? ??
$rm -rf *
4、格式化:
$hadoop namenode -format
5吼砂、啟動(dòng)集群:
$start-all.sh
6逆航、創(chuàng)建文件夾:
$hdfs dfs -mkdir -p /user/centos/hadoop
7、上傳數(shù)據(jù):
$hdfs dfs -put index.html hadoop
8渔肩、獲取數(shù)據(jù):
注:
使用Hadoop API之前一定要先配置環(huán)境變量
和配置java環(huán)境類似