流水账 - 初始化hadoop服务所要使用到的命令

原创
2017/04/21 09:46
阅读数 85

 一年多前简单研究过hadoop,环境centos 6.5 64bit.使用下面的命令逐步助兴即可初始化,留着自己用的。

cd /opt
wget http://mirrors.cnnic.cn/apache/hadoop/common/hadoop-2.6.4/hadoop-2.6.4.tar.gz
tar -xvf hadoop-2.6.4.tar.gz 
ln -s hadoop-2.6.4 hadoop
cp ./etc/hadoop/* input
bin/hadoop jar ./share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.4.jar grep input output 'dfs[a-z.]+' 
cat output/*


rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
yum install nginx
service nginx start

iptables -I INPUT -p tcp --dport 80 -j ACCEPT
service iptables save
service iptables restart
service iptables status

http://10.132.65.77/hadoop-project-dist/hadoop-common/SingleCluster.html

ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa

iptables -I INPUT -p tcp --dport 50070 -j ACCEPT

bin/hdfs dfs -put etc/hadoop /user

bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.4.jar grep /user output 'dfs[a-z.]+'

bin/hdfs dfs -get output output
bin/hdfs dfs -cat output/* -- this is not working

iptables -I INPUT -p tcp --dport 8088 -j ACCEPT

iptables -I INPUT -p tcp --dport 9000 -j ACCEPT

iptables -I INPUT -p tcp --dport 50090 -j ACCEPT
iptables -I INPUT -p tcp --dport 50070 -j ACCEPT
iptables -I INPUT -p tcp --dport 50010 -j ACCEPT
iptables -I INPUT -p tcp --dport 50075 -j ACCEPT
iptables -I INPUT -p tcp --dport 50020 -j ACCEPT


iptables -I INPUT -p tcp --dport 8040 -j ACCEPT
iptables -I INPUT -p tcp --dport 8042 -j ACCEPT
iptables -I INPUT -p tcp --dport 8088 -j ACCEPT
iptables -I INPUT -p tcp --dport 8030 -j ACCEPT
iptables -I INPUT -p tcp --dport 8031 -j ACCEPT
iptables -I INPUT -p tcp --dport 8032 -j ACCEPT
iptables -I INPUT -p tcp --dport 8033 -j ACCEPT

 bin/hdfs namenode -format


javac -classpath ${HADOOP_HOME}/hadoop-${HADOOP_VERSION}-core.jar -d wordcount_classes WordCount.java 
 

 

展开阅读全文
打赏
0
0 收藏
分享
加载中
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部