1:准备好环境包
[root@hadoop001 data]# ll
总用量 532404
-rw-r--r-- 1 root root 42610549 3月 31 09:22 hadoop-2.6.0-cdh5.7.0-src.tar.gz
-rw-r--r-- 1 root root 311585484 3月 31 09:24 hadoop-2.6.0-cdh5.7.0.tar.gz
-rw-r--r-- 1 root root 173271626 3月 31 09:23 jdk-8u45-linux-x64.gz
-rw-r--r-- 1 root root 17699306 3月 31 09:23 zookeeper-3.4.6.tar.gz
1:创建hadoop用户
[root@hadoop001 ~]# which useradd
/usr/sbin/useradd
[root@hadoop001 ~]# useradd hadoop
[root@hadoop001 ~]# su - hadoop
[hadoop@hadoop001 ~]$ mkdir app
[root@hadoop001 data]# ll
总用量 532404
-rw-r--r-- 1 root root 42610549 3月 31 09:22 hadoop-2.6.0-cdh5.7.0-src.tar.gz
-rw-r--r-- 1 root root 311585484 3月 31 09:24 hadoop-2.6.0-cdh5.7.0.tar.gz
-rw-r--r-- 1 root root 173271626 3月 31 09:23 jdk-8u45-linux-x64.gz
-rw-r--r-- 1 root root 17699306 3月 31 09:23 zookeeper-3.4.6.tar.gz
[root@hadoop001 data]# mv * /home/hadoop/app/
1:配置多用户ssh信任关系
[hadoop@hadoop001 ~]$ rm -rf .ssh
[hadoop@hadoop001 ~]$ ssh-keygen
都是回车
[hadoop@hadoop001 ~]$ cd .ssh
[hadoop@hadoop001 .ssh]$ ll
total 8
-rw------- 1 hadoop hadoop 1675 Mar 31 10:43 id_rsa
-rw-r--r-- 1 hadoop hadoop 398 Mar 31 10:43 id_rsa.pub
[hadoop@hadoop001 .ssh]$ cat id_rsa.pub >> authorized_keys
[hadoop@hadoop002 ~]$ scp .ssh/id_rsa.pub root@172.16.121.228:/home/hadoop/.ssh/id_rsa2
[hadoop@hadoop001 .ssh]$ ll
total 20
-rw-rw-r-- 1 hadoop hadoop 398 Mar 31 10:48 authorized_keys
-rw------- 1 hadoop hadoop 1675 Mar 31 10:43 id_rsa
-rw-r--r-- 1 root root 398 Mar 31 10:54 id_rsa2
-rw-r--r-- 1 root root 398 Mar 31 10:56 id_rsa3
-rw-r--r-- 1 hadoop hadoop 398 Mar 31 10:43 id_rsa.pub
[hadoop@hadoop001 .ssh]$ cat id_rsa2 >> authorized_keys
[hadoop@hadoop001 .ssh]$ cat id_rsa3 >> authorized_keys
[hadoop@hadoop001 .ssh]$ exit
[root@hadoop001 ~]# vi /etc/hosts
172.16.121.228 hadoop001 hadoop001
172.16.121.227 hadoop002 hadoop002
172.16.121.229 hadoop003 hadoop003
[root@hadoop001 ~]# su - hadoop
[hadoop@hadoop001 ~]$ scp .ssh/authorized_keys root@hadoop002:/home/hadoop/.ssh/
[hadoop@hadoop001 ~]$ scp .ssh/authorized_keys root@hadoop003:/home/hadoop/.ssh/
验证权限
[hadoop@hadoop001 ~]$ ssh hadoop001 date
[hadoop@hadoop001 .ssh]$ chmod 600 authorized_keys
[hadoop@hadoop002 .ssh]$ ssh hadoop001 date
Sun Mar 31 11:15:18 CST 2019
[hadoop@hadoop002 .ssh]$ ssh hadoop002 date
Sun Mar 31 11:15:21 CST 2019
[hadoop@hadoop002 .ssh]$ ssh hadoop003 date
Sun Mar 31 11:15:25 CST 2019
1:jdk部署
[root@hadoop001 ~]# mkdir /usr/java
[root@hadoop001 ~]# tar -zxvf /home/hadoop/app/jdk-8u45-linux-x64.gz -C /usr/java/
[root@hadoop001 usr]# chown -R root:root /usr/java/
[hadoop@hadoop001 zookeeper]$ vi ~/.bash_profile
export JAVA_HOME=/usr/java/jdk1.8.0_45/
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin
export PATH
1:防火墙
[root@hadoop001 usr]# service iptables status
iptables: Firewall is not running.
[root@hadoop001 usr]# service iptables status
iptables: Firewall is not running.
[root@hadoop001 usr]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@hadoop001 usr]# iptables -F
1:部署zookeeper
[root@hadoop001 ~]# su - hadoop
[hadoop@hadoop001 ~]$ cd app/
[hadoop@hadoop001 app]$ tar -zxvf zookeeper-3.4.6.tar.gz
创建软连接
[hadoop@hadoop001 app]$ ln -s /home/hadoop/app/zookeeper-3.4.6 /home/hadoop/app/zookeeper
[hadoop@hadoop001 app]$ cd zookeeper
[hadoop@hadoop001 zookeeper]$ cd conf/
[hadoop@hadoop001 conf]$ cp zoo_sample.cfg zoo.cfg
[hadoop@hadoop001 zookeeper]$ mkdir data
[hadoop@hadoop001 conf]$ vi zoo.cfg
dataDir=/home/hadoop/app/zookeeper/data
server.1=hadoop001:2888:3888
server.2=hadoop002:2888:3888
server.3=hadoop003:2888:3888
[hadoop@hadoop001 zookeeper]$ touch data/myid
[hadoop@hadoop001 zookeeper]$ echo 1 > data/myid
[hadoop@hadoop001 zookeeper]$ scp conf/zoo.cfg hadoop002:/home/hadoop/app/zookeeper/conf/
[hadoop@hadoop001 zookeeper]$ scp conf/zoo.cfg hadoop003:/home/hadoop/app/zookeeper/conf/
[hadoop@hadoop001 zookeeper]$ scp -r data/ hadoop002:/home/hadoop/app/zookeeper
[hadoop@hadoop001 zookeeper]$ scp -r data/ hadoop003:/home/hadoop/app/zookeeper
[hadoop@hadoop002 data]$ echo 2 > myid
[hadoop@hadoop003 data]$ echo 3 > myid
启动zookeeper
[hadoop@hadoop003 zookeeper]$ cd bin/
[hadoop@hadoop001 zookeeper]$ vi ~/.bash_profile
export JAVA_HOME=/usr/java/jdk1.8.0_45
export ZOOKEEPER_HOME=/home/hadoop/app/zookeeper
PATH=$JAVA_HOME/bin:$ZOOKEEPER_HOME/bin:$PATH:$HOME/bin
export PATH
[hadoop@hadoop001 bin]$ ./zkServer.sh start
效果
[hadoop@hadoop001 bin]$ zkServer.sh status
JMX enabled by default
Using config: /home/hadoop/app/zookeeper/bin/../conf/zoo.cfg
Mode: follower
[hadoop@hadoop002 bin]$ zkServer.sh status
JMX enabled by default
Using config: /home/hadoop/app/zookeeper/bin/../conf/zoo.cfg
Mode: leader
[hadoop@hadoop003 bin]$ zkServer.sh status
JMX enabled by default
Using config: /home/hadoop/app/zookeeper/bin/../conf/zoo.cfg
Mode: follower
hadoop配置文件之core-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<!--Yarn 需要使用 fs.defaultFS 指定NameNode URI -->
<property>
<name>fs.defaultFS</name>
<value>hdfs://ruozeclusterg6</value>
</property>
<!--==============================Trash机制======================================= -->
<property>
<!--多长时间创建CheckPoint NameNode截点上运行的CheckPointer 从Current文件夹创建CheckPoint;默认:0 由fs.trash.interval项指定 -->
<name>fs.trash.checkpoint.interval</name>
<value>0</value>
</property>
<property>
<!--多少分钟.Trash下的CheckPoint目录会被删除,该配置服务器设置优先级大于客户端,默认:0 不删除 -->
<name>fs.trash.interval</name>
<value>1440</value>
</property>
<!--指定hadoop临时目录, hadoop.tmp.dir 是hadoop文件系统依赖的基础配置,很多路径都依赖它。如果hdfs-site.xml中不配 置namenode和datanode的存放位置,默认就放在这>个路径中 -->
<property>
<name>hadoop.tmp.dir</name>
<value>/home/hadoop/app/hadoop-2.6.0-cdh5.7.0/tmp</value>
</property>
<!-- 指定zookeeper地址 -->
<property>
<name>ha.zookeeper.quorum</name>
<value>hadoop001:2181,hadoop002:2181,hadoop003:2181</value>
</property>
<!--指定ZooKeeper超时间隔,单位毫秒 -->
<property>
<name>ha.zookeeper.session-timeout.ms</name>
<value>2000</value>
</property>
<property>
<name>hadoop.proxyuser.hadoop.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hadoop.groups</name>
<value>*</value>
</property>
<property>
<name>io.compression.codecs</name>
<value>org.apache.hadoop.io.compress.GzipCodec,
org.apache.hadoop.io.compress.DefaultCodec,
org.apache.hadoop.io.compress.BZip2Codec,
org.apache.hadoop.io.compress.SnappyCodec
</value>
</property>
</configuration>
hadoop配置文件之hdfs-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<!--HDFS超级用户 -->
<property>
<name>dfs.permissions.superusergroup</name>
<value>hadoop</value>
</property>
<!--开启web hdfs -->
<property>
<name>dfs.webhdfs.enabled</name>
<value>true</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>/home/hadoop/app/hadoop-2.6.0-cdh5.7.0/data/dfs/name</value>
<description> namenode 存放name table(fsimage)本地目录(需要修改)</description>
</property>
<property>
<name>dfs.namenode.edits.dir</name>
<value>${dfs.namenode.name.dir}</value>
<description>namenode粗放 transaction file(edits)本地目录(需要修改)</description>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>/home/hadoop/app/hadoop-2.6.0-cdh5.7.0/data/dfs/data</value>
<description>datanode存放block本地目录(需要修改)</description>
</property>
<property>
<name>dfs.replication</name>
<value>3</value>
</property>
<!-- 块大小256M (默认128M) -->
<property>
<name>dfs.blocksize</name>
<value>268435456</value>
</property>
<!--======================================================================= -->
<!--HDFS高可用配置 -->
<!--指定hdfs的nameservice为ruozeclusterg6,需要和core-site.xml中的保持一致 -->
<property>
<name>dfs.nameservices</name>
<value>ruozeclusterg6</value>
</property>
<property>
<!--设置NameNode IDs 此版本最大只支持两个NameNode -->
<name>dfs.ha.namenodes.ruozeclusterg6</name>
<value>nn1,nn2</value>
</property>
<!-- Hdfs HA: dfs.namenode.rpc-address.[nameservice ID] rpc 通信地址 -->
<property>
<name>dfs.namenode.rpc-address.ruozeclusterg6.nn1</name>
<value>hadoop001:8020</value>
</property>
<property>
<name>dfs.namenode.rpc-address.ruozeclusterg6.nn2</name>
<value>hadoop002:8020</value>
</property>
<!-- Hdfs HA: dfs.namenode.http-address.[nameservice ID] http 通信地址 -->
<property>
<name>dfs.namenode.http-address.ruozeclusterg6.nn1</name>
<value>hadoop001:50070</value>
</property>
<property>
<name>dfs.namenode.http-address.ruozeclusterg6.nn2</name>
<value>hadoop002:50070</value>
</property>
<!--==================Namenode editlog同步 ============================================ -->
<!--保证数据恢复 -->
<property>
<name>dfs.journalnode.http-address</name>
<value>0.0.0.0:8480</value>
</property>
<property>
<name>dfs.journalnode.rpc-address</name>
<value>0.0.0.0:8485</value>
</property>
<property>
<!--设置JournalNode服务器地址,QuorumJournalManager 用于存储editlog -->
<!--格式:qjournal://<host1:port1>;<host2:port2>;<host3:port3>/<journalId> 端口同journalnode.rpc-address -->
<name>dfs.namenode.shared.edits.dir</name>
<value>qjournal://hadoop001:8485;hadoop002:8485;hadoop003:8485/ruozeclusterg6</value>
</property>
<property>
<!--JournalNode存放数据地址 -->
<name>dfs.journalnode.edits.dir</name>
<value>/home/hadoop/app/hadoop-2.6.0-cdh5.7.0/data/dfs/jn</value>
</property>
<!--==================DataNode editlog同步 ============================================ -->
<property>
<!--DataNode,Client连接Namenode识别选择Active NameNode策略 -->
<!-- 配置失败自动切换实现方式 -->
<name>dfs.client.failover.proxy.provider.ruozeclusterg6</name>
<value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
</property>
<!--==================Namenode fencing:=============================================== -->
<!--Failover后防止停掉的Namenode启动,造成两个服务 -->
<property>
<name>dfs.ha.fencing.methods</name>
<value>sshfence</value>
</property>
<property>
<name>dfs.ha.fencing.ssh.private-key-files</name>
<value>/home/hadoop/.ssh/id_rsa</value>
</property>
<property>
<!--多少milliseconds 认为fencing失败 -->
<name>dfs.ha.fencing.ssh.connect-timeout</name>
<value>30000</value>
</property>
<!--==================NameNode auto failover base ZKFC and Zookeeper====================== -->
<!--开启基于Zookeeper -->
<property>
<name>dfs.ha.automatic-failover.enabled</name>
<value>true</value>
</property>
<!--动态许可datanode连接namenode列表 -->
<property>
<name>dfs.hosts</name>
<value>/home/hadoop/app/hadoop-2.6.0-cdh5.7.0/etc/hadoop/slaves</value>
</property>
</configuration>
hadoop配置文件之mapred-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<!-- 配置 MapReduce Applications -->
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
<!-- JobHistory Server ============================================================== -->
<!-- 配置 MapReduce JobHistory Server 地址 ,默认端口10020 -->
<property>
<name>mapreduce.jobhistory.address</name>
<value>hadoop001:10020</value>
</property>
<!-- 配置 MapReduce JobHistory Server web ui 地址, 默认端口19888 -->
<property>
<name>mapreduce.jobhistory.webapp.address</name>
<value>hadoop001:19888</value>
</property>
<!-- 配置 Map段输出的压缩,snappy-->
<property>
<name>mapreduce.map.output.compress</name>
<value>true</value>
</property>
<property>
<name>mapreduce.map.output.compress.codec</name>
<value>org.apache.hadoop.io.compress.SnappyCodec</value>
</property>
</configuration>
hadoop配置文件之yarn-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<!-- nodemanager 配置 ================================================= -->
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
<property>
<name>yarn.nodemanager.localizer.address</name>
<value>0.0.0.0:23344</value>
<description>Address where the localizer IPC is.</description>
</property>
<property>
<name>yarn.nodemanager.webapp.address</name>
<value>0.0.0.0:23999</value>
<description>NM Webapp address.</description>
</property>
<!-- HA 配置 =============================================================== -->
<!-- Resource Manager Configs -->
<property>
<name>yarn.resourcemanager.connect.retry-interval.ms</name>
<value>2000</value>
</property>
<property>
<name>yarn.resourcemanager.ha.enabled</name>
<value>true</value>
</property>
<property>
<name>yarn.resourcemanager.ha.automatic-failover.enabled</name>
<value>true</value>
</property>
<!-- 使嵌入式自动故障转移。HA环境启动,与 ZKRMStateStore 配合 处理fencing -->
<property>
<name>yarn.resourcemanager.ha.automatic-failover.embedded</name>
<value>true</value>
</property>
<!-- 集群名称,确保HA选举时对应的集群 -->
<property>
<name>yarn.resourcemanager.cluster-id</name>
<value>yarn-cluster</value>
</property>
<property>
<name>yarn.resourcemanager.ha.rm-ids</name>
<value>rm1,rm2</value>
</property>
<!--这里RM主备结点需要单独指定,(可选)
<property>
<name>yarn.resourcemanager.ha.id</name>
<value>rm2</value>
</property>
-->
<property>
<name>yarn.resourcemanager.scheduler.class</name>
<value>org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler</value>
</property>
<property>
<name>yarn.resourcemanager.recovery.enabled</name>
<value>true</value>
</property>
<property>
<name>yarn.app.mapreduce.am.scheduler.connection.wait.interval-ms</name>
<value>5000</value>
</property>
<!-- ZKRMStateStore 配置 -->
<property>
<name>yarn.resourcemanager.store.class</name>
<value>org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore</value>
</property>
<property>
<name>yarn.resourcemanager.zk-address</name>
<value>hadoop001:2181,hadoop002:2181,hadoop003:2181</value>
</property>
<property>
<name>yarn.resourcemanager.zk.state-store.address</name>
<value>hadoop001:2181,hadoop002:2181,hadoop003:2181</value>
</property>
<!-- Client访问RM的RPC地址 (applications manager interface) -->
<property>
<name>yarn.resourcemanager.address.rm1</name>
<value>hadoop001:23140</value>
</property>
<property>
<name>yarn.resourcemanager.address.rm2</name>
<value>hadoop002:23140</value>
</property>
<!-- AM访问RM的RPC地址(scheduler interface) -->
<property>
<name>yarn.resourcemanager.scheduler.address.rm1</name>
<value>hadoop001:23130</value>
</property>
<property>
<name>yarn.resourcemanager.scheduler.address.rm2</name>
<value>hadoop002:23130</value>
</property>
<!-- RM admin interface -->
<property>
<name>yarn.resourcemanager.admin.address.rm1</name>
<value>hadoop001:23141</value>
</property>
<property>
<name>yarn.resourcemanager.admin.address.rm2</name>
<value>hadoop002:23141</value>
</property>
<!--NM访问RM的RPC端口 -->
<property>
<name>yarn.resourcemanager.resource-tracker.address.rm1</name>
<value>hadoop001:23125</value>
</property>
<property>
<name>yarn.resourcemanager.resource-tracker.address.rm2</name>
<value>hadoop002:23125</value>
</property>
<!-- RM web application 地址 -->
<property>
<name>yarn.resourcemanager.webapp.address.rm1</name>
<value>hadoop001:8088</value>
</property>
<property>
<name>yarn.resourcemanager.webapp.address.rm2</name>
<value>hadoop002:8088</value>
</property>
<property>
<name>yarn.resourcemanager.webapp.https.address.rm1</name>
<value>hadoop001:23189</value>
</property>
<property>
<name>yarn.resourcemanager.webapp.https.address.rm2</name>
<value>hadoop002:23189</value>
</property>
<property>
<name>yarn.log-aggregation-enable</name>
<value>true</value>
</property>
<property>
<name>yarn.log.server.url</name>
<value>http://hadoop001:19888/jobhistory/logs</value>
</property>
<property>
<name>yarn.nodemanager.resource.memory-mb</name>
<value>2048</value>
</property>
<property>
<name>yarn.scheduler.minimum-allocation-mb</name>
<value>1024</value>
<discription>单个任务可申请最少内存,默认1024MB</discription>
</property>
<property>
<name>yarn.scheduler.maximum-allocation-mb</name>
<value>2048</value>
<discription>单个任务可申请最大内存,默认8192MB</discription>
</property>
<property>
<name>yarn.nodemanager.resource.cpu-vcores</name>
<value>2</value>
</property>
</configuration>
hadoop配置文件之slaves
hadoop001
hadoop002
hadoop003
1:hadoop集群
[hadoop@hadoop001 app]$ tar -zxvf hadoop-2.6.0-cdh5.7.0.tar.gz
[hadoop@hadoop001 app]$ ln -s /home/hadoop/app/hadoop-2.6.0-cdh5.7.0 /home/hadoop/app/hadoop
[hadoop@hadoop001 app]$ cd hadoop
[hadoop@hadoop001 hadoop]$ cd etc/hadoop
[hadoop@hadoop001 hadoop]$ mkdir -p /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/tmp
[hadoop@hadoop001 hadoop]$ mkdir -p /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/data/dfs/name
[hadoop@hadoop001 hadoop]$ mkdir -p /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/data/dfs/jn
[hadoop@hadoop001 hadoop]$ rm -f core-site.xml hdfs-site.xml yarn-site.xml
[hadoop@hadoop001 hadoop]$ rm -f slaves
[hadoop@hadoop001 hadoop]$ scp -r core-site.xml hdfs-site.xml mapred-site.xml slaves yarn-site.xml hadoop002:/home/hadoop/app/hadoop/etc/hadoop
[hadoop@hadoop001 hadoop]$ scp -r core-site.xml hdfs-site.xml mapred-site.xml slaves yarn-site.xml hadoop003:/home/hadoop/app/hadoop/etc/hadoop
[hadoop@hadoop001 hadoop]$ vi hadoop-env.sh
export JAVA_HOME=/usr/java/jdk1.8.0_45
[hadoop@hadoop001 sbin]$ ./hadoop-daemon.sh start journalnode
[hadoop@hadoop002 sbin]$ ./hadoop-daemon.sh start journalnode
[hadoop@hadoop003 sbin]$ ./hadoop-daemon.sh start journalnode
[hadoop@hadoop002 sbin]$ jps
1734 JournalNode
1591 QuorumPeerMain
1785 Jps
格式化hadoop
[hadoop@hadoop001 hadoop]$ hadoop namenode -format
19/04/02 08:29:08 INFO common.Storage: Storage directory /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/data/dfs/name has been successfully formatted.
或者 格式一台后
[hadoop@hadoop001 hadoop]$ scp -r data/ hadoop002:/home/hadoop/app/hadoop
[hadoop@hadoop001 hadoop]$ scp -r data/ hadoop003:/home/hadoop/app/hadoop
[hadoop@hadoop001 hadoop]$ hdfs zkfc -formatZK
[hadoop@hadoop001 sbin]$ ./start-dfs.sh
1:集群启动成功信息
[hadoop@hadoop001 sbin]$ jps
1856 NameNode
1635 QuorumPeerMain
2277 DFSZKFailoverController
1688 JournalNode
1962 DataNode
2347 Jps
[hadoop@hadoop001 sbin]$
[hadoop@hadoop002 hadoop]$ jps
1680 JournalNode
2035 DFSZKFailoverController
2115 Jps
1607 QuorumPeerMain
1883 DataNode
1791 NameNode
[hadoop@hadoop002 hadoop]$
[hadoop@hadoop003 sbin]$ jps
1609 QuorumPeerMain
1772 DataNode
1663 JournalNode
1887 Jps
[hadoop@hadoop003 sbin]$
1:启动yarn.sh
[hadoop@hadoop001 sbin]$ ./start-yarn.sh
[hadoop@hadoop002 sbin]$ ./yarn-daemon.sh start resourcemanager
[hadoop@hadoop001 sbin]$ jps
2596 NodeManager
2501 ResourceManager
2070 DataNode
3047 Jps
1591 QuorumPeerMain
1656 JournalNode
2364 DFSZKFailoverController
1934 NameNode
[hadoop@hadoop002 sbin]$ jps
1680 JournalNode
2035 DFSZKFailoverController
2197 NodeManager
1607 QuorumPeerMain
2535 ResourceManager
1883 DataNode
2638 Jps
1791 NameNode
1:访问控制面板
http://116.62.198.161:50070/dfshealth.html#tab-overview
http://118.31.41.202:50070/dfshealth.html#tab-overview
1:
[hadoop@hadoop001 sbin]$ ./mr-jobhistory-daemon.sh start historyserver
[hadoop@hadoop001 sbin]$ netstat -nlp|grep 3256
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 172.16.121.228:10020 0.0.0.0:* LISTEN 3256/java
tcp 0 0 172.16.121.228:19888 0.0.0.0:* LISTEN 3256/java
tcp 0 0 0.0.0.0:10033 0.0.0.0:* LISTEN 3256/java
http://116.62.198.161:19888/jobhistory
1:启动hadoop集群
[hadoop@hadoop001 ~]$ zkServer.sh start
[hadoop@hadoop002 ~]$ zkServer.sh start
[hadoop@hadoop003 ~]$ zkServer.sh start
[hadoop@hadoop001 sbin]$ ./start-dfs.sh