hadoop集群安装好之后的启动操作
hadoop状态的手动切换:不推荐,但是可用
hdfs haadmin -transitionToActive/standby nn2 -forcemanaual
hdfs haadmin -getservicestate nn1/nn2 查看状态
1,启动456的zookeeper
cd /root/soft/zookeeper-3.4.6/bin
./zkServer.sh start
2,查看状态./zkServer.sh status
保证一个leader两个 follower
3,启动journalnode(在hadoop01上启动所有journalnode)
cd /root/soft/hadoop-2.7.1
sbin/hadoop-daemons.sh start journalnode
4,启动HDFS(在hadoop01上执行)
cd /root/soft/hadoop-2.7.1
sbin/start-dfs.sh
5,启动YARN(在hadoop01上执行)
sbin/start-yarn.sh
6,可以统计浏览器访问:
http://hadoop01:50070
NameNode Overview 'hadoop01:9000' (standby)
http://hadoop02:50070
NameNode 'hadoop02:9000' (active)
jps查看进程
kill -9 <pid of NN>杀死进程查看状态
手动启动那个挂掉的NameNode
sbin/hadoop-daemon.sh start namenode
7,管理界面8088,hadoopyear的管理界面(hadoop03)
http://hadoop01:50070 hadoop01的datanode,
8,上传文件,cd /root/
hadoop fs -put words /words
put时候出现这个错误
Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
put: `/words': File exists
无法为你的平台的原生Hadoop加载库…使用内置的Java类,如适用
放:' /字':文件存在
#export HADOOP_OPTS="$HADOOP_OPTS -Djava.net.preferIPv4Stack=true"
export HADOOP_OPTS="-Djava.library.path=$HADOOP_PREFIX/lib:$HADOOP_PREFIX/lib/native"
hadoop checknative -a
全部是失败
字典:
cd /root/soft/hadoop-2.7.1/share/hadoop/mapreduce
hadoop jar hadoop-mapreduce-examples-2.7.1.jar wordcount /words /resultout
在hadoop03启动year,03免登陆到456
hadoop fs -ls /resultout
hadoop fs -cat /resultout/part-r-00000 查看,
hadoop fs -ls /
hadoop调试信息开启关闭:
开启:export HADOOP_ROOT_LOGGER=DEBUG,console
关闭:export HADOOP_ROOT_LOGGER=INFO,console